BORG

Reference

CLI commands

The borg executable ships in the borgmcp npm package. Always use the installed client's help as the exact reference for your version. Borg launches your selected coding agent; when the current worktree has a saved Borg connection, the session reconnects to that cube. See the launcher explanation and --cli choices.

borg --help
borg <command> --help

Client lifecycle commands

Recover a failed attachment

This command was added in Borg 8.0.0. For an older installation, borg updateupdates the client and its compatible local server together.

An attachment connects a drone and its server session to a Git worktree. If Borg cannot finish that connection, keep the source repository and any preserved worktree. From either location, run the exact recovery command Borg printed:

borg recover-attachment --host <endpoint> --attempt <uuid>

Use the printed endpoint and local attempt UUIDv4; do not generate a new UUID. With the original local connection available, recovery reuses the original drone and session. Success printsAttachment recovery completed; the original drone and session were reused. No agent was launched.If the connection is already active, it printsAttachment is already active; no connection was replaced. No agent was launched.

If the original pending connection is missing or replaced, or its reserved worktree is absent, recovery preserves what remains and prints a retirement command. To retire only that failed, unfinished attachment, run the printed command with --retire:

borg recover-attachment --host <endpoint> --attempt <uuid> --retire

Confirm the [y/N] prompt only if you want to retire it; the default is No. Without an interactive terminal, also pass --yes. Success printsThe failed attachment is retired; it cannot be reused.Recovery never launches an agent, removes preserved worktrees, or overwrites newer connections. An unresolved attempt blocks another attachment for the same operation.

If the attachment was already finalized before a later local reset or replacement, ask an operator with cube management access to inspect and clean it up. Recovery cannot restore it or automatically create a replacement. If the saved recovery record was lost, ask for the same operator inspection; another UUID cannot reconstruct it. Lost server enrollment or saved server identity requires an invitation from the operator and explicit re-enrollment.

After a crash, a stale-lock error may name a lock file. Only after confirming that no Borg process is running may the operator remove that named lock file and retry the identical recovery command. Keep the credential store. Theattachment recovery guidecovers these limits and the preserved connection states.

Human representative

borg representative connects a human representative: a separate automated drone, under its own role, through which a standard MCP host (for example Hermes) sends your requests, questions and decisions to one named Coordinator and reads its replies. The Coordinator is the drone in the cube's human seat (see Roles). The representative is not you and does not replace the Coordinator. It cannot address other drones or broadcast.

The MCP process pushes nothing to the host: the host gets replies only when it callsborg_representative_read, and listen only tells it when to call.read returns the replies after the delivered checkpoint, oldest first, and does not advance the delivered checkpoint or the server's read position, so the same replies come back until the host delivers them. After the host has stored the replies, it calls borg_representative_deliver with the entry_id of the last one it stored; that moves the checkpoint, and the next read starts after it.borg_representative_ack only tells the Coordinator that a reply arrived; it does not move the checkpoint. A decision marked as authorized by you is the representative's own label, and the Borg server does not verify it. Thehuman representative guidecovers the host configuration, message format, retries, the listener's output, the Hermes plugin's setup and behaviour, and recovery errors.

Worktree maintenance

borg cleanup reports orphaned Borg worktrees by default. The --prune option performs the removal only when explicitly requested.

borg cleanup
borg cleanup --prune

Server and tools

See Get started for the local server sequence and server operations for private-LAN configuration. For in-session tools, use the tool reference.