Developer Preview

One binary.
Three superpowers.*

*so far

Persistent memory, code intelligence, and interactive debugging for every AI coding agent. Actively evolving — your feedback shapes what ships next.

The problem

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.

Capabilities

Memory. Code. Debug.

Three systems that compound. Memory speeds up code exploration. Code intelligence informs debugging. Debugging produces knowledge worth remembering.

Persistent Memory

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)
Code Intelligence

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)
Interactive Debugging

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]
Performance

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.

Compatibility

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.

Amp Amp
Claude Code Claude Code
Cursor Cursor
Gemini CLI Gemini CLI
Goose Goose
OpenAI Codex OpenAI Codex
OpenCode OpenCode
Pi Pi
Roo Code Roo Code
VS Code / Copilot VS Code / Copilot
Windsurf Windsurf
Languages

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.

indexable
DWARF debugger
DAP debugger

Built-in

C C
C++ C++
Go Go
Java Java
JavaScript JavaScript
JSON JSON
Markdown Markdown
MDX MDX
Python Python
Rust Rust
TOML TOML
TSX TSX
TypeScript TypeScript
YAML YAML

Extensions

Extensions are git repos with a build manifest. Install with cog ext:install <url> for full code intelligence and debugger support.

Install

Up and running in 60 seconds.

macOS
brew install trycog/tap/cog
Linux
curl -fsSL https://trycog.ai/cli/install | bash

1. Initialize in your project

terminal
$ 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.

my-app/.cog/settings.json
{
  "code": {
    "index": [
      "src/**/*.{js,jsx,ts,tsx}",
      "lib/**/*.js",
      "server/**/*.ts"
    ]
  },
  "memory": {
    "brain": "local"
  }
}

Then run the indexer:

terminal
$ 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

terminal
$ 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.
In practice

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.

claude - your-project
> Fix the timeout error in the payment webhook handler
1. Recall prior knowledge
cog_recall("payment webhook timeout handler")
Found: Webhook Retry Logic: idempotency key required, 30s timeout on Stripe side
2. Navigate code structurally
cog_code_explore("handleWebhook|processPayment")
handleWebhook in src/payments/webhook.ts:34 (full definition, 12 references)
cog_code_query(mode: "calls", name: "handleWebhook")
calls: validateSignature, processPayment, updateOrder, sendReceipt
3. Debug interactively
cog_debug_launch("npm test -- webhook.test.ts")
cog_debug_breakpoint("src/payments/webhook.ts:67")
cog_debug_run("continue")
cog_debug_inspect("response.status")
504 — upstream timeout before processPayment completes
4. Fix and record
Implements async processing with immediate 200 ACK. Tests pass.
cog_learn({ term: "Webhook Async Processing", definition: "ACK webhook immediately, process async. Stripe enforces 30s timeout." })
Result: Bug found with debugger in one session. Fix informed by recalled knowledge. Lesson recorded for next time.
70+ tools

Everything an agent needs.

Memory, code intelligence, and debugging exposed as MCP tools that any compatible agent can call.

Memory

  • cog_learn Store concept
  • cog_recall Search memory
  • cog_associate Link concepts
  • cog_reinforce Make permanent
  • cog_trace Find paths
  • cog_meld Bridge brains

Code Intelligence

  • cog_code_explore Find symbols
  • cog_code_query Structured queries
  • cog_code_status Index health

Debug (Core)

  • cog_debug_launch Start program
  • cog_debug_breakpoint Set breakpoints
  • cog_debug_run Step & continue
  • cog_debug_inspect Evaluate exprs
  • cog_debug_stacktrace Call stack
  • cog_debug_stop Clean exit

Debug (Extended)

  • cog_debug_attach Running process
  • cog_debug_watchpoint Data breakpoints
  • cog_debug_threads Thread control
  • cog_debug_memory Read memory
  • cog_debug_registers CPU state
  • cog_debug_load_core Post-mortem
CLI commands

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
Memory backends

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.

Community

Join the developer preview.

Cog CLI is in active development. Features are shipping weekly, APIs may shift, and your feedback directly shapes what gets built next.

Join the Discord to report bugs, request features, share workflows, and connect with other developers building with Cog.

Developer preview

Give your agent a brain.

One binary. Every agent. Install in 60 seconds.