The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Cc Sensei listing page.
😩 "I've already dug deep into Claude Code's source, but when I ask my AI to help me build an Agent, it has no idea what I'm talking about — what I read, it didn't."
😫 "I'd love to build a knowledge base so my AI can learn from Claude Code, but the moment I open it — 300K+ lines, 1,250 files — both my AI and I are scared off."
😵 "I've barely looked at Claude Code's source, but I still want an Agent just as powerful — where do I even begin?"
If any of these hit home — this project is built for you.
Agent Architecture Oracle distills Claude Code's 310K lines of source and 1,250 files into 32 core modules with 40K lines of structured analysis, and serves it directly to your AI through the MCP protocol.
It covers every core capability of Claude Code:
🔁 Agent main loop · 🛠️ Tool system & execution pipeline · 🛡️ Permissions & security sandbox · 🌊 Model API & streaming 🧠 Context engineering & compaction · 📂 File / Shell / Git tools · 🔌 MCP protocol · 🎨 Ink rendering engine · 🧩 Skills/plugins 💾 Persistent memory · ⚡ Prompt cache break detection · 🤖 Sub-agents & task system … (22 core + 10 deep-dive supplements)
It establishes a complete index pipeline: natural language → module → design decision → reusable pattern → corresponding source code:
After plugging it into Claude Desktop / Cursor / Qoder / your own Agent, your AI gains a "Chief Architect of Claude Code" as its consultant — whether you're cloning the whole thing or just stealing one design, it tells you exactly where to look, why it works, and how to copy it.
In one night, your AI becomes a world-class Agent architect.
This downloads and runs the server directly. Skip to Step 3 to connect your AI.
Copy-paste again:
💡 Don't have pnpm? Run
npm install -g pnpmfirst. 💡 This step parses 32 module analyses, generates the knowledge index, and compiles the server. One-time only.
When done, you should see: ✅ module-registry.json (32 modules) and ✅ Build success.
Add this snippet to your MCP client's configuration file (replace the path with the one you just cloned to):
Don't know where the config file is? Common locations:
| Client | Config file path |
|---|---|
| Claude Desktop (macOS) | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Claude Desktop (Windows) | %APPDATA%\Claude\claude_desktop_config.json |
| Cursor | Settings → MCP → Add new server |
| Qoder | Settings → MCP → Edit mcpServers |
Restart your client. Done! Your AI just gained 6 new skills.
Just say to your AI:
"Use cc-sensei to tell me how Claude Code optimizes prompt cache."
It will call the tools on its own and return a complete analysis with source-code references. That's it.
| Tool | One-line capability | When to use |
|---|---|---|
list_modules | List all 32 modules and their concerns | "Which modules does Claude Code break down into?" |
query_architecture | Natural-language search with 3 depth levels (brief/standard/deep) | "How do they prevent long-conversation context overflow?" |
get_module | Drill into one module's specific section (responsibility / architecture / decisions / principles / relations) | "Show me M06's design principles" |
trace_concern | Trace one concern across all 32 modules, ranked by hit count | "Which modules touch 'prompt cache'?" |
search_patterns | Bulk-extract reusable patterns with built-in size limiting | "Give me every cache-related design I can copy" |
get_source_code | Read Claude Code source directly (with line numbers, ranges, and directory listings) | "Show me services/api/claude.ts:1412-1456" |
Every tool comes with:
src/... and bare paths are accepted; no more copy-paste failures../../../etc/passwd are rejected outrightA complete "understand → copy → ship" loop, averaging ~110ms.
This project is dogfooding itself — built using the methods Claude Code teaches, made to serve Claude.
| Claude Code's design philosophy | How this project applies it |
|---|---|
| Build-time indexing + zero runtime analysis | Section line ranges, keywords, and concerns are all computed in pnpm build:index; runtime just looks up JSON |
| Path-traversal gatekeeping | validatePath runs before every file read |
| Graceful degradation > unhandled crashes | Section not found? Return the "available types" hint |
| Structured prompt-as-spec | All 32 MODULE_NOTES strictly follow a 10-section template |
| Rate-limiting by default | search_patterns defaults to 800 chars per section, 12 sections cap, configurable |
| Test suite | Cases | Result |
|---|---|---|
| Baseline functionality (6 tools × multiple branches) | 30 | ✅ 30/30 |
| UX-fix regression | 11 | ✅ 11/11 |
| Real user-scenario E2E (3 personas) | 24 | ✅ 24/24 |
| Total | 65 | ✅ 65/65 |
| Env var | Purpose | Default |
|---|---|---|
CC_SOURCE_ROOT | Claude Code source root | <project>/claude-code-main/src |
MODULE_NOTES_ROOT | Module-analysis directory | <project>/claude-code-main/MODULE_NOTES |
Point these to anywhere else and Oracle becomes a knowledge server for any project — as long as that project has analyses written to the same MODULE_NOTES template.
MIT
Can't read 310K lines of source? Let 40K lines of distilled analysis read it for you, and let your AI copy from it.
If this project helped you, drop a ⭐ so more Agent developers can find it.