claude-code-source-analysis (xiaonancs)
A systems-engineering reconstruction of the complete Claude Code agent harness from a reverse-engineered v2.1.88 snapshot (includes the extracted source zip plus appendix analyses). Part of a series that also covers OpenAI Codex CLI internals, giving a comparative harness view.
View source on GitHubKey takeaways
- 01
Reconstructs the full harness from an actual extracted v2.1.88 snapshot
- 02
Sister studies (Codex CLI) enable cross-harness comparison
- 03
Strong on context management and compaction mechanics
Flows built on this research
Memory & Context
Implement Context Compaction
Keep long agent sessions alive by compacting old conversation into structured summaries before the context window fills.
4 steps · 90-120 minutes
Memory & Context
Session Summaries That Survive Compaction
Write durable session summaries at the right moments so knowledge outlives compaction and process restarts.
4 steps · 60-90 minutes
Memory & Context
Prompt-Cache-Aware Conversation Design
Structure your agent's context for prefix caching: stable prefixes, append-only history, and cache-friendly dynamic content.
3 steps · 45-75 minutes
MCP & Tooling
Tool Result Size Management
Stop tool outputs from flooding context: budgets per tool, smart truncation, pagination, and reference-based results.
4 steps · 60-90 minutes