Skip to main content
Glama

Branchpoint

English | Español

CI License Node

Branchpoint gives your Git workflow persistent memory, per branch. AI coding agents use it as an MCP server so they stop mixing up context between branches; you use it as a CLI to see at a glance what was going on in each branch. One binary, two faces: the same .git/branchpoint/ store feeds both.

# For your agent (Claude Code):
claude mcp add branchpoint -- npx -y branchpoint

# For you:
npx branchpoint status

The problem

When an AI coding agent (Claude Code, Cursor, Cline...) works in a repository with several active branches, it has no memory of what was decided or done on each one. That causes two familiar symptoms:

  • Cross-branch hallucination: the agent mixes code context or decisions from one branch into the current work on another.

  • Wasted tokens: the agent has to re-explore and re-explain the state of the project every session, because nothing persisted was tied to the branch.

And you hit the same problem yourself coming back to a branch a week later: what was this even about?

Related MCP server: MemoV

How it works

Branchpoint detects the active Git branch and persists context summaries per branch under .git/branchpoint/<branch>.md. When context is read, it's automatically enriched with information pulled from Git itself (recent commits, divergence from the default branch), so switching branches automatically switches the relevant context.

The same executable picks its mode based on how it's launched:

  • No arguments, piped stdio (how an MCP client launches it) → MCP server over stdio.

  • Arguments present → CLI with subcommands (status, list, context).

  • No arguments, in a terminal → interactive mode with a menu.

See ARCHITECTURE.md for the full design: data flow, file-by-file responsibilities, the stack and why each piece was chosen, and the testing philosophy.

For AI agents (MCP server)

Claude Code

claude mcp add branchpoint -- npx -y branchpoint

Claude Desktop

Add to claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json, Windows: %APPDATA%\Claude\claude_desktop_config.json):

{
  "mcpServers": {
    "branchpoint": {
      "command": "npx",
      "args": ["-y", "branchpoint"]
    }
  }
}

Cursor

Add to .cursor/mcp.json (project-level) or ~/.cursor/mcp.json (global — Cursor uses the same format as Claude Desktop):

{
  "mcpServers": {
    "branchpoint": {
      "command": "npx",
      "args": ["-y", "branchpoint"]
    }
  }
}

Cline

Add to Cline's MCP settings file (VS Code global storage — .../globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json, reachable from Cline's "Configure MCP Servers" menu):

{
  "mcpServers": {
    "branchpoint": {
      "command": "npx",
      "args": ["-y", "branchpoint"],
      "disabled": false,
      "autoApprove": []
    }
  }
}

VS Code (agent mode)

Add to .vscode/mcp.json in your workspace. Note the top-level key is servers, not mcpServers like the tools above:

{
  "servers": {
    "branchpoint": {
      "command": "npx",
      "args": ["-y", "branchpoint"]
    }
  }
}

MCP tools are only available in agent mode — they're invisible in Ask or Edit mode.

Any other MCP client not listed here should work the same way: it's a standard stdio server launched with npx -y branchpoint (or node /absolute/path/to/branchpoint/dist/index.js if you built from source). If a client needs a different setup, please open an issue.

Tools exposed

get_branch_context

No parameters. Returns the manually saved summary for the active branch (or a clear notice if there isn't one) combined with context enriched from Git: divergence from the default branch (commits since the merge-base plus diff --stat, omitted if no default branch is detected or you're already on it) and the 10 most recent commits.

Real output on a branch with a saved summary and 2 commits of divergence:

## Saved summary

Implementing the OAuth login flow. Still need to handle the refresh token.

## Divergence from "main"

2 commit(s) since the divergence point.

 src/auth.ts | 45 +++++++++++++++++++++++++++++++++++++++++++++
 src/login.ts | 12 ++++++------
 2 files changed, 51 insertions(+), 6 deletions(-)

## Recent commits

- a1b2c3d feat: add refresh token handling
- e4f5g6h feat: initial OAuth login flow
...

Degraded repository states are reported as normal tool content, never as protocol errors — a detached HEAD returns an explanatory message instead of crashing, and a repository with no commits yet says so plainly.

save_branch_context

