all work

neurobuttr-mcp: git-style branching for coding-agent sessions

An open-source MCP server on npm that gives Claude Code conversation branches, a persistent insight store, a captured session timeline with diffs and rollback, and a live map of the session.

role
Author, open source
when
2025
stack
TypeScript, MCP, Node, WebSockets, NLP
code
github
live
www.npmjs.com/package/neurobuttr-mcp

The problem

Long agentic coding sessions lose their thread. You go off to check a tangent and the main line gets buried under it. A finding from an hour ago is somewhere in the scrollback. And when the agent has changed thirty files, there is no record of which action changed what, or an easy way back to the state before one of them.

Git solves all of this for code. Nothing solved it for the conversation.

What I decided, and why

  • Branches for conversations, with git's vocabulary. nb_branch opens a tangent, nb_checkout moves between branches and main, nb_resolve closes one and optionally merges what it learned. Each branch sees only the messages up to its branch point, so the context stays scoped.
  • Insights outlive branches. remember_insight files a finding; get_insights brings every one back regardless of which branch it came from. What a session learned should not disappear with the tangent that found it.
  • A timeline of what the agent did to the files. Claude Code's own logs are parsed into session records. You can list sessions, show one in full, see each file change as a unified diff, annotate a session, replay it up to a given action, or roll its changes back.
  • Fully offline. Everything is plain JSON under ~/.neurobuttr/, scoped per project by a hash of the working directory. No account, no server to run.
  • One command to install. npx neurobuttr-mcp init registers the server in Claude Code's config and creates the storage folders. Removing it is deleting one key.

How it was built

An MCP server over stdio in TypeScript, exposing 18 tools in four groups: branching, session overview, messages and insights, and the timeline. Topic classification for filing insights uses keyword extraction with curated dictionaries and stemming, so there is no model call and no network.

A small HTTP and WebSocket bridge powers two UIs: a timeline review page (a commit-history view of what each session did) and a live "metro map" of the conversation that redraws as branches open and close. The same map can be written out as Mermaid for a quick look in an editor. The package also ships one agent, two slash commands and five skills for Claude Code.

What it changed

Published on npm under MIT and installed with one command. The pattern it adds is the useful part: a tangent costs nothing to open, so it gets opened, and what it finds survives the return to the main line.