Claude Code Architecture Instruction
Description
Unofficial study notes and architecture breakdowns for Claude Code
Installation
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open the source below and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
README
Claude Code Architecture Instruction
非官方的 Claude Code 架构学习仓库,聚焦运行时宿主(Harness)、上下文压缩、QueryEngine、工具系统、权限控制、会话记忆与端到端工作流等关键模块。
This is an unofficial study repository that documents the architecture and runtime workflow of Claude Code in Markdown and Obsidian Canvas format.
当前版本:`v1.1.0`
更新时间:`2026-04-10`
详细变更见 [`CHANGELOG.md`](./CHANGELOG.md),机器可读版本号见 [`VERSION`](./VERSION)。
仓库内容
compact_architecture.md解析compact相关模块的三级上下文防爆策略。end_to_end_workflow.md从用户输入到后台记忆落盘,串起完整生命周期。harness_engine_architecture.md从宿主工程视角解释 Claude Code 的运行时底盘。entrypoint_architecture.md说明 CLI 入口与命令分发。eval_harness_introduction.md解释 evaluation harness 与 runtime harness 的区别与典型形态。QueryEngine_architecture.md说明 QueryEngine 的职责与状态流转。query_architecture.md解析主推理循环与工具调用编排。Tool_architecture.md解析工具系统、权限拦截与执行沙盒。permissions_architecture.md关注危险操作的安全边界设计。hooks_architecture.md说明 Hook 机制与扩展触发点。mcp_architecture.md说明 MCP 作为外部能力接入层的定位。sessionMemory_architecture.md说明会话级记忆的提取与复用。extractMemories_architecture.md说明跨会话长期记忆的沉淀方式。extractMemories_prompts_architecture.md拆解记忆提取提示词设计。prompts_architecture.md聚焦系统提示词与上下文组织方式。context_architecture.md说明环境感知、Git 状态注入与系统上下文构建。srcarchitecture.md提供src/源码结构的全量索引与高层模块导览。Claude-Code-Architecture.canvasClaude Code 架构总览白板。Harness-Engineering-Architecture.canvasHarness 宿主工程全景白板。
适合谁看
- 想理解 Claude Code 为什么能“像 Agent 一样工作”的开发者
- 想学习工具调用、权限控制、上下文压缩与记忆系统设计的人
- 想把 Claude Code 的工程思路迁移到自己项目中的 AI 工程师
如何阅读
- 从
end_to_end_workflow.md开始,先建立全局流程图。 - 再阅读
harness_engine_architecture.md与compact_architecture.md,抓住主干。 - 最后按模块深入
query、Tool、memory、permissions等专题文档。
如果你使用 Obsidian,可以直接打开本仓库并查看两个 `.canvas` 文件,它们适合做整体导览。
最近更新
v1.1.0:新增eval_harness_introduction.md与srcarchitecture.md,并同步更新 Harness 术语说明与工程白板。
仓库定位
- 这是一个非官方学习型仓库,不代表 Anthropic 官方立场。
- 内容以架构理解、工作流拆解和工程设计观察为主。
- 如果你发现表述不准确,欢迎提 Issue 或
Related Skills
Auto Update
Pull the latest ECC repo changes and reinstall the current managed targets.
Development Ecc Guide
Navigate ECC's current agents, skills, commands, hooks, install profiles, and docs from the live repository su
Development Epic Claim
Claim an epic issue, stamp coordination state, and sync local ownership.
Development Epic Publish
Publish a validated epic update back to the issue and local cache.
Development Epic Review
Mark epic review requested, approved, or changes requested.
Development Epic Unblock
Sweep blocked epic issues and reopen anything whose dependencies are closed.
Development Related Agents
Django Build Resolver
Django/Python build, migration, and dependency error resolution specialist. Fixes pip/Poetry errors, migration
Openai Codex CLI
(55.8k ⭐) - Lightweight coding agent that runs in your terminal.
src/agents/ — 11 Agent Definitions
**Generated:** 2026-04-11