Ship AI code you actually trust.
✓
Verify AI code before it merges
✓
Block guardrail violations automatically
✓
Catch doom loops before they waste hours
✓
Full context before every task
Compatible with
Cursor
Windsurf
Claude Code
Claude Desktop
VS Code
Codex
+ more
mcp.json{"mcpServers": {"agentbrain": {"command": "npx","args": ["-y", "@agentbrain/mcp-server"],"env": {"AGENTBRAIN_API_KEY": "your-api-key"}}}}Install in 30 seconds.
No API key needed to get started.
“Coding with AI is solved because all context is in the git repo.”
— David Fant
THE PROBLEM
It is. If your agent follows the rules.
No context
Every session starts from zero. Agent doesn't know your rules, your patterns, or what not to touch.
No rules
Your agent doesn't know what it's not allowed to do. It modifies protected files. It skips tests. It refactors code that must stay intact.
No verification
You review AI code manually. You don't know what it touched, what rules it broke, or whether it met the spec. You ship and hope.
Doom loops
The agent tries the same broken fix six times. You watch it spiral. You lose an hour you'll never get back.
HOW IT WORKS
Install once. Works every session.
STEP 1
Add to your editor
Drop the config into Cursor, Windsurf, Claude Code, or VS Code. Restart. AgentBrain tools appear instantly.
STEP 2
Say "load my codebase context"
AgentBrain scans your repo and generates context, schema, dependencies, and patterns. Cached after the first run. Auto-refreshes on every commit.
STEP 3
Before, during, and after
preflight_check loads full context before every task. Your agent starts aligned — right patterns, right constraints, right spec. After coding, postflight_check verifies the output. Guardrails, tests, spec compliance, scope. SAFE, REVIEW, or BLOCK. Your merge gate for AI code.
WHAT YOU GET
Everything your agent needs to stop guessing.
postflight_check()
pro
Runs after your agent codes. Checks guardrail violations, missing tests, spec compliance, and scope creep. Returns a verdict: SAFE, REVIEW, or BLOCK. Your merge gate for AI code.
See it in action →preflight_check()
pro
One tool that loads all context, Playbook, and active spec before any task. Your agent starts every task already aligned — no guessing, no wrong patterns, no broken architecture.
Playbook
pro
One document that defines how your team builds. Agent loads it before every task. postflight_check uses it to verify every task. Fill it out once. It works forever.
Set up your Playbook →Spec management
pro
Create structured specs from 5 questions. Your agent loads them via load_spec() and knows exactly what to build, what not to touch, and what done looks like.
Create your first spec →Codebase context
free
Scans your repo and generates architecture, schema, dependencies, and patterns. Your agent reads them at every session start.
Doom loop detection
free
Monitors git history for stuck patterns. Flags when your agent is modifying the same files repeatedly without progress.
Session handoffs
free
Generates a handoff doc from recent commits. Pick up exactly where you left off in the next session.
Git hook auto-refresh
free
Context updates silently after every commit. Your agent always works with the latest version of your codebase.
THE HONEST ANSWERS
Three questions developers ask.
Where does my code go?
Nowhere. Context files stay in .agentbrain/ on your machine. Specs and Playbook sync to our servers only if you add an API key. Set AGENTBRAIN_PRIVACY_MODE=true to disable all network calls entirely.
Does this slow down my editor?
No. Context loads from local cache. Typical response: under 200ms. First-run AST parsing happens in the background. Never blocks your IDE.
How do I remove it?
Delete the MCP line from your config. Delete .agentbrain/ if you want. Nothing else touches your codebase. No residue. Clean uninstall.
SETUP
Pick your editor. Copy the config.
No API key needed. Works in 30 seconds.
.cursor/config.json
{"mcpServers": {"agentbrain": {"command": "npx","args": ["-y", "@agentbrain/mcp-server"],"env": {"AGENTBRAIN_API_KEY": "your-api-key"}}}}Ready to try postflight_check?
Set up your Playbook at useagentbrain.com/playbook. Then run postflight_check after your next agent task. See your first SAFE, REVIEW, or BLOCK verdict in under 60 seconds.
Set up your Playbook →No API key? Core features work without it. Add a key to unlock postflight_check, Playbook, and unlimited specs.
"Without context, I'm a fast junior dev who lacks discipline. With it, I'm a senior contributor who respects the architecture."
Gemini 2.5 Pro · Evaluating AgentBrain
Stop hoping AI code is correct.
Start knowing.
Free to install. No API key. 30 seconds.