Local stats and memory for AI coding assistants

See what your AI assistants really cost, and let them remember

agent-brain runs on your machine. It records sessions, tokens and cost across your coding assistants, and gives them project memory they can search and save. Nothing leaves your machine unless you link a project and consent.

v0.4.0 Updating

macOS and Linux

curl -fsSL https://agentbrain.wecansync.com/install.sh | sh

Windows PowerShell

irm https://agentbrain.wecansync.com/install.ps1 | iex
  • No Go needed. Runs on Linux, macOS and Windows, on amd64 or arm64.
  • Stats are free, local, offline, and need no account.

What it does

Usage you can see, and memory your assistants keep

agent-brain is a local collector and memory store for your AI coding assistants. It works offline and keeps its database on your machine.

Stats

Run agent-brain stats to see token usage and cost by day, project and model. Add --sessions for a per-session breakdown. Free, local and offline.

Memory (Pro)

Assistants get memory_search and memory_save tools over MCP, plus project memory injected at session start. Entries are typed as decisions, conventions, task state or facts.

Privacy

Everything is stored in a local SQLite database you own. Nothing leaves your machine unless you link a project and grant consent. The wire format has no fields for local paths, git remotes, project names, hostnames or message text, and a guard test enforces this.

Supported assistants

One install covers them all

agent-brain install detects the assistants on your machine and integrates each one. Existing settings are kept, and a timestamped backup is written first. To integrate only some, pass --assistant once per assistant.

  • Claude Code
  • Cursor
  • GitHub Copilot CLI
  • Gemini CLI
  • OpenCode
  • Codex CLI
Codex CLI

Codex needs its hooks trusted once. Open codex, run /hooks, and trust the agent-brain entries. Until you do, Codex records nothing and reports no error. agent-brain status shows the same reminder.

Quick start

Three steps

No Go toolchain is needed. The installer downloads a prebuilt binary, checks its SHA-256 checksum, and then offers to set up your assistants.

Install

Run the one-liner for your platform from the top of this page. Pin a version with AGENT_BRAIN_VERSION, or skip assistant setup with AGENT_BRAIN_NO_INTEGRATE=1.

Verify

Run agent-brain status. You get one line per assistant showing whether it is detected and integrated, plus the database location and the last captured event.

See your stats

Use any assistant as usual, then run agent-brain stats. Every session is captured automatically and attributed to its project, with no extra setup.

Free vs Pro

What is free, and what needs an account

The local tool is free and needs no account. Memory needs Pro, and the cloud dashboard is optional.

Free

Local collection and stats

  • Session capture for every supported assistant
  • agent-brain stats and agent-brain status
  • Local, offline, no account
Pro

Memory, and the optional cloud dashboard

  • Memory tools (memory_search, memory_save) and session-start memory injection
  • Available with a Pro account (agent-brain login) or through membership of a paying team's project
  • The cloud dashboard is optional: agent-brain login, then agent-brain link <project-key>, then consent

FAQ

Questions

Does agent-brain read my code or my prompts?

No, and the protection is built into the code, not left to policy. What can sync, and only after you opt in, is numbers: timestamps, durations, token counts, model IDs and activity counts. The wire format has no fields for prompts, code, file contents, paths or repository names.

Do I need an account?

No. Collection, agent-brain stats and agent-brain status are local and need no account. Memory needs a Pro account or team membership, and the cloud dashboard is optional.

Does it slow my assistant down?

The capture path writes to a local SQLite database and has no network capability, so recording never waits on a server. Cloud sync runs in a separate background service.

How is memory captured?

agent-brain asks the assistant to save memory after 10 tool calls of work since the last save, with a mid-task checkpoint every 25 tool calls, and before the context is compacted. Run agent-brain memory capture to see the settings.

Can I stop it, or remove it?

Yes. agent-brain uninstall removes the assistant integrations and keeps your local data unless you pass --purge-data. Then delete the binary. See the uninstall steps.

Which license does it use?

The repository is under the MIT License. See the LICENSE file.

More questions are answered in the docs.