tagteam
Reads the repository's git state (branch, HEAD, dirty/newly modified files, commits) to stamp every handoff, and re-compares it when the next session starts so the next agent is warned about drift — commits or edits made since the handoff — before it trusts the handoff's next step.
Ships a GitHub Action (MHRabea/tagteam) that runs the same shared rules on pull requests, failing a PR whose diff touches a protected path and annotating each offending file; the repo/badges/action references are also used for distribution.
tagteam
When your AI coding agent stops mid-task, the next one picks up from the exact next step, and is told what changed since. Rules you set are enforced: in the session, at handover, and in CI.
Claude Code hits its usage limit. tagteam saves a structured handoff (task, what's done, the ONE next step, rules, test status), stamps it with the git state, and starts your next agent with it: Claude Code on another provider like DeepSeek, Codex, or any command. If the code changed in between, the next agent is warned before it trusts the handoff.
npm i -g tagteam-ai
tagteam profile add claude
tagteam profile add deepseek --key # or any provider you already pay for
tagteam --auto-switch # on a usage limit, continue on the next profile by itselfJust want Claude Code to stop editing files you care about? Three commands, no profiles needed:
npm i -g tagteam-ai # global install: the hook calls `tagteam`
tagteam install claude # in your repo: adds the hooks (.claude/settings.local.json) and the MCP server (.mcp.json)
tagteam constraint "Don't change the payment gateway" --paths "src/payments/**"Restart Claude Code in the repo. From then on an Edit or Write to src/payments/** is refused before it happens, and the agent is told which rule blocked it (see it in a real session). Add --shared to commit the rule for your team and enforce it on pull requests too.

A live run on one task: real Claude Code (2.1.330) → real Codex (0.172) → real Claude Code, through tagteam. The handoff, the agents' replies (excerpts, cut where marked …) and the command output are as they happened. An earlier demo with the summarizer writing the handoff after a usage limit: docs/demo.gif.
If tagteam saves you from re-explaining a project, a ⭐ on GitHub helps other developers find it.
The loop, without you doing anything
You run
tagteaminstead ofclaude. The agent starts with the saved context: task, next action, rules, drift warnings.The session ends: usage limit, crash, closed window, or you just want a second opinion.
A handoff is always saved. The agent writes it (
/handoff, MCP, or the auto-save on/compactand exit). If it couldn't, a cheap model from your other profiles writes it from the redacted transcript and diff. If every provider is down, tagteam still saves the git state and your last messages.The handoff is checked. Missing pieces ("no test status", "next action is vague") are reported to the agent while it can still fix them, and to the next one.
The next agent starts. tagteam proposes the next profile in your chain, or with
--auto-switchstarts it by itself when the session ended on a usage limit.It continues from the next step, with a warning if commits or edits happened since the handoff.
Your own keys and logins only: tagteam never shares, stores or switches subscription logins.
Why
Long AI coding sessions get lost in four common ways:
Compaction: the agent summarizes 200 messages and forgets the one rule that mattered.
A new session: you explain the project again.
Switching agents: none of the context comes with you.
Stale summaries: "continue where you left off" points at code that changed an hour ago.
tagteam fixes all four with a small local CLI.
Related MCP server: agent-handoff-mcp
What makes it different
Native resume | Memory / rules files | Provider switchers | tagteam | |
Works across different agents (Claude Code, Codex, any MCP client) | – | partial | – | ✅ |
Drift detection: warns when the repo changed since the handoff | – | – | – | ✅ |
Handoff check: tells the agent what its handoff is missing, while it can still fix it | – | – | – | ✅ |
Handoff written even when the agent hit its limit or crashed | – | – | – | ✅ |
Auto-switch to the next agent on a detected usage limit (opt-in) | – | – | partial | ✅ |
Guardrails: rules bound to file paths, checked against your diff | – | – | – | ✅ |
Edits to protected paths blocked during the session (Claude Code) | – | – | – | ✅ |
Claimed vs actual: re-runs the handoff's tests and tells the next agent if "pass" was false | – | – | – | ✅ |
Team rules in CI: the same rules fail a pull request (GitHub Action) | – | – | – | ✅ |
Nothing added to your repo (unless you opt in to shared rules) | ✅ | – | ✅ | ✅ |
Secrets redacted before anything is saved | n/a | – | n/a | ✅ |
Drift detection
Every handoff records the branch, HEAD and dirty files. When the next session starts, tagteam compares that state with the repo:
## ⚠ Drift since handoff — verify before trusting it
- 2 new commit(s) since the handoff, touching 3 file(s): src/billing.js, test/billing.test.js, package.json.
- Uncommitted changes differ from the handoff. Newly modified: src/gateway.js.Guardrails: blocked in the session, flagged at handover, failed in CI
tagteam constraint "Do not change the payment gateway interface" --paths "src/payments/gateway.*"One rule, three layers:

Recorded from a real headless Claude Code session (2.1.330) with tagteam's hook; the agent's reply is quoted as written, with the proposed code cut.
During the session (prevention). In Claude Code, tagteam's
PreToolUsehook refuses the edit before it happens and tells the agent why. Tested with real Claude Code: the file stays untouched, and the agent stops and asks you instead of working around it:I didn't change the file, because a tagteam guard hook blocked the edit:
src/payments/**is protected by the rule "Do not change the payment gateway"…At handover (detection). Every agent sees the rule at session start, and
tagteam statusflags any diff that touches those paths (exit code 2). This also catches writes the hook can't see, such as shell commands, and agents without hooks (Codex).In CI (gate).
tagteam checkand the GitHub Action fail a pull request that touches the path (below).
Need to change a protected file yourself? tagteam guard off (per repo), make the change, tagteam guard on. A rule saved with --warn-only warns but never blocks.
Team rules that also guard your pull requests
Add --shared and the rule goes into .tagteam/constraints.json in the repo (the only file tagteam ever writes there, and only when you ask). Commit it: every teammate's agent gets the rule, and CI enforces it.
tagteam constraint "Payments code changes need a review from the payments team" --paths "src/payments/**" --shared
tagteam check --base main # files changed on this branch vs the rules; exit 2 on a hitOn GitHub, add the action to any workflow. A pull request that touches a protected path fails, with an annotation on each file:
on: pull_request
jobs:
guardrails:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: MHRabea/tagteam@v0.3.1The same rule your AI agent was told about at session start is the one your CI checks, so an agent (or a person) can't quietly change a file you protected.
A handoff that survives rate limits
When an agent exits without saving a handoff (limit hit, crash, window closed), a cheap model from one of your other profiles writes it. That model gets the redacted transcript and the diff. If no other profile has a key, tagteam saves the git state and your last messages.
Auto-switch on a usage limit
tagteam --auto-switch (or "autoSwitch": true in ~/.tagteam/profiles.json) starts the next profile by itself when the session ended on a usage or rate limit. tagteam reads it from the end of the agent's own transcript (Claude Code's limit and API-error messages, Codex error events), not from guesses: a session that merely talks about rate limits never triggers it. Each profile is skipped at most once per run, so if every provider is limited, tagteam stops and asks.
Claimed vs actual: tagteam verify
A handoff that says "tests: pass" is a claim. tagteam verify re-runs the handoff's own test command and compares:
Handoff 2026-11-28T09-12-03-120Z claims tests: pass
Command from the handoff: npm test
Run this command in the repo? [y/N] y
...
✗ tagteam verify: claimed pass, but the tests FAIL now. The next agent will see this result.The next agent's context then says what was actually re-run and what it returned, instead of the previous agent's word for it. A test result that was never re-run is labelled as a claim. The command comes from a handoff an agent wrote, so tagteam shows it and asks before running it (--yes to skip the prompt for commands you trust), and never runs it on its own.
Handoff check
A handoff with "next: continue" is not a handoff. tagteam checks each one for a task, ONE concrete next action, test status and listed progress. When the agent saves through MCP, it gets the gaps back immediately ("No test status: the next agent cannot tell whether the code currently passes") and can save again. The next agent sees any remaining gaps, and so does tagteam status. The check is advisory: it never fails a build.
How it works
tagteam ──▶ agent (Claude Code / Codex / custom)
│ │ SessionStart hook / first prompt ◀── context pack (task, next action, constraints, drift)
│ │ MCP tool save_handoff ──────────────▶ handoff.json (git-stamped, redacted)
│ ▼
└── on exit: handoff saved? no → summarizer (another provider) → fallback: git state
usage limit + --auto-switch? → start the next profile
otherwise: Continue with "deepseek"? [Enter]Claude Code: hooks and MCP are passed with
--settingsand--mcp-config. Nothing is written into your repo.Codex: the provider and MCP server are passed with
-coverrides. Your~/.codex/config.tomlis untouched.Any agent: a
customprofile gets the context as a file. Any MCP client can usetagteam mcp.
Profiles
tagteam profile add claude # Claude Code, your normal login (no key stored)
tagteam profile add deepseek # Claude Code on DeepSeek's Anthropic-compatible API
tagteam profile add openai # Codex on the OpenAI API
tagteam chain claude,deepseek,openaiPreset | Runs as | Provider | Tested live (2026-11) |
| Claude Code | your normal login | ✅ hooks + MCP |
| Claude Code | Anthropic API key (separate from a Claude plan) | key ok (no API credit to run) |
| Codex | your ChatGPT login ( | not run yet |
| Claude Code |
| ✅ two-session task with handoffs |
| Codex | OpenAI Responses API | config ok (no credit to run) |
| summarizer only | xAI | ✅ summarizer (as an agent: rejected by Claude Code and Codex today) |
| summarizer only | Gemini OpenAI-compatible API | key ok, API returned 503 under load |
Summarizer-only profiles never run as agents. They write handoffs when an agent stops without one, and tagteam moves on to the next summarizer if one fails.
Other providers:
tagteam profile add router --agent claude --base-url https://openrouter.ai/api --model <model>
tagteam profile add mine --agent codex --base-url https://my-provider/v1 --model <model>
tagteam profile add other --agent custom --command "my-agent --prompt-file {context_file}"Commands
Command | |
| Start an agent with the saved context. On exit, save a handoff and offer the next profile. |
| Drift, guardrail and completeness report (exit 2 on drift or a guardrail hit) |
| Show the blocking rules, or turn the edit guard off and on for this repo |
| Re-run the handoff's test command and compare with what it claims (exit 2 on a false pass) |
| For CI and pre-push: files changed on the branch vs the rules (exit 2 on a hit). Needs no saved handoff |
| Check node, git, agents, keys and the repo (exit 1 on problems) |
| Print the context pack |
| Handoff history |
| Add a rule ( |
| Permanent per-repo wiring, if you run agents without |
| MCP server: |
In Claude Code, /handoff saves a handoff written by the agent itself, and the tagteam skill tells the agent when to use tagteam on its own: check drift at session start, record rules and decisions as they come up, save a handoff before it stops, and run tagteam status before committing. tagteam run installs both at user level (~/.claude/commands/handoff.md, ~/.claude/skills/tagteam/SKILL.md) and never overwrites files of your own with the same name. The skill is plain templates/skill/SKILL.md, so any agent that reads Agent Skills can use it.
Security and privacy
Local-first: data lives in
~/.tagteam/and never enters your repo. The one exception is opt-in:--sharedrules go to.tagteam/constraints.jsonso you can commit them.Keys: kept in the OS key store: Windows DPAPI, macOS Keychain or Linux Secret Service (
secret-tool).profiles.jsonholds only ciphertext or a reference. A key reaches the agent only through an environment variable, never as an argument.Logins: tagteam never reads, stores or switches subscription logins. The
claudeprofile uses Claude Code's own login.Redaction: API keys, tokens, passwords, private keys and credentials in URLs are redacted before anything is saved or sent.
Summarizer: it is the only network call tagteam makes. Turn it off with
--no-summary.
Status
0.3, early. Tested live on Windows (including the edit guard with real Claude Code); CI runs the test suite (109 tests, with fake agents and a mock provider) on Windows, macOS and Linux. Saves are locked per repo, so two agents or hooks saving at once never overwrite each other. See SECURITY.md and CHANGELOG.md.
Roadmap:
VS Code status bar
cost per task
team handoffs (shared rules shipped in 0.2)
License
Apache-2.0 © 2026 Mahmoud Rabea · GitHub · LinkedIn. "tagteam" and its logo are not covered by the license. See NOTICE.
Available Tools
6 toolsadd_constraintA
Record a rule from the user that must never be broken. paths: globs of files the rule protects (guardrail warnings fire when they change). shared: true only when the user asks for a team-wide rule; it is written to .tagteam/constraints.json in the repo, where teammates and CI (tagteam check) see it.
Inputs: text (required), paths, shared.
add_decisionC
Record an architecture or design decision and why it was made.
Inputs: decision (required), why.
get_contextA
Current task, constraints, decisions, project memory and drift warnings for this repo. Call at session start.
Inputs: no named parameters.
list_handoffsB
List recent handoffs (newest first).
Inputs: limit.
save_handoffA
Save a structured handoff so the next session or agent can continue. Call before stopping or when context is getting long.
Inputs: task (required), next_action (required), agent, tests, +5 more.
update_memoryA
Update slow-changing project memory (architecture, rules, business logic). mode=append adds a section; mode=replace rewrites the file.
Inputs: content (required), mode.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
The tools mostly target distinct concepts: session context, handoff persistence, decisions, constraints, memory, and handoff listing. There is some conceptual overlap between add_decision/add_constraint and update_memory, since both modify persistent project knowledge, but the descriptions provide enough distinction to select correctly.
All six tools follow a consistent snake_case verb_noun convention: get_context, save_handoff, add_decision, add_constraint, update_memory, list_handoffs. No naming style mixing or vague standalone verbs.
Six well-scoped tools fit the domain of agent context, decision, constraint, and handoff management. Each tool appears to earn its place without unnecessary surface area.
The surface covers reading context, saving and listing handoffs, recording decisions and constraints, and updating memory, which is strong lifecycle coverage. Minor gaps remain: there is no explicit way to retrieve a specific handoff's contents or remove/revise a previously recorded decision or constraint.
Maintenance
Related MCP Connectors
Git collaboration for AI agents and people: tasks, hand-offs, reviews, teams, shared memory.
Team memory for AI coding agents and code reviews, reviewed by humans and served over MCP.
Shared memory and mail for your AI agents. Verified with Claude Code; other MCP clients in testing.
Project memory for software teams: decisions, root causes, fixes, failed approaches and conventions that Claude, Claude Code, Codex, Grok and other MCP clients can search and save, shared across your agents. Memroot receives only what the agent sends in a search or a save, never your conversations; for the full experience in coding agents (automatic memory checks and session capture), run npx memroot setup.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceGit-native MCP server for managing AI context across sessions. Enables LLMs to access project and feature context via markdown files, preserving decisions and constraints.1-
- FlicenseNot gradedqualityDmaintenanceCentralized multi-project state & handoff MCP server that lets AI agents save checkpoints in one session and resume in another with minimal token overhead, including git snapshots and code-graph integration.-
- AlicenseNot gradedqualityCmaintenanceProvides MCP tools that give AI agents persistent, append-only memory in a git repository, letting them record observations, decisions, and corrections while retrieving context briefs, current facts, conflicts, and traceable event history without a vector database.6 npmMIT
- AlicenseNot gradedqualityCmaintenancePersistent project memory and task management for AI coding agents through MCP. Lets Claude Code, Cursor, Codex and other MCP clients save decisions and bug fixes, search relevant context, and reuse it across sessions.1MIT