← all repositories
he-yufeng/CoreCoder

Half a million lines of TypeScript, compressed to 1,400 of Python

CoreCoder reverse-engineers Claude Code's half-million-line TypeScript source into a 1,400-line Python blueprint you can read in one sitting.

1.5k stars Python Coding AssistantsAgents
CoreCoder
Velocity · 7d
+3.7
★ / day
Trend
cooling
star history

What it does

CoreCoder is a ~1,400-line Python implementation of the core patterns that make Claude Code work: search-and-replace editing, parallel tool execution, three-layer context compression, sub-agents, dangerous-command blocking, session persistence, and dynamic system prompts. It runs against any OpenAI-compatible API and ships as both a CLI and a library. The author reverse-engineered the leaked 512,000-line TypeScript source and kept only the load-bearing walls.

The interesting bit

The project treats minimalism as a feature, not a constraint. It intentionally omits Skills, MCP, and plugins so the codebase stays a teaching artifact rather than creeping toward yet another bloated agent framework. If you want the full tool, the author’s separate AnyCoder project exists; this is the annotated schematic.

Key highlights

  • Seven Claude Code patterns implemented in runnable Python, none longer than 200 lines (context.py is the largest at 196).
  • Model-agnostic by default via OpenAI-compatible APIs; optional LiteLLM extra unlocks 100+ providers including Bedrock and Vertex.
  • Extensible tool system: custom tools inherit from a base class and run in about 20 lines.
  • Includes session save/resume, mid-conversation model switching, and a /compact command for context compression.
  • Seven accompanying articles dissect Claude Code’s agent loop, streaming executor, and 44 hidden feature flags.

Caveats

  • Deliberately incomplete: no Skills, Subagents, or MCP support, so it’s a learning scaffold rather than a daily driver.
  • If you want a practical tool, the author points you to AnyCoder instead.

Verdict

Grab this if you want to understand how Claude Code actually works under the hood; skip it if you just need an AI to edit your files and don’t care about the machinery.

Frequently asked

What is he-yufeng/CoreCoder?
CoreCoder reverse-engineers Claude Code's half-million-line TypeScript source into a 1,400-line Python blueprint you can read in one sitting.
Is CoreCoder open source?
Yes — he-yufeng/CoreCoder is open source, released under the MIT license.
What language is CoreCoder written in?
he-yufeng/CoreCoder is primarily written in Python.
How popular is CoreCoder?
he-yufeng/CoreCoder has 1.5k stars on GitHub and is currently cooling off.
Where can I find CoreCoder?
he-yufeng/CoreCoder is on GitHub at https://github.com/he-yufeng/CoreCoder.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.