Cortex
Local code intelligence for AI agents. Index any repo into a call graph, query it over MCP. 100x fewer tokens. 29 languages, 32 tools, single Rust binary, zero dependencies, no cloud.
Install / Use
claude mcp add 1337Xcode -- npx -y github:1337Xcode/CortexIf the server publishes to npm under a different name, use that package instead โ check the repo README.
MCP Server
Model Context Protocol server
Quality Score
Category
AI & Machine LearningSupported Platforms
Our assessment of Cortex
Cortex scores 78/100 on our quality scale, 788th of 938 AI & Machine Learning skills we index.
Its MCP Server is 14 KB long, well organised into 13 sections with 7 code examples: a thorough specification that gives an agent plenty to work with.
It has 3 GitHub stars, so there is little community track record yet; judge it on its content.
Maintenance, license and trust
- The repository was last updated about 5 months ago. That is recent enough to be usable, but agent tooling moves fast, so check the instructions against your agent's current version.
- Our last check on 2026-10-19 found the source still online.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 90/100, with 1 caution from licensing, adoption, age or documentation. These come from repository metadata, not a code audit โ read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands (1 minor note below). An AI review of the same text found nothing harmful.
- noteInstalls by piping a downloaded script into a shellline 87
curl -fsSL https://raw.githubusercontent.com/1337Xcode/cortex/main/install.sh | sh
AI review by kimi-k2.7-code on 2026-09-24. Automated pattern scan on 2026-09-24. It catches known dangerous patterns, not every risk โ read a skill before letting an agent act on it.
Cortex compared with similar skills
All 4 of these similar skills score higher than Cortex; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| Cortex (this skill)by 1337Xcode | 78 | 3 | 5mo ago | MCP Server |
| claude-memby thedotmack | 100 | 103.0k | today | CLAUDE.md |
| Agent-Reachby Panniantong | 100 | 102.2k | today | CLAUDE.md |
| Understand-Anythingby Egonex-AI | 100 | 88.2k | 3d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 77.8k | today | CLAUDE.md |
Frequently asked questions
- How do I install Cortex?
- Run
claude mcp add 1337Xcode -- npx -y github:1337Xcode/Cortex. The install tabs above show the steps for each supported agent. - Which AI agents does Cortex work with?
- It is written for Claude Code, Claude Desktop, Cursor, GitHub Copilot and OpenAI Codex, as a MCP Server file. Other agents that read the same format can often use it too.
- Is Cortex safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands (1 minor note below). An AI review of the same text found nothing harmful. It is MIT-licensed and scores 90/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is Cortex still maintained?
- The repository was last updated about 5 months ago. That is recent enough to be usable, but agent tooling moves fast, so check the instructions against your agent's current version.
Skill content
View source on GitHubCortex
One binary. Zero dependencies. 29 languages. 32 MCP tools. Local code intelligence for AI coding agents.
Documentation ยท npm ยท Issues
Works with
<p> <img src="assets/icons/claude.svg" width="32" height="32" alt="Claude Code" title="Claude Code" /> <img src="assets/icons/cursor-dark.svg" width="32" height="32" alt="Cursor" title="Cursor" /> <img src="assets/icons/copilot-dark.svg" width="32" height="32" alt="GitHub Copilot" title="GitHub Copilot" /> <img src="assets/icons/windsurf-dark.svg" width="32" height="32" alt="Windsurf" title="Windsurf" /> <img src="assets/icons/vscode.svg" width="32" height="32" alt="VS Code" title="VS Code" /> <img src="assets/icons/codex-dark.svg" width="32" height="32" alt="OpenAI Codex" title="OpenAI Codex" /> <img src="assets/icons/cline-dark.svg" width="32" height="32" alt="Cline" title="Cline" /> <img src="assets/icons/kiro.svg" width="32" height="32" alt="Kiro" title="Kiro" /> <img src="assets/icons/jetbrains.svg" width="32" height="32" alt="JetBrains" title="JetBrains" /> <img src="assets/icons/neovim.svg" width="32" height="32" alt="Neovim" title="Neovim" /> </p>Any MCP-compatible AI agent, IDE, or CLI tool connects out of the box. cortex install auto-detects your setup and writes the config.
| Platform | Install command |
|---|---|
| Claude Code (Linux/Mac) | cortex install |
| Claude Code (Windows) | cortex install --platform claude-code |
| Codex | cortex install --platform codex |
| OpenCode | cortex install --platform opencode |
| GitHub Copilot CLI | cortex install --platform copilot |
| VS Code Copilot Chat | cortex vscode install |
| Aider | cortex install --platform aider |
| OpenClaw | cortex install --platform openclaw |
| Factory Droid | cortex install --platform droid |
| Trae | cortex install --platform trae |
| Trae CN | cortex install --platform trae-cn |
| Gemini CLI | cortex install --platform gemini |
| Hermes | cortex install --platform hermes |
| Kimi Code | cortex install --platform kimi |
| Kiro IDE/CLI | cortex kiro install |
| Pi coding agent | cortex install --platform pi |
| Cursor | cortex cursor install |
| Google Antigravity | cortex antigravity install |
| Windsurf | cortex install --platform windsurf |
| Zed | cortex install --platform zed |
| JetBrains | cortex install --platform jetbrains |
| Cline/Roo | cortex install --platform cline |
| Continue.dev | cortex install --platform continue |
| Supermaven | cortex install --platform supermaven |
| Tabnine | cortex install --platform tabnine |
Why Cortex
An agent asking "what calls processOrder" gets a 200-token graph result instead of burning 20,000 tokens reading files. That's 100x fewer tokens on a single structural question.
Cortex indexes your repository into a SQLite call graph and exposes it over the Model Context Protocol. 127 files indexed in 535ms. Incremental re-index in 13ms. Handles 100K to 1M+ line repositories.
v1.1 adds multi-source confidence-aware intelligence. Cortex now ingests SCIP indexes for precise symbol resolution, runs framework-specific adapters (FastAPI, Express, NestJS, Spring, Django, React) to detect dependency injection and routing wiring, tags every edge with a confidence tier, and falls back honestly when it can't give a confident answer. The ask and get_task_context tools are completely overhauled with evidence-fusion ranking and structured fallback suggestions.
Install
npx @1337xcode/cortex@latest install
<details>
<summary>Other methods</summary>
Shell script
curl -fsSL https://raw.githubusercontent.com/1337Xcode/cortex/main/install.sh | sh
Build from source
git clone https://github.com/1337Xcode/cortex.git && cd cortex
cargo build --release
cp target/release/cortex ~/.local/bin/
</details>
Quick start
cortex index # parse your repo, build the graph
cortex install # detect Claude Code / Cursor, write MCP config
cortex serve # start the MCP server
Your agent queries the graph instead of reading raw files.
Demo commands
cortex impact UserService.getUser # blast radius: what breaks if I change this?
cortex explain DatabasePool.acquire # offline function explanation, zero LLM calls
cortex security report # taint flows, OWASP patterns, dependency vulns
cortex diff main feature-branch # call graph diff between branches
cortex viz --export graph.html # interactive 3D graph in a standalone HTML file
cortex ci --fail-on-taint # CI quality gate with exit codes
cortex hotspots --months 6 # high-churn risky code ranked by risk score
cortex coverage --lcov coverage.lcov # populate coverage field, rank untested functions
cortex modules # Leiden community detection module boundaries
cortex federate add ../auth-service # query across repos with unified graph
cortex benchmark # run correctness suite, report pass rate + token savings
cortex status --savings # token savings dashboard with honest net-negative reporting
cortex index --repair # rebuild index from scratch, preserve observations
cortex semantic enable # build embedding index for semantic search
What you get
- 29 languages parsed via tree-sitter
- 32 MCP tools exposed over stdio, or 5 in smart mode (the
askmeta-tool routes internally) - SCIP index ingestion for precise symbol resolution โ SCIP edges win over tree-sitter on conflicts
- 6 framework adapters (FastAPI, Express, NestJS, Spring, Django, React) detect DI wiring, middleware chains, and routing that tree-sitter cannot see
- Confidence-tagged edges โ every edge carries
edge_sourceandconfidence(1.0 SCIP / 0.8 framework / 0.5 AST / 0.3 name-match); queries default to confidence โฅ 0.7 - Evidence-fusion
get_task_contextโ multi-signal ranking (BM25 + SCIP distance + git recency + edge confidence + file size penalty) with per-file reasons and guaranteed non-empty results - Honest fallback โ
askreturns structured grep suggestions when confidence is below MEDIUM; never returns confidently wrong data from an unhealthy index - Index health gate โ all tools return a structured error with fallback suggestions when the index is empty or corrupt
- Token savings dashboard โ
cortex status --savingsshows cumulative net saved, average per query, and net-negative queries (reported honestly) get_repo_briefโ zero-parameter cold-start summary under 400 tokens: languages, frameworks, entry points, hotspots, security patterns, test shape- Tool surface management โ 10 default tools, 7 experimental (opt-in), 5 smart-tools mode;
semantic_searchonly listed when embeddings are built - Incremental embeddings โ only re-embeds functions whose content hash changed;
cortex semantic enablebuilds the initial index - Correctness benchmarks โ
cortex benchmarkvalidates tool accuracy against ground-truth; CI gate fails the build if pass rate drops below 70% - Sub-second incremental re-indexing via native OS file watcher (inotify, FSEvents, ReadDirectoryChangesW)
- Configurable model pricing via
~/.cortex/pricing.tomlwith longest-prefix matching - Taint flow analysis, OWASP Top 10 detection, SBOM generation all running locally, no cloud
- Cross-session memory that marks observations stale when linked code changes
- Multi-repo federation for querying across repositories with a unified graph
- CI quality gates with configurable thresholds and exit codes
- 3D interactive graph visualization exportable to standalone HTML
- Portable JSON bundle (cortex.json) for team sharing via git
- Works offline. No cloud, no API keys, no Docker, no language runtimes.
| Language | Language | Language | |----------|----------|----------| | Python | TypeScript | JavaScript | | Rust | Go | Java | | C | C++ | C# | | Ruby | PHP | Swift | | Kotlin | Scala | Lua | | Zig | Haskell | Elixir | | Dart | R | Julia | | OCaml | Bash | HCL/Terraform | | Perl | Objective-C | SQL | | YAML | TOML | |
</details>Architecture
graph TD
A[Repository Files] --> B[File Watcher<br/>notify crate]
B --> C[Indexer Pipeline<br/>Rayon + tree-sitter]
C --> D[SQLite Graph Store<br/>WAL + FTS5 + sqlite-vec]
D --> E[MCP Server<br/>Tokio + JSON-RPC 2.0]
E --> F[AI Coding Agent]
C --> G1[SCIP Ingester<br/>Protobuf โ HIGH edges]
G1 --> D
C --> G2[Framework Adapters<br/>FastAPI ยท Express ยท NestJS<br/>Spring ยท Django ยท React]
G2 --> D
C --> G3[Security Pass<br/>Taint + OWASP + SBOM]
G3 --> D
D --> H[Bundle Exporter<br/>cortex.json]
H --> I[Git Repository<br/>Team Sharing]
D --> J[Memory Layer<br/>Staleness-aware observations]
D --> K[Evidence Fusion<br/>BM25 + SCIP + git + embeddings]
K --> E
Confidence tiers
Every edge in the graph carries a source and confidence value. Queries default to confidence โฅ 0.7 (MEDIUM), filtering out heuristic name-match edges.
| Source | Confidence | How produced |
|--------|-----------|--------------|
| scip | 1.0 HIGH | SCIP index (precise symbol resolution) |
| framework_adapter | 0.8 MEDIUM | FastAPI/Express/NestJS/Spring/Django/React pattern matching |
| ast_direct | 0.5 LOW | tree-sitter AST extraction |
| name_match | 0.3 VERY_LOW | heuristic name-based resolution |
Benchmark results
Cortex ships with a self-referential benchmark suite (benchmark/cortex_self_benchmark.json, 24 cases) covering trace_callers, blast_radius, get_task_context, and ask. Run it against your index:
cortex benchmark
The CI pipeline runs this on every release and fails the build if pass rate drops below 70%.
Comparison
| Feature | Cortex | codebase-memory-mcp | Srclight | Serena | mcp-codebase-index | |---------|--------|---------------------|----------|--------|-------------------| | Architecture | Rust binary, SQLite | C binary, SQLite | Python, SQLite | Python, LSP | Python, SQLite | | Languages | 29 (tree-sitter) | 66 (tree-sitter) | 10 (tree-sitter) | 40+ (LSP) | 4 | | MCP tools | 32 (or 5 smart mode) | 14 | 42 | ~20 | 17 | | Smart tool routing | Yes (ask meta-tool) | No | No | No | No | | SCIP precise resolution | Yes | No | No | Yes (LSP) | No | | Framework adapters | 6 (DI, routing, middleware) | No
Truncated for display โ read the full file on GitHub.
Related Skills
claude-mem
103.0kPersistent Context Across Sessions for Every Agent โ Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More
Agent-Reach
102.2kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu โ one CLI, zero API fees.
Understand-Anything
88.2kGraphs that teach > graphs that impress. Turn any code into an interactive knowledge graph you can explore, search, and ask questions about. Works with Claude Code, Codex, Cursor, Copilot, Gemini CLI, and more.
headroom
77.8kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit โ see the Safety scan above for what the skill file itself contains.
