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.
Local stats and memory for AI coding assistants
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
$ agent-brain stats # sessions, time and tokens per project $ agent-brain stats --sessions # per-session breakdown $ agent-brain status # integration health and collection activity
What it does
agent-brain is a local collector and memory store for your AI coding assistants. It works offline and keeps its database on your machine.
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.
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.
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
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.
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
No Go toolchain is needed. The installer downloads a prebuilt binary, checks its SHA-256 checksum, and then offers to set up your assistants.
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.
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.
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
The local tool is free and needs no account. Memory needs Pro, and the cloud dashboard is optional.
agent-brain stats and agent-brain statusmemory_search, memory_save) and session-start memory injectionagent-brain login) or through membership of a paying team's projectagent-brain login, then agent-brain link <project-key>, then consentFAQ
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.
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.
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.
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.
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.
The repository is under the MIT License. See the LICENSE file.
More questions are answered in the docs.