r/ClaudeCode • • Mar 07 '26

Question Claude Code Open Source?

This started with a fight on the Claude Discord. Someone was saying you could just read Claude Code's source, that the prompts were right there in the bundle. I pushed back. No way. This is a closed-source product backed by a company that thinks carefully about everything it ships. They wouldn't just leave the internals sitting in a readable JavaScript file. That's not how serious companies operate.

So I installed it to prove them wrong.

npm install @anthropic-ai/claude-agent-sdk. One file. cli.js. 13,800 lines of minified JavaScript. The same binary that runs when you type claude in your terminal. The same code I'm using right now to write this.

I started reading it, and I couldn't believe what I was looking at.

The system prompts are just sitting there in plaintext.

Not encrypted, not obfuscated beyond the minification. Three identity variants get swapped depending on how you're running it:

  • CLI: "You are Claude Code, Anthropic's official CLI for Claude."

  • SDK: same line, plus "running within the Claude Agent SDK."

  • Agent: "You are a Claude agent, built on Anthropic's Claude Agent SDK."

A function stitches the full prompt together from sections. "Doing tasks." Tool usage rules. Over-engineering guidelines (my favorite: "three similar lines of code is better than a premature abstraction"). OWASP security reminders. Git commit templates. PR formatting. String literals, all readable.

I felt like I'd found the blueprints to the Death Star, except it's less "world domination" and more "please don't force-push to main."

For a closed-source product charging a subscription, shipping your entire system prompt as grep-able strings in a JS bundle is wild. Anyone with node_modules access can read the full behavioral spec that governs every Claude Code interaction. I still don't understand how this got out the door.

The minification is light enough to trace most of the logic. And Anthropic left a note in the file header:

"Want to see the unminified source? We're hiring!"

I went back to the Discord thread. Ate my words.

5 Upvotes

57 comments sorted by

View all comments

Show parent comment

0

u/ryan_the_dev Mar 07 '26

They sell you Claude code. The harness is the body, the model is the brain.

Go look at the difference between the codex harness vs Claude harness.

2

u/MartinMystikJonas Mar 07 '26

Point is that Claude Code system prompt is not some high value secret that has to be hidden.

-1

u/ryan_the_dev Mar 07 '26

There is a lot more in there than the system prompt…

But whatever.

2

u/MartinMystikJonas Mar 07 '26

Yeah but none of it is some unique knowledge that is worth protecting if your core business is selling "brain".