From 23ae8ec64be6f2f31bd8bc33ce608df60a7402ef Mon Sep 17 00:00:00 2001 From: Chauncygu Date: Sat, 4 Apr 2026 09:43:09 -0700 Subject: [PATCH] add claude code analysis 20260404 --- README.MD | 25 +++++++++++++++++++++++++ docs/cc_analysis/analysis_20260401 | 1 + 2 files changed, 26 insertions(+) create mode 160000 docs/cc_analysis/analysis_20260401 diff --git a/README.MD b/README.MD index 168bf4f..aff45e1 100644 --- a/README.MD +++ b/README.MD @@ -4,6 +4,7 @@ > Source archive of Claude Code and different versions of the clean-room Python rewrite research repository ## 🔥🔥🔥 News (Pacific Time) +- Apr 04, 2026: [Deep-dive analysis docs added (docs/cc_analysis/analysis_20260401): context compression, multi-agent architecture, memory system, hidden features, model-switching, rollback mechanism, effort level, and tracking-data cleanup guide](#5-docscc_analysis) - 12:20 PM · Apr 02, 2026: [Nano Claude Code v3.0: Multi-agent packages, memory package, skill package with built-in skills, argument substitution, fork/inline execution, AI memory search, git worktree isolation, agent type definitions (~5000 Lines)](https://github.com/SafeRL-Lab/nano-claude-code) - 7:40 AM · Apr 02, 2026: [Nano Claude Code v2.0: A Minimal Python Reimplementation (~3400 Lines), support open and closed source models, skill and memory](https://github.com/SafeRL-Lab/nano-claude-code) - 8:36 AM · Apr 01, 2026: [Nano Claude Code v1.0: A Minimal Python Reimplementation (~1300 Lines)](https://github.com/SafeRL-Lab/nano-claude-code) @@ -48,6 +49,7 @@ + [Features](#features) + [Supported Models](#supported-models) + [Project Structure](#project-structure) + * [5. docs/cc\_analysis](#5-docscc_analysis) * [Comparison of the Projects](#comparison-of-the-projects) * [License and Disclaimer](#license-and-disclaimer) @@ -439,6 +441,29 @@ SendMessage(agent_name="my-agent", message="...") --- +## 5. docs/cc\_analysis + +Independent deep-dive analysis documents produced from the leaked Claude Code source snapshot (2026-03-31). All documents are based on the TypeScript source and are primarily written in Chinese. + +### analysis\_20260401 + +| Document | Content | +| -------- | ------- | +| [Claude Code 上下文管理算法学习笔记](docs/cc_analysis/analysis_20260401/Claude_Code_Context_Management_Notes.md) | Step-by-step walkthrough of the context management algorithm: `autoCompact`, micro/reactive/trimmed compression strategies, and `toolResultStorage` | +| [Claude Code 多 Agent 架构深度分析](docs/cc_analysis/analysis_20260401/claude-code-multi-agent-architecture.md) | Deep analysis of the multi-agent architecture across 37+ files: `src/utils/swarm/`, `AgentTool/`, `coordinator/` | +| [Claude Code 值得借鉴的算法与设计模式](docs/cc_analysis/analysis_20260401/Claude_Code_Notable_Algorithms.md) | Notable algorithms and design patterns worth borrowing from the source (complements the context management notes) | +| [Claude Code 自动回滚机制解析与版本切换指南](docs/cc_analysis/analysis_20260401/Claude-Code-Version-Rollback.md) | How the automatic rollback mechanism works and a practical version-switching guide | +| [Claude Code 上下文压缩算法深度分析](docs/cc_analysis/analysis_20260401/Claude_Code上下文压缩算法深度分析.md) | Detailed reverse-engineering of the 11-file `src/services/compact/` compression pipeline | +| [Claude Code 是否偷换模型?模型切换机制深度分析](docs/cc_analysis/analysis_20260401/Claude_Code模型切换机制深度分析.md) | Source-level analysis of model-selection logic: `model.ts`, `withRetry.ts`, and `claude.ts` | +| [Claude Code Memory 记忆系统深度分析](docs/cc_analysis/analysis_20260401/Claude_Code记忆系统深度分析.md) | Full analysis of the 7-layer memory system: `memdir/`, `extractMemories/`, `SessionMemory/`, `teamMemorySync/` | +| [Claude Code 隐藏高级功能全景图](docs/cc_analysis/analysis_20260401/Claude_Code隐藏高级功能全景图.md) | Map of 55+ feature flags, 20+ hidden commands, and several undisclosed subsystems | +| [Claude Code 默认 Effort Level 设置笔记](docs/cc_analysis/analysis_20260401/Claude%20Code%20默认%20Effort%20Level%20设置笔记.md) | How to persist `/effort max` across sessions (default resets to `medium` on restart) | +| [清除 Claude Code 追踪数据指南](docs/cc_analysis/analysis_20260401/清除Claude_Code追踪数据指南.md) | macOS guide for clearing telemetry and tracking data stored by Claude Code | +| [Claude Code 深度分析报告 (PDF)](docs/cc_analysis/analysis_20260401/Claude_Code_深度分析报告.pdf) | Comprehensive analysis report in PDF format (Chinese) | +| [Claude Code Deep Analysis Report (PDF)](docs/cc_analysis/analysis_20260401/Claude_Code_Deep_Analysis_Report.pdf) | Comprehensive analysis report in PDF format (English) | + +--- + ## Comparison of the Projects | Dimension | original-source-code | claude-code-source-code | claw-code | nano-claude-code | diff --git a/docs/cc_analysis/analysis_20260401 b/docs/cc_analysis/analysis_20260401 new file mode 160000 index 0000000..185359d --- /dev/null +++ b/docs/cc_analysis/analysis_20260401 @@ -0,0 +1 @@ +Subproject commit 185359d451f4f6144e97f4ed477f9a9a43e8d140