AI agents are stateless, code-blind, and can't debug.
Every AI coding agent starts each session from scratch. It doesn't remember what it learned yesterday. It explores your codebase by grepping through files. When something breaks at runtime, it adds print statements and hopes for the best.
Cog is a single native binary that fills these gaps. It runs as an MCP server alongside your agent, giving it persistent memory, structured code intelligence, and a full interactive debugger.
No plugins. No SDKs. One install, one command, every agent.
Memory. Code. Debug.
Three systems that compound. Memory speeds up code exploration. Code intelligence informs debugging. Debugging produces knowledge worth remembering.
Knowledge that carries across sessions
A knowledge graph where concepts connect through typed relationships. Spreading activation recall finds not just exact matches but constellations of related knowledge. Short-term memories consolidate to long-term through reinforcement, and unused knowledge fades naturally.
cog_recall("auth token refresh")
→ Token Refresh Race Condition
→ Server Timestamp Authority
→ TokenBucket Rate Limiter
(3 concepts, 2 associations)
Structured understanding, not grep
SCIP-based indexing with 18 built-in languages. Find definitions, references, call graphs, and architecture overviews in a single query. Automatic incremental indexing keeps the index current as files change. Agents stop guessing where things are defined.
cog_code_explore("createElement")
→ Definition in ReactElement.js:148
Full body, references, callers
(1 call, 1.4K tokens, 3.7s)
Breakpoints, not console.log
36 debug tools spanning breakpoints, stepping, variable inspection, watchpoints, thread management, and even memory reads. Agents set breakpoints, inspect state, test hypotheses, and fix bugs without adding a single log line. Attach to running processes or launch from scratch.
cog_debug_launch("mix test")
cog_debug_breakpoint("lib/auth.ex:42")
cog_debug_run("continue")
cog_debug_inspect("token.expires_at")
→ ~U[2026-03-18 00:00:00Z]
Faster answers, fewer tokens.
Benchmarked against the React codebase, Cog's code intelligence finds definitions 9.2x faster using 98% fewer tokens compared to agents searching with grep and file reads.
Memory recall is 60% faster than ad-hoc code exploration and uses 98.8% fewer tokens while maintaining equivalent accuracy. Agents that remember don't need to re-explore.
Less time searching. Less money spent on tokens. Better answers.
| With Cog | Without Cog | Improvement | |
|---|---|---|---|
| Find definition | 3.7s / 1.4K tokens | 34.1s / 78.4K tokens | 9.2x faster |
| Find references | 9.3s / 2.5K tokens | 27.4s / 24.1K tokens | 2.9x faster |
| List symbols | 10.8s / 4.0K tokens | 35.7s / 25.2K tokens | 3.3x faster |
| Memory recall* | 24m / 548K tokens | 61m / 46.6M tokens | 98.8% fewer tokens |
*Benchmarked against hosted memory on trycog.ai, not local SQLite.
Works with every major agent.
Cog speaks MCP. Run cog init and pick your agent.
It configures MCP settings, installs hooks, deploys sub-agents, and
injects system prompts automatically.
Sub-agents give capable hosts like Claude Code and Gemini CLI specialized debugging, code exploration, and memory management workflows out of the box.
14 languages built in. Extensible.
Tree-sitter provides fast, per-file syntactic indexing out of the box. SCIP extensions add cross-file semantic resolution for languages that need it.
Built-in
Up and running in 60 seconds.
brew install trycog/tap/cog
curl -fsSL https://trycog.ai/cli/install | bash
1. Initialize in your project
$ cd my-app
$ cog init
? Memory backend: Local (SQLite, no account required)
? Agent: Claude Code
✓ MCP server configured in .mcp.json
✓ Hooks installed
✓ Sub-agents deployed
✓ System prompt injected
2. Configure code indexing
Tell Cog which files to index by setting glob patterns in
.cog/settings.json. This gives your agent
structured access to definitions, references, call graphs, and symbols.
{
"code": {
"index": [
"src/**/*.{js,jsx,ts,tsx}",
"lib/**/*.js",
"server/**/*.ts"
]
},
"memory": {
"brain": "local"
}
}
Then run the indexer:
$ cog code:index
Scanning... 1,247 files matched
Indexing... ████████████████████████████████ 100%
Indexed 1,247 files → 23,891 symbols (2.3s)
The index updates incrementally as files change. No need to re-run manually.
3. Verify everything works
$ cog doctor
✓ Config valid
✓ Memory: local (SQLite)
✓ Code index: 1,331 files, 25,293 symbols
✓ Extensions: none
✓ Debug daemon: running
✓ Agent: Claude Code (configured)
All checks passed.
What Cog looks like in a session.
A developer asks their agent to fix a bug. With Cog, the agent recalls prior knowledge, navigates code structurally, debugs interactively, and records what it learns for next time.
Everything an agent needs.
Memory, code intelligence, and debugging exposed as MCP tools that any compatible agent can call.
Memory
cog_learnStore conceptcog_recallSearch memorycog_associateLink conceptscog_reinforceMake permanentcog_traceFind pathscog_meldBridge brains
Code Intelligence
cog_code_exploreFind symbolscog_code_queryStructured queriescog_code_statusIndex health
Debug (Core)
cog_debug_launchStart programcog_debug_breakpointSet breakpointscog_debug_runStep & continuecog_debug_inspectEvaluate exprscog_debug_stacktraceCall stackcog_debug_stopClean exit
Debug (Extended)
cog_debug_attachRunning processcog_debug_watchpointData breakpointscog_debug_threadsThread controlcog_debug_memoryRead memorycog_debug_registersCPU statecog_debug_load_corePost-mortem
Direct control when you need it.
Cog isn't just an MCP server. It's a full CLI you can use directly to index code, manage memory, monitor debug sessions, and check system health.
| Command | Description |
|---|---|
cog init |
Interactive setup: memory backend, agent, permissions, hooks |
cog doctor |
Full health check: config, memory, index, extensions, agent, debug |
cog code:query |
Find definitions, references, calls, symbols from the terminal |
cog ext:install |
Add language extensions from git repos |
Local today. Hosted coming soon.
Right now, Cog runs entirely local with SQLite. No account, no network, no data leaving your machine. Memory, code intelligence, and debugging all work offline.
trycog.ai will add hosted memory with shared team brains, cross-device sync, enriched writes with provenance tracking, and organization-level knowledge management. It's not available yet.
Same CLI. Same tools. When hosted launches, switch backends with one config change.
Join the developer preview.
Give your agent a brain.
One binary. Every agent. Install in 60 seconds.