cc-sensei
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@cc-sensei How does Claude Code compact long conversations?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
π cc-sensei
Inject every ounce of Claude Code's architectural wisdom into your AI's brain
Sound familiar?
π© "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.
Related MCP server: sove-mcp
What it does 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:
You say one thing Oracle automatically does five things
βββββββββββββββββββββββββ ββββββββββββββββββββββββββββββββββββββββββ
"How do you compact long βββΊ β Match natural language to M06 (Context Engineering)
conversations?" β‘ Return the 4-tier compaction architecture & 9-section summary prompt
β’ List 5 directly-copyable engineering principles
β£ Cross-trace the 12 modules touched by prompt cache
β€ Pull up services/compact/microCompact.ts source on demandAfter 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.
π Quick Start (3 steps)
Option A β Try instantly via npx (zero install)
npx cc-senseiThis downloads and runs the server directly. Skip to Step 3 to connect your AI.
Option B β Clone for full control
Step 1 β Clone the project
git clone https://github.com/contradictory-body/cc-sensei.git && cd cc-senseiStep 2 β Install and build
Copy-paste again:
pnpm install && pnpm buildπ‘ 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.
Step 3 β Connect your AI
Add this snippet to your MCP client's configuration file (replace the path with the one you just cloned to):
{
"mcpServers": {
"cc-sensei": {
"command": "node",
"args": ["/your/absolute/path/cc-sensei/dist/server.js"]
}
}
}Don't know where the config file is? Common locations:
Client | Config file path |
Claude Desktop (macOS) |
|
Claude Desktop (Windows) |
|
Cursor | Settings β MCP β Add new server |
Qoder | Settings β MCP β Edit mcpServers |
Restart your client. Done! Your AI just gained 6 new skills.
π― Try it out
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.
Dive deeper
π οΈ What the 6 tools do
Tool | One-line capability | When to use |
| List all 32 modules and their concerns | "Which modules does Claude Code break down into?" |
| Natural-language search with 3 depth levels (brief/standard/deep) | "How do they prevent long-conversation context overflow?" |
| Drill into one module's specific section (responsibility / architecture / decisions / principles / relations) | "Show me M06's design principles" |
| Trace one concern across all 32 modules, ranked by hit count | "Which modules touch 'prompt cache'?" |
| Bulk-extract reusable patterns with built-in size limiting | "Give me every cache-related design I can copy" |
| Read Claude Code source directly (with line numbers, ranges, and directory listings) | "Show me |
Every tool comes with:
β Path-prefix tolerance β both
src/...and bare paths are accepted; no more copy-paste failuresβ Result rate-limiting β 800 chars per section and 12 sections by default, so your AI's context window stays alive
β Path-traversal protection β attacks like
../../../etc/passwdare rejected outrightβ Graceful degradation β bad arguments return friendly hints instead of crashes
π¬ Real scenario: "I want to add context compaction to my Agent"
You: "How do you compact conversation history to avoid hitting the token limit?"
Oracle (query_architecture, 103ms):
β Hit M06: Context Engineering
β Returns the 4-tier compaction architecture comparison table
(microCompact / sessionMemoryCompact / autoCompact / reactiveCompact)
β Trigger conditions, whether LLM is invoked, key file locations β all listed
You: "Show me M06's key design principles"
Oracle (get_module section=principles, 102ms):
β "Sticky-on Beta Headers β performance over simplicity"
"Single message-level cache_control marker (max 4)"
"9-section summary structure β eval-driven prompt"
β Each principle includes: where it lives, code snippet, why, how to reuse, the trade-off
You: "How many modules does 'prompt cache' span?"
Oracle (trace_concern, 118ms):
β 12 modules ranked by hit count
β Each with 5 lines of file:line excerpts
You: "Show me src/services/compact/microCompact.ts"
Oracle (get_source_code, 99ms):
β Source with line numbers + total line countA complete "understand β copy β ship" loop, averaging ~110ms.
π¦ Knowledge scale
π 32 module analyses (40K lines of distilled insight covering 310K lines of source)
βββ M01-M22 Core modules
β M01 Process bootstrap & lifecycle Β· M02 Agent main loop Β· M03 Tool system
β M04 Permissions & security Β· M05 Model API & streaming Β· M06 Context engineering
β M07 File/Shell/Git tools Β· M08 MCP protocol Β· M09 LSP integration
β M10 Bridge/IPC Β· M11 Ink rendering engine Β· M12 Message rendering
β M13 Input system Β· M14 Sub-agents & tasks Β· M15 Skills/plugins
β M16 Command system Β· M17 Configuration & settings Β· M18 Telemetry & analytics
β M19 State management Β· M20 Hotkeys & focus Β· M21 Buddy/voice Β· M22 Testability
βββ SUPP-* 10 deep-dive supplements
AgentSummary Β· SessionMemory Β· autoDream Β· ColorDiff
extractMemories Β· fileIndex Β· largeFiles Β· speculation
teamMemorySync Β· yogaLayout
ποΈ Indexes: 390 keywords / 104 concerns / full section-line mappings
π» Full source code: claude-code-main/src/ available for direct local readsποΈ Engineering philosophy
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 |
Path-traversal gatekeeping |
|
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 |
β‘ Performance
p50 = 105ms p95 = 118ms max = 125ms
Average response size: 7K chars
Fully local, 0 network dependencyβ Tests
pnpm exec tsx scripts/test-suite.ts # 30 baseline functional tests
pnpm exec tsx scripts/regression-3fixes.ts # 11 UX-fix regression tests
pnpm exec tsx scripts/e2e-comprehensive.ts # 24 real-scenario E2E testsTest 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 |
π Project structure
cc-sensei/
βββ src/
β βββ server.ts # MCP server entry
β βββ retrieval/engine.ts # Retrieval engine
β βββ source-reader.ts # Source reading + path safety
β βββ taxonomy.ts # 32-module mapping table
β βββ tools/ # 6 MCP tools
βββ scripts/
β βββ build-index.ts # Parses MODULE_NOTES into indexes
β βββ test-suite.ts
β βββ regression-3fixes.ts
β βββ e2e-comprehensive.ts
βββ knowledge/ # Build artifacts
β βββ module-registry.json
β βββ keyword-index.json
β βββ concern-map.json
βββ claude-code-main/ # Claude Code source + 32 module analyses
β βββ src/ # β Source
β βββ MODULE_NOTES/ # β Analyses
βββ dist/server.js # Bundle outputβοΈ Advanced configuration
Env var | Purpose | Default |
| Claude Code source root |
|
| Module-analysis directory |
|
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.
Roadmap
Incremental indexing (only re-parse changed MODULE_NOTES)
More section types (performance / security / observability)
HTTP / SSE transport (in addition to stdio)
Multi-codebase support (mount several projects at once)
License
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.
Available Tools
6 toolsget_moduleA
Get detailed content from a specific module. Can optionally return only a specific section type (responsibility, architecture, decisions, principles, or relations).
Inputs: module_id (required), section.
get_source_codeA
Read actual Claude Code source code files. Use this to see implementation details referenced in module analysis. Supports line-range extraction. Returns at most 500 lines per call.
Inputs: file_path (required), start_line, end_line.
list_modulesA
List all available architecture modules. Returns module IDs, titles, and key concerns for each module. Use this to discover what knowledge is available before querying specific modules.
Inputs: category.
query_architectureA
Search the Claude Code architecture knowledge base. Returns relevant module analysis at the requested depth level. Use this to understand how specific features, patterns, or subsystems are implemented.
Inputs: query (required), depth, modules.
search_patternsA
Search for reusable design patterns and principles extracted from Claude Code's architecture. Returns 'directly-reusable' patterns that you can adapt for your own Agent implementation. Output is paginated: each section is capped (default 800 chars) and total sections capped (default 12). Use module_id to focus, or get_module(section="principles") for the full text of a specific module.
Inputs: pattern_type, keywords, module_id, max_per_section, +1 more.
trace_concernA
Trace a specific architectural concern across all modules. Shows how one concept (e.g., 'prompt cache', 'error recovery', 'streaming') is handled at different layers of Claude Code's architecture.
Inputs: concern (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 6 tools
Each tool has a clearly distinct purpose: listing modules, getting module content, searching architecture knowledge, searching patterns, tracing concerns, and reading source code. No two tools overlap significantly, and descriptions clarify any potential ambiguity.
All tools follow a consistent verb_noun pattern (e.g., get_module, list_modules, trace_concern) with clear, descriptive verbs. No mixing of conventions.
Six tools is well-scoped for an architectural knowledge base, providing essential operations without being overwhelming. Each tool serves a necessary role.
The tool surface covers all major activities: discovering modules (list_modules), retrieving module details (get_module, get_source_code), searching across the knowledge base (query_architecture, trace_concern), and accessing design patterns (search_patterns). No obvious gaps for a read-only reference server.
Maintenance
Related MCP Connectors
Codebase knowledge graph β architectural awareness for AI coding agents via MCP
Codebase intelligence for agents: 152 structured artifacts across 21 programs, one call.
Claude Code / MCP skills for the dev pipeline: discover, spec, design, build, ship, operate.
Deterministic memory & code intelligence MCP for 15 IDEs (100% LongMemEval in 12.9ms, 0 LLM tokens).
Related MCP Servers
- AlicenseNot gradedqualityDmaintenancePersistent codebase knowledge layer for AI agents. Pre-digests codebases into structured knowledge (symbols, dependency graphs, co-change patterns, architectural decisions) and serves via MCP. 28 languages, 14 tools, ~85% token reduction.4 npm10MIT
- AlicenseAqualityDmaintenanceAn MCP server that gives Claude structural understanding of a codebaseβdependency graph, entry points, complexity ranking, and import cyclesβwithout reading every file into context.4MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to locally search, query, and understand codebases with token-efficient context, dependency graphs, history, architecture diagrams, and metrics through MCP.15 npm3MIT
- AlicenseNot gradedqualityNot gradedmaintenanceEnables Claude Code and AI coding agents to retrieve compact, task-shaped code evidence bundles via MCP, combining AST-aware retrieval, hybrid BM25+FAISS search, call-graph traversal, reranking, and token-budgeted context assembly.1MIT