KLYPIX Context Gateway — synchronize task, peers, conflicts, and relevant memory
brain_syncCoordinate coding tasks over an authorized MCP connection by declaring intent and expected files, then receiving shared brain context, active peers, messages, and exact-file conflict alerts.
Instructions
APPROVAL-FREE task gateway over the authorized MCP connection. Call FIRST with a concise intent and expected files, again when scope changes, and with phase:"complete" before the final response. One bounded response returns compact task-relevant brain context, active TASK peers (idle connections hidden), one-time messages, structured exact-file conflicts, and late-arrival overlap alerts. A completion that supplies machine-checkable result manifests is fail-closed: invalid, conflicting, or incomparable evidence returns needs-reconciliation and retains task scope. results is ONLY for such manifests, never a summary of the work: with nothing machine-checkable to claim, complete without it. Works on any MCP host — it needs only the authorized MCP connection, so native lifecycle hooks are optional. LIMITS: blocking overlap is EXACT-PATH over the declared files of each session plus the edits its host observed; sessions on different branches are also test-merged with git merge-tree (committed work only); a same-folder overlap is an advisory notice; coordination/result reconciliation is machine-local and OS-user-local; a teammate on another computer appears only when KLYPIX network is installed on both computers (presence, intent, files and brain_message, no result reconciliation), and file overlap remains ADVISORY.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "brain_sync"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| role | No | Optional free-text label for this session, such as "reviewer". Peers see it, and a handoff addressed to that role (brain_handoff for) is offered first to a session that declares it. It is a label only: no history, reputation or authority comes with it, and it lasts for this session. An empty string clears it. | |
| agent | No | Only for a subagent: the child id KLYPIX gave it when it started (for example "sub-1a2b3c"). Its intent and files are then recorded under that child id, under its parent session, instead of replacing what the parent declared. KLYPIX accepts only an id the host reported (Claude Code reports subagents); any other id is ignored and the call is recorded under the parent session. | |
| files | No | Project-relative files you expect to touch or have touched. Exact overlaps with peers are flagged. | |
| phase | No | start replaces prior task scope; checkpoint merges changed scope; complete clears task intent/files. Default: checkpoint. | |
| intent | No | One sentence describing the current task. Supply for start/checkpoint; completion clears it. | |
| project | No | Nonempty absolute current project root that directly contains brain.klypix or brain.any. Supply it on phase "start" so routing stays correct even when the MCP host launches from its own install directory. | |
| results | No | On phase complete, 1-8 result manifests for stable claim keys. The in-handler versioned validator rejects malformed, empty, unknown-field, or incomparable evidence and retains task scope. | |
| releaseClaim | No | Stake a durable claim that specific commits ride the NEXT release — the promise "you'll see it in the next build" made machine-readable. Unlike presence rows (which age out ~10min after a session ends), a claim persists until fulfilled (the release ref contains the shas — auto-retired with a courtesy note), withdrawn, or expired (14d). A release that would drop claimed shas is REFUSED until they are acknowledged BY NAME, and acknowledging them away notifies the owner. Use exactly one of shas (stake/extend) or withdraw. | |
| releaseIntent | No | Declare EXCLUSIVE intent to prepare a release of this project. The first declarer takes a ~2h lease (refreshed by checkpoints, freed by phase "complete", by expiry, or when the holder session ends); a second declarer gets a structured hard conflict naming the holder, version, and ref. While any lease is active every peer's sync gains a "release in preparation" footer line. A NEW declaration is also checked against what the release would LEAVE BEHIND: if the ref is missing commits that are on trunk or on a branch a live peer session is working on, OR commits any session STAKED a releaseClaim on (even one that has since ended), the lease is REFUSED (nothing is changed) and the response lists them — report those commits to the user, then re-declare with acknowledge:[...] naming each sha if the release should go ahead without them. Acknowledging away a claimed or live-owned commit queues its owner a notification automatically. | |
| include_context | No | Include fast task-relevant brain cards and offer queued coordination notes in the same response. Defaults true; false also defers note delivery so internal supervisor probes cannot consume model-visible messages. |