Parameter summary: string. Saves a manual context summary for the active branch, persisted at .git/branchpoint/<branch>.md and combined with the Git-derived enrichment on the next read. An empty or whitespace-only summary is rejected with a clear message rather than saved as an empty file; summaries are capped at 50,000 characters (about 12,000 tokens — comfortably more than a real summary needs) to guard against accidental dumps.

ping exists as an internal diagnostic tool to verify the MCP server is responding correctly; it isn't a product feature.

For humans (CLI)

The same data your agent sees, in your terminal. Every subcommand accepts --json for raw, color-free output (scripts, CI).

branchpoint status

Active branch, whether it has saved context, and divergence from the default branch:

╭───────────────────────── branchpoint ──────────────────────────╮
│  Active branch:  feature/oauth-login                           │
│  Context:        saved (updated 2026-07-11 18:30)              │
│  Divergence:     2 commit(s) since the common point with main  │
╰────────────────────────────────────────────────────────────────╯

With --json:

{
  "branch": "feature/oauth-login",
  "hasContext": true,
  "updatedAt": "2026-07-11T16:30:00.000Z",
  "defaultBranch": "main",
  "hasCommits": true,
  "divergence": {
    "baseBranch": "main",
    "commitCount": 2
  }
}

branchpoint list

Every branch with saved context, most recently updated first:

┌─────────────────────┬──────────────────┬──────────────────────────────────────────────────────────────┐
│ Branch              │ Updated          │ Summary                                                      │
├─────────────────────┼──────────────────┼──────────────────────────────────────────────────────────────┤
│ feature/oauth-login │ 2026-07-11 18:30 │ Implementing the OAuth login flow. Decided to use PKCE…      │
├─────────────────────┼──────────────────┼──────────────────────────────────────────────────────────────┤
│ main                │ 2026-07-10 09:14 │ Stable branch. Latest release: v1.2.0. Don't touch until QA… │
└─────────────────────┴──────────────────┴──────────────────────────────────────────────────────────────┘

branchpoint context [branch]

The full saved context for a branch (defaults to the active one):

feature/oauth-login — updated 2026-07-11 18:30

Implementing the OAuth login flow. Decided to use PKCE instead of a client secret. Still need to handle refresh token expiration.

Interactive mode

branchpoint with no arguments in a terminal opens a menu to view the active branch's context, list every saved branch, or save a new summary, without memorizing subcommands. Ctrl+C exits cleanly at any point.

Troubleshooting

Registering the server on Windows with a raw absolute path fails or behaves oddly. If you're pointing an MCP client's config directly at node C:\path\to\branchpoint\dist\index.js instead of using npx, remember the config file is JSON: backslashes need to be escaped (C:\\path\\to\\...) or replaced with forward slashes (C:/path/to/...), or a raw Windows path will fail to parse or get silently mangled.

npm install or yarn install fails or warns inside a cloned copy of this repo. The project pins pnpm via devEngines.packageManager in package.json; install pnpm and use pnpm install instead.

Everything returns "detached HEAD" / no active branch. You're on a bare commit checkout or mid-rebase, where Git itself has no current branch name. This is a normal Git state, not a Branchpoint error: run git checkout <branch> to return to a branch, and context tracking resumes.

Where is my data, and how do I delete it? Context lives as one markdown file per branch under .git/branchpoint/, rooted at the repository's shared .git directory (so it's the same store across every worktree of a repo, not duplicated per worktree). To wipe everything: delete the branchpoint folder there. To remove a single branch's context: delete its corresponding .md file (or its parent folder, for branches with / in the name).

Roadmap

  • Publish to npm (the package is ready; npm publish is a manual step pending final review).

  • Detect and optionally clean up orphaned context (branches that were deleted but still have a saved summary).

  • Commercial version (teams, remote sync) built on top of this open-source core.

License

MIT

Available Tools

3 tools
get_branch_contextA

