Branchlane

Developers

Build on Branchlane

Connect coding agents and your own tools through a local MCP server, and read what Branchlane keeps in the repository. No cloud API, no account.

Updated November 23, 2026 for Branchlane 2.3

What you can build

Branchlane has no cloud API. Everything a tool can reach runs on the same Mac, or lives in the repository where any tool can read it:

The lane server needs Branchlane Pro and runs only while Let agents connect is on in Settings > Agents. Branchlane has no URL scheme, App Intents or AppleScript dictionary.

Connect an agent

Open Settings > Agents, turn on Let agents connect, and copy the line for your agent. It already holds your port and token. Branchlane never writes these files for you.

Claude Code

Run once in Terminal:

claude mcp add --transport http branchlane http://127.0.0.1:47120/mcp --header "Authorization: Bearer <token>"

Codex

Add to ~/.codex/config.toml:

[mcp_servers.branchlane]
url = "http://127.0.0.1:47120/mcp"
http_headers = { Authorization = "Bearer <token>" }

Any other MCP client

Use the Streamable HTTP transport with the endpoint http://127.0.0.1:47120/mcp and the header Authorization: Bearer <token>. The port can be changed in Settings. To try it by hand:

curl -s http://127.0.0.1:47120/mcp \
  -H "Authorization: Bearer $BRANCHLANE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"my-tool","version":"1.0"}}}'

curl -s http://127.0.0.1:47120/mcp \
  -H "Authorization: Bearer $BRANCHLANE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"lane_begin","arguments":{"path":"/Users/me/src/app","intent":"Retry sync with backoff when the server is busy","agent":"my-tool/model-x","scope":["Sources/Sync/"]}}}'

Every tool returns its result as a JSON string inside a text item:

{
  "jsonrpc": "2.0",
  "id": 2,
  "result": {
    "content": [{ "type": "text", "text": "{\n  \"branch\" : \"lane/retry-sync-with-backoff-a7f4\",\n  \"lane_id\" : \"a7f460dc\", ... }" }],
    "isError": false
  }
}

Protocol details

Tools

Every tool takes path, your working directory: the repository, or the lane's worktree. lane_id can be left out when path is inside the lane's worktree. Only lane_status is read-only.

ToolArguments (bold is required)What it does
lane_beginpath, intent, agent, scope[], target, clone[]Starts a lane: a branch lane/<slug>-<id> and a worktree under .branchlane/lanes/<id>. Returns lane_id, worktree, branch, target. Work only in that worktree afterwards. clone copies ignored folders such as node_modules or .build.
lane_statuspath, lane_idRead-only. Status, whether recorded evidence still matches the code, review feedback, files and hunks the person left out, and collisions with other worktrees or the target, with line ranges and which side should go first.
lane_checkpointpath, lane_id, noteSnapshots the worktree, uncommitted changes included, without staging or committing.
lane_evidencepath, lane_id, command, exit_code, outputRecords that a command ran on the current content and how it ended. Valid only while the content stays exactly the same, so call it after your last edit. Only the end of output is kept, with secrets masked. Returns evidence_id.
lane_proposepath, lane_id, summary, claims[{text, evidence[]}]Asks the person to review the lane as it is now. Claims without current evidence are flagged.
lane_requestpath, lane_id, action: push | force_push | rewrite_history, reasonAsks to push, force-push or rewrite history. The policy decides, and some requests wait up to two minutes for the person. An approved push runs with the person's credentials.

A proposal with claims tied to evidence:

{"name": "lane_propose", "arguments": {
  "path": "/Users/me/src/app/.branchlane/lanes/a7f460dc",
  "summary": "Pushes are retried with exponential backoff and jitter. Six attempts at most.",
  "claims": [
    { "text": "A busy server is tried again, up to six times", "evidence": [1] },
    { "text": "The library file format is unchanged" }
  ]
}}

Lane flow and states

  1. lane_begin, then work only inside the returned worktree. Commit there as you like: Branchlane snapshots uncommitted work too.
  2. lane_status before you start and before you propose. It tells you which files other agents are touching.
  3. lane_checkpoint whenever you like. The checkpoint hook also saves one at the end of every turn.
  4. lane_evidence after your last edit, for each test, build or lint run. Keep the returned ids.
  5. lane_propose with a summary and claims that cite those ids.
  6. lane_status later, for review feedback, left-out files and hunks, and notes.
ValueIn the appWhen
runningWorkinglane_begin, or returned by the person
proposedReady for Reviewlane_propose
acceptedIn QueueThe person accepted it; requireEvidence must pass
needsUpdateNeeds UpdateThe target moved and the work no longer applies. Rebase onto the target and propose again.
integratedIntegratedLanded on the target in one commit
revertedRevertedTaken back out with one commit
abandonedAbandonedCleaned up without integrating

Checkpoint hook

