I’m curious if someone else has experienced Claude Code blocking them from a Zig project or code recently?
I know this might sound paranoia but after how Anthropic behaves as a company (secrecy with changes) and after the entire Bun issue fork I’m not sure if this just a coincidence.
In February, I wrote a very simple code with Claude Code, nothing special. Just pure Zig.
Yesterday, I wanted to make a modification to it and Claude blocked me citing their cybersecurity policies. The same code it wrote and worked in the past, it has nothing related to security except it uses certificates for authentication. I then open Claude in another session that uses the similar authentication with a completely different codebase, and it worked just fine. Decided to try using the same planning prompt back on Zig, and it refused again.
I was in such disbelieve I did this several times. It seems they only refused to work on the Zig code, no option to use another model either, just basically stopped the session entirely.
Now I’m curious if Anthropic is not doing this to other Zig users on purpose. I’m one second way from cancelling my subscription over this as people say Codex is just as good now. And I want to use open source tools like open code which don’t work with Claude anymore. Not sure if Openai is better here, but I’m not paying hundreds of dollars a month just to have Claude refuse to touch Zig code.
This seems so strangely a coincidence with Anthropic also forcing Bun to move to Rust. So I’m curious to ask if this was just an accident or other Zig users hit similar issues.
Try zig init on empty repo
Run claude code as separate application not within ide
Don’t remember exactly use /clean or clear on order to start new session
Pretty sure nothing related to zigophobia
I cannot help you answer your question, as I don’t use any LLMs to write code. But I have a possible (but not very plausable) explanation for this.
In case you haven’t read Thompson’s “Turing Award Acceptance Lecture” (and assuming you haven’t attended in 1984), the moral of his talk is: You can’t trust code that you did not totally create yourself. And he demonstrates that at the hand of extending the C compiler source with some code, creating the new compiler executable, and then removing the code, but keeping its functionality. He does so essentially by have the compiler executable noticing it is compiling the compiler source code and re-inserting the removed code piece while compiling.
Given your experience, combined with knowing Andrew’s stance on LLM/AI usage, I would not be surprised if Andrew has read Thompson’s paper, and implemented in an earlier version of the ZIg compiler a code segment such as Thompson describes. A segment that reinserts itself, when the zig compiler compiles itself even (i.e. even with that code segment removed from the source)
And assuming the code segment also notices that the compiler is used to generates code for a javascript runtime. And if so, inserts in that runtime, during compilation, code, that notices that it (the run-time) is used in interaction with LLMs. That code in the run-time sees you interact with it for working with Zig code and blocks its functionality.
Far fetched and unlikely (although I doubt it is beyond Andrew’s and the rest of the core team’s capabilities, I don’t think any of them is that devious). But if such a code segment did exist, and made it into the zig compiler, and when that was before Bun forked it. The actual source for that segment, as Thompson proves, didn’t have to be in the source code tree that they worked on, as long as they compiled it with the normal zig to start with (they might have forked when the bootstrap was C++ based).
Now that would be a good reason for them to rewrite Bun in Rust.
Already run Claude code in a separated terminal CLI, not from the IDE. They don’t allow using your subscription anymore with IDE’s. I did not have the IDE running here when I did this, just the official Claude Code installation.
Going to try it eventually. Claude is pretty good with Zig code, nothing fancy, just basic things I want to learn as I code by hand for other languages. Newcomer to Zig so I wanted to speed up things.
When I did ask ChatGPT about Zig in the past, I think it was version 3, maybe 2 years back, it was very bad, did not actually know anything about Zig.
Grok was better, but Claude actually does write working Zig code.
Can’t reproduce, I had Claude try to write me the initial version of a Zig tool last night so I could wake up and fix all the stuff it did wrong, and it did it with no complaints, reading my ~/.zvm/master folder like I told it to for the stdlib docs. Using latest Opus in Claude code CLI. LLMs are inherently unpredictable, so there’s a decent chance it’ll just work the next time you try it.
What happen here is not botched code. Claude blocked me entirely citing a violation on cybersecurity policies as if my Zig code would somehow cause doomsday on the planet
I guess I was hit with some bug on their blocking tools somehow. Between this false positives and their outages I think I might actually try Codex. Not a fan of OpenAI either but local AI is not great yet, and certainly not with Zig.
Zig is so new that most LLM’s are not trained to understand Zig properly.
Theoretically possible since you have a wasm blob during bootstrapping. However as funny as that would be, I dont think its even really feasable without an unreasonable amount of maintenance for the backdoor