Returns the combined context for the active Git branch: manually saved summary, divergence from the default branch (if applicable), and recent commits.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the behavioral disclosure burden. It clearly indicates a read-only retrieval operation and lists what will be returned, including the 'if applicable' qualifier for divergence. It does not address edge cases like an unborn branch or absent saved summary, but those are minor for this simple read tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single, front-loaded sentence contains no filler and packs the full scope and output contents into a compact, readable definition. Every clause adds information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a parameterless tool with no output schema, the description adequately explains what the tool returns and when divergence may be absent. It could mention empty/edge states or commit limits, but nothing essential is missing for an agent to decide to call it.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, so no parameter documentation is needed. The description correctly focuses on the return value rather than input semantics, matching the baseline for parameterless tools.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb ('Returns'), a clear resource ('combined context for the active Git branch'), and enumerates the exact contents: saved summary, divergence, and recent commits. It is also readily distinguishable from the sibling save_branch_context, which implies writing rather than reading.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description makes the retrieval purpose clear: call this when you need the active branch's combined context. It does not explicitly mention when to prefer save_branch_context, but the read-vs-write contrast is strongly implied by the wording.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

pingA

Replies with Pong followed by the received message.

ParametersJSON Schema
NameRequiredDescriptionDefault
messageYesMessage to echo back in the response

TDQS

A3.9/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden, and it does disclose the complete observable behavior: the tool emits 'Pong' followed by the echoed message. This makes the tool's effect transparent for a simple echo utility, though it does not explicitly state that no state is modified.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence with no wasted words. It immediately communicates the exact behavior.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple one-parameter echo tool with no output schema, the description is sufficient for an agent to know what to send and what to expect back. No additional context is necessary.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the parameter is already documented as 'Message to echo back in the response.' The tool description adds context about the 'Pong' prefix but does not add significant meaning beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the behavior: 'Replies with Pong followed by the received message.' It uses a specific verb and describes an exact observable outcome, and it is easily distinguishable from the sibling context-management tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided about when to use this tool versus alternatives, or when not to use it. There is no mention of context, conditions, or exclusions, leaving the agent to infer usage entirely from the behavior.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

save_branch_contextA

Saves a summary of the current development context for the active Git branch. Use it when the user asks to remember or record the state, decisions, or progress of the branch being worked on.

ParametersJSON Schema
NameRequiredDescriptionDefault
summaryYesSummary of the current development context to save for this branch

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the burden. It clearly indicates this is a write operation (saves) and implies persistence of the summary. However, it does not disclose details like whether it overwrites existing context, how it interacts with get_branch_context, or any side effects. The description is adequate but not rich in behavioral detail.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loads the core action, and provides a clear usage trigger. Every sentence earns its place with no redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple tool with one fully documented parameter and no output schema, the description is largely complete. It could benefit from noting that it relates to the active branch and that get_branch_context is the retrieval counterpart, but the core information an agent needs to call it correctly is present.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already fully documents the single 'summary' parameter. The description adds context by explaining the summary is for the current development context, but it doesn't add significant meaning beyond the schema. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function: saving a summary of the current development context for the active Git branch. It uses a specific verb ('saves') and resource ('summary of the current development context for the active Git branch'), and it distinguishes itself from the sibling tool get_branch_context by focusing on the write operation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says when to use it: 'when the user asks to remember or record the state, decisions, or progress of the branch being worked on.' It does not explicitly mention when not to use it or name the sibling get_branch_context as the alternative for retrieval, but the context is clear enough for an agent to select it appropriately.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 3 tool updatesv0.2.0
    • First observedget_branch_context
    • First observedping
    • First observedsave_branch_context

TDQS

A4.1/5.0

Scored across 3 tools

Disambiguation5/5

The three tools have clearly distinct purposes: ping is a health check, get_branch_context retrieves data, and save_branch_context writes data. There is no overlap or ambiguity between any of them.

Naming Consistency4/5

get_branch_context and save_branch_context follow a consistent verb_noun pattern, while ping is a conventional standalone health-check name. This is a minor deviation rather than a systemic inconsistency.

Tool Count5/5

Three tools is a well-scoped size for a focused branch-context server. Each tool serves a necessary function without redundancy or bloat.

Completeness4/5

The core read/write lifecycle for branch context is covered with get and save. A delete/clear operation is a minor missing capability, but the server still accomplishes its primary purpose effectively.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    F
    maintenance
    Provides AI coding assistants with persistent project memory by capturing development checkpoints during git commits, branch switches, and inactivity. It enables seamless task resumption through tools that retrieve session history, momentum, and synthesized re-entry briefings.
    15 npm
    3
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Provides AI coding assistants with persistent, context-rich memory of a codebase, including documentation and git history, enabling recall across sessions.
    105
    Apache 2.0