POST /hook/checkpoint takes the hook JSON that Claude Code sends and reads its cwd. If that folder is inside a lane worktree, Branchlane saves a checkpoint and answers {"checkpoint":true}; anywhere else it answers false and does nothing. Merge this into .claude/settings.local.json:

{
  "hooks": {
    "Stop": [{ "hooks": [{
      "type": "command",
      "command": "curl -s -m 5 -X POST -H 'Authorization: Bearer <token>' -H 'Content-Type: application/json' --data-binary @- http://127.0.0.1:47120/hook/checkpoint >/dev/null 2>&1 || true"
    }] }]
  }
}

The command fails quietly when Branchlane is not running, so the agent is never blocked.

Policy file

.branchlane/policy.json in the main worktree tells Branchlane, and the agents it serves, what is allowed. Commit it so the whole team shares it. Settings > Agents can create it with these defaults:

{
  "forbid": ["force_push", "rewrite_history"],
  "protectedBranches": ["main", "master"],
  "protectedPaths": [],
  "requireApproval": ["push"],
  "requireEvidence": [],
  "sensitivePaths": []
}

Settings > Agents also turns the policy into Claude Code permissions.deny rules, so Claude Code itself refuses what the policy forbids.

Agent attribution

Branchlane marks agent work in the graph and blame for everyone, Free included. Your tool can feed it in three ways.

Commit trailers

An Agent: trailer wins. Otherwise Branchlane looks at Co-authored-by:, then at the author and committer, for known agent identities such as noreply@anthropic.com, Codex, Copilot, Cursor, Gemini, Devin, Jules and aider. Integration commits that Branchlane makes carry:

Lane: a7f460dc
Change-Id: I3c1f…
Agent: claude-code/claude-opus-5-5

Agent Trace notes

Line-level records live as git notes on refs/notes/agent-trace, one note per commit, in the Agent Trace format (version 0.1.0, application/vnd.agent-trace.record+json). A note may hold one record, an array, or one per line. Records from other tools on the same commit are kept. Blame shows the lines AI wrote.

{
  "version": "0.1.0",
  "id": "…",
  "timestamp": "2026-11-23T02:09:00.000Z",
  "vcs": { "type": "git", "revision": "<commit>" },
  "tool": { "name": "claude-code" },
  "files": [{
    "path": "Sources/Sync/RetryingSyncEngine.swift",
    "conversations": [{
      "contributor": { "type": "ai", "model_id": "claude-opus-5-5" },
      "ranges": [{ "start_line": 12, "end_line": 48 }]
    }]
  }],
  "metadata": { "com.bbdyno.branchlane": { "written_by": "Branchlane", "lane": "a7f460dc" } }
}

Notes travel with refs/notes/agent-trace:refs/notes/agent-trace when you share lanes.

Lane records

Lanes are stored as Git refs under refs/branchlane/lanes/<id>/ (state, checkpoints, proposal). The state commits hold a lane.json. Teammates' lanes are fetched to refs/branchlane/shared/<remote>/<id>/. Treat these as read-only.

Worktree summary

When a repository has more than one worktree and the person has Pro, Branchlane keeps <git common dir>/branchlane/worktrees.json up to date, at least once a minute. Agents that do not speak MCP can read it instead of running git status in every worktree. It is removed when only one worktree is left.

{
  "version": 1,
  "about": "…",
  "generatedAt": "2026-11-23T02:09:00Z",
  "target": "refs/heads/main",
  "worktrees": [
    { "path": "…", "branch": "lane/retry-sync-a7f4", "head": "…",
      "access": "readable", "uncommittedFiles": ["Sources/Sync/SyncEngine.swift"], "lastChange": "…" }
  ],
  "collisions": [
    { "between": ["…", "…"], "conflicts": false, "sameFiles": ["Sources/Sync/SyncEngine.swift"],
      "conflictLines": { "Sources/Sync/SyncEngine.swift": [["40-60", "41"]] } }
  ]
}

Extend Branchlane

Your own model server

Settings > Assistant accepts any OpenAI-compatible server. Branchlane calls POST {base}/chat/completions with stream: true and reads server-sent events or a plain JSON reply, and uses GET {base}/models to test the connection. Without a path it adds /v1, so Ollama (http://localhost:11434) and LM Studio (http://localhost:1234) work as they are. A key is never sent over plain HTTP to another machine.

Repository data is wrapped between random BEGIN data-… and END data-… markers, and the model is told that what is inside is data, not instructions.

Your own MCP server for the assistant

The assistant can call tools on MCP servers that the person adds in Settings > Assistant. Serve the Streamable HTTP transport (protocol 2025-06-18) over HTTPS, or over HTTP on localhost. Branchlane sends MCP-Protocol-Version, keeps Mcp-Session-Id, and can add a Bearer token. Stdio servers cannot be started from the App Sandbox.

Questions and requests

Ask on the support page. Integrations that need something not listed here are welcome as feature requests.