✓ Copied to clipboard

AgentBrain

How it worksFeaturesMCPgithub ↗

v1.4.9 — live on npm

Your coding agent.Finally knows your code.

One command crawls your entire codebase and gives Claude Code, Cursor, or Windsurf the context it needs to write code that actually fits your project.

$npx agentbrain setup

free to use · byok · works with any repo

scroll

// demo

One command. Full codebase awareness.

Run it once. Your agent never starts a session blind again.

agentbrain — your-project

$ npx agentbrain setup🧠 AgentBrain repository: /users/ben/your-project ✓ anthropic key detected · haiku for scan, sonnet for synthesis  ✔ found 1,223 files, selected 183 relevant files → summarising 183 files in parallel... → synthesising context documents...  ✓ agentbrain/context.md — navigation guide with exact file paths ✓ agentbrain/dependency-map.md — service relationships ✓ agentbrain/patterns.md — your coding conventions  ✓ claude.md · .cursorrules · .windsurfrules — all updated ✓ git hook installed — context refreshes after commits  💸 actual cost: ~$0.18 · done in 94 seconds.

// without agentbrain

Your agent starts every session blind

Wastes the first 10 minutes getting oriented

Writes code that doesn't match your patterns

Asks what files to look at for every task

Hallucinates function names and import paths

You re-explain the architecture every session

// with agentbrain

Your agent navigates like a senior engineer

Knows every module, service, and file by name

Follows your exact coding patterns automatically

Jumps straight to the right files for any task

Context stays fresh — auto-updates on every commit

Works across Claude Code, Cursor, and Windsurf

// how_it_works()

Three steps. Then forget about it.

AgentBrain runs once and works invisibly in the background forever.

01

Install + run setup

One command installs AgentBrain and scans your entire repo. Paste your API key when prompted. Done.

$ npx agentbrain setup

02

Context is generated

AgentBrain crawls your codebase, summarises every relevant file, and synthesises a navigation guide your agent reads.

$ agentbrain/context.md

03

Just code normally

Your agent loads context at every session start. After each commit, context refreshes silently in the background.

$ git commit → auto-refresh

// features

Everything your agent needs.

Built for developers who ship with AI agents every day.

smart_context_generation()

Crawls your repo, scores file relevance, and produces a navigation guide with exact file paths and export names — not generic descriptions.

auto_inject_into_agents()

Automatically writes context loading instructions into CLAUDE.md, .cursorrules, and .windsurfrules. Zero manual steps required.

watch_commits_refresh()

A smart git hook detects source file changes and regenerates context silently after every commit. Doc-only changes are skipped.

cache_by_git_hash()

Context is cached against your HEAD commit hash. Repeat runs with no code changes cost exactly $0.00 and complete instantly.

bring_your_own_key()

Uses your Anthropic or OpenAI API key directly. Auto-detects provider from key prefix. No markup. No middleman.

generate_handoff_doc()

Run agentbrain handoff at end of session. Reads your git diff and writes a handoff.md your agent reads at next session start.

// compatibility

Works with every major agent.

Generates the right config file for each agent automatically.

Claude Code

CLAUDE.md

Cursor

.cursor/rules

Windsurf

.windsurfrules

$0.18

typical cost production repo

$0.00

repeat runs no file changes

183

files analysed 1,200 file repo

<2m

time to full codebase intel

// mcp_server

No API key? No problem.

Connect AgentBrain as an MCP server and let your existing subscription do the compute. You pay nothing extra.

claude_desktop_config.json

{
  "mcpServers": {
    "agentbrain": {
      "command": "npx",
      "args": ["-y", "@agentbrain/mcp-server"]
    }
  }
}

Claude Desktop

~/Library/Application Support/ Claude/claude_desktop_config.json

Cursor

Cmd+Shift+P MCP: Configure Servers

Windsurf

Settings → MCP Servers Add Configuration

// tools available to your agent

fn

load_context

Load full codebase context at session start

fn

load_standards

Load coding standards mid-session

fn

save_handoff

Save session handoff at end of session

fn

scan_repo

Inspect repo structure — no API key needed

// pricing

Free during beta.

AgentBrain is completely free right now. You pay only for your own API tokens. Team features coming soon.

$npm install -g @agentbrain/cli
→ join the team features waitlist

Start in 30 seconds.

Install AgentBrain, run setup, and your agent will never start a session blind again.

$npm install -g @agentbrain/cli
$agentbrain setup
★ github↗ npm[email protected]