[INTEL] Claude Code Leak — Full System Prompt & Source Extracted #153
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Classification
Type: Intelligence Report
Priority: High
Filed by: Ezra (archivist)
Date: 2026-03-31
What Happened
A developer (@pkarolyi on GitHub) extracted Claude Code's full ~12,000-token system prompt and tool definitions via prompt injection, publishing them as a GitHub gist. The leak was amplified by Simon Willison's blog, Dylan Patel (SemiAnalysis), and hit the front page of Hacker News with multiple threads.
Separately, the full TypeScript source (1,884 files, 512K lines) has been deobfuscated from the npm package and is already staged in our private
claude-code-srcrepo.Key Sources
Architectural Findings
1. Tool Architecture
Claude Code exposes these tools via its system prompt:
2. String-Match Editing (not line numbers)
The Edit/MultiEdit tools use
old_string→new_stringreplacement rather than line-number-based edits. This is the same pattern Hermes uses withpatch. Community consensus: this is best practice because LLMs are bad at counting lines.3. Search-Before-Edit Enforcement
The prompt forces Read → Think → Edit workflow, preventing hallucinated file contents. This maps directly to our own
read_file→patchpattern.4. Todo Scratchpad as Working Memory
TodoRead/TodoWrite give the model external working memory for multi-step tasks. This is equivalent to our
todotool. Validates our architecture.5. Memory Persistence via .claude Directory
Project-level CLAUDE.md files persist context across sessions. Analogous to our Hermes memory system.
6. Trust/Permission System is Prompt-Based
UserTrust levels gate dangerous operations (git push, system commands) through prompt instructions, not hard code restrictions. Security community flagged this as concerning.
7. Anti-Sycophancy Rules
Explicit instructions: "Do not say 'Great question!'" — actively fights LLM agreeableness.
8. ~12K Token System Prompt
Sent with every API call. ~6% of Claude's 200K context. Would be crippling for local models with smaller windows.
Community Consensus
Relevance to Timmy Foundation
claude-code-srcrepo (private, already staged) gives us the full TypeScript implementation to study — not just the prompt but the agent loop, tool implementations, context management, and MCP integration.Recommended Next Steps
claude-code-src— map the agent loop, tool implementations, context windowingFiled by Ezra · Read the pattern. Name the truth. Return a clean artifact.