Using Squad across clients
Squad 2.0 adds host-native client projections across all 7 supported hosts — GitHub Copilot, Claude Code, Kiro, OpenCode, Cursor, OpenAI Codex, and Google Antigravity (copilot|claude|kiro|opencode|cursor|codex|antigravity|all) — through squad init --client ... and squad upgrade --client ....
One .squad/ team projects into multiple client hosts without changing the underlying team state or backend contract. Programmatic host projections live in @bradygaster/squad-sdk/client (with @bradygaster/squad-sdk/clients kept as a deprecated alias).
Quick commands
npx squad init --client copilot
npx squad init --client claude
npx squad init --client kiro
npx squad init --client opencode
npx squad init --client cursor
npx squad init --client codex
npx squad init --client antigravity
npx squad init --client all
For an existing repo:
npx squad upgrade --client copilot,claude,cursor
What each adapter generates
Client (ClientId) | Generated files |
|---|---|
GitHub Copilot (copilot) | .github/agents/squad.agent.md plus .mcp.json |
Claude Code (claude) | .claude/agents/squad.md, .mcp.json, CLAUDE.md managed block, .gitignore block for .claude/worktrees/ |
Kiro (kiro) | .kiro/steering/squad.md (inclusion: manual), .kiro/agents/squad.json, .kiro/settings/mcp.json |
OpenCode (opencode) | .opencode/agent/squad.md, opencode.json |
Cursor (cursor) | .cursor/agents/squad.md, .cursor/rules/squad.mdc (alwaysApply: false), .cursor/mcp.json |
OpenAI Codex (codex) | .codex/agents/squad.toml (Codex custom agent with developer_instructions), AGENTS.md (short pointer block), .codex/config.toml ([mcp_servers.squad_state]) |
Google Antigravity (antigravity) | .agents/agents/squad.md (with squad_state MCP server in frontmatter), GEMINI.md (pointer block) |
Every host gets one coordinator file. Team members are not projected as separate host agents: the coordinator spawns each specialist as a generic subagent with that member’s .squad/agents/<name>/charter.md inlined, exactly as Copilot does.
Claude Code walkthrough
- Run
npx squad init --client claude. - Open
.claude/agents/squad.mdto inspect the coordinator prompt. - Confirm
.mcp.jsoncontainssquad_stateand.gitignorecontains the managed.claude/worktrees/block. - Check
CLAUDE.mdfor the managed Squad marker block (<!-- squad:begin ... -->/<!-- squad:end -->); your notes outside the block are preserved. - Run
claude --agent squad --mcp-config .mcp.jsonor delegate to thesquadsubagent. Claude Code does not load project-scoped.mcp.jsonservers until they are approved (claude mcp listshowssquad_state … Pending approval); approve them once interactively, or always pass the config explicitly. Headless runs (claude -p …, CI, scripts) must pass--mcp-config .mcp.json: without it the coordinator has nosquad_state_*tools, falls back to reading.squad/team.mddirectly, and halts on the state-backend handshake fororphan/two-layerbackends. Squad deliberately does not writeenableAllProjectMcpServers: trueinto.claude/settings.jsonfor you.
Kiro walkthrough
- Run
npx squad init --client kiro. - Verify
.kiro/steering/squad.md(inclusion: manual) and.kiro/agents/squad.json(pointing atfile://../steering/squad.md) were created. - Confirm
.kiro/settings/mcp.jsoncontains the additivesquad_stateentry. - Open the repo in Kiro and select the generated
squadagent; manual steering inclusion keeps non-Squad sessions clean while loading the coordinator prompt whensquadis active.
OpenCode walkthrough
- Run
npx squad init --client opencode. - Verify
.opencode/agent/squad.mdexists (mode: primary). - Check
opencode.jsonfor the additivemcp.squad_stateentry (type: "local",command: ["squad", "state-mcp"]). - Invoke Squad with
@squador the hosttaskflow.
Cursor walkthrough
- Run
npx squad init --client cursor. - Verify
.cursor/agents/squad.md,.cursor/rules/squad.mdc(alwaysApply: false), and.cursor/mcp.jsonexist. - Open Cursor and select the
squadagent (or invoke the rule on demand without forcing coordinator instructions into unrelated chats). - Let the coordinator route work from there.
Codex walkthrough
- Run
npx squad init --client codex. - Verify
.codex/agents/squad.tomldefines thesquadcustom agent (name,description,developer_instructions),AGENTS.mdcontains the short discovery pointer block (<!-- squad:begin:codex ... -->), and.codex/config.tomlhas[mcp_servers.squad_state]. Keeping full coordinator instructions in.codex/agents/squad.tomlprevents other tools that auto-loadAGENTS.mdfrom being flooded. - Mark the project trusted in your Codex home config (use the full path, not an 8.3 short path).
- Start
codexin the repo; the coordinator spawns one Codex agent per specialist.
Antigravity walkthrough
- Run
npx squad init --client antigravity. - Verify
.agents/agents/squad.md(which declares thesquad_stateMCP server in its YAML frontmatter undermcpServers:) and theGEMINI.mdpointer block. - Run
agy --agent squad(dismiss the first-run verbosity banner with Esc). - Quota is per model: if one model is exhausted, start with another via
--model.
Troubleshooting
squad cast --namewrites nothing: an old publishedsquadis first onPATH. Put the current build first.- Cursor: run
cursor-agent mcp enable squad_stateonce so the generated MCP server is approved. - Models: each host needs its own model access (a Copilot license covers Copilot and, through the GitHub Copilot provider, OpenCode; Kiro, Antigravity and Cursor need their own sign-in).
Polyglot repo walkthrough
If you want one repo to work across all 7 hosts, either:
npx squad init --client all
or incrementally:
npx squad upgrade --client copilot,claude,cursor
Squad persists only canonical client ids in .squad/config.json:
{
"clients": ["copilot", "claude", "cursor"]
}
That list is projection metadata only, validated by normalizeClientIds() and assertPortableClients() from @bradygaster/squad-sdk/client. It never carries secrets, machine paths, URLs, thread ids, lease tokens, or checkpoint state.
Why the merge behavior and rollback matter
Every client adapter uses additive config merging for shared JSON and TOML files (.mcp.json, .kiro/settings/mcp.json, opencode.json / opencode.jsonc, .cursor/mcp.json, and .codex/config.toml). Existing MCP servers, formatting, line endings, and top-level settings are preserved, and malformed config (or opencode.jsonc files with comments) is refused instead of overwritten.
To remove a client projection and restore shared files (CLAUDE.md, AGENTS.md, GEMINI.md, .gitignore, and shared MCP configs) byte-for-byte outside Squad’s managed sections, call uninstallClients:
import { uninstallClients } from '@bradygaster/squad-sdk/client';
uninstallClients(['claude', 'codex'], {
root: process.cwd(),
mcp: { command: 'squad', args: ['state-mcp'] },
});
Static team config vs. mutable runtime state
Across all 7 hosts, the generated coordinator prompt enforces a strict boundary:
- Mutable runtime state (decisions, memories, session state) flows through the
squad_stateMCP tools (squad_decide,squad_state_*,memory.*). - Static team configuration (
.squad/team.md,.squad/routing.md,.squad/config.json,.squad/agents/<name>/charter.md) is read and edited through workspace files and CLI commands (npx squad cast --name <Name> --role "<Role>"), never written viasquad_state_writeor hand-edited under.squad/casting/.
