This community fork of kunchenguid/firstmate adds GitHub Copilot CLI support and a native Windows setup for multi-agent orchestration. Run Copilot as your first mate and as the workers it coordinates, with isolated git worktrees, task supervision, and pull-request delivery. If your team standardizes on GitHub Copilot - including developers at Microsoft and organizations where Copilot is the approved coding assistant - this fork provides a Copilot entry point to Firstmate's crew workflow.
- Copilot primary and workers - dedicated launch integration and tracked hooks handle session startup, worker activity, and asynchronous supervision.
- Windows with Herdr - Herdr hosts the visible worker terminals without requiring tmux or WSL, while this fork's PowerShell installer and watcher bridge connect the workflow to Windows; start with Windows: run the crew in Herdr.
- Built on Firstmate - this fork retains upstream's multi-harness architecture and credits its original author and contributors.
See harness configuration and the Copilot supervision protocol for supported behavior and operating requirements. For contributor-facing implementation ownership and verification, start with Contributing.
You can run one coding agent easily. But the moment you want three project tasks done in parallel - fixes, investigations, plans, audits - you become a tab-juggler: babysitting sessions, copy-pasting context between repos, forgetting which terminal had the failing test.
firstmate flips the model. You talk to a single agent - the first mate - and it runs the crew for you: spawning autonomous agents in a visible session backend, giving each a clean git worktree, supervising them to completion, and handing you finished PRs, approved local merges, or standalone investigation reports. For larger fleets, you can opt in to persistent secondmates: second mates that are still ordinary direct reports, but run from their own isolated firstmate homes on this machine or another SSH-reachable host.
firstmate is not a model, not a harness, not a skill, not an MCP server, and not a CLI.
firstmate is an agent distro for running a crew of agents.
An agent distro is a portable directory of instructions, skills, tooling, policies, and state conventions that turns a general-purpose agent into a specialized one.
There is no app to install: the cloned repo is the distro - AGENTS.md, bundled firstmate skills, and helper scripts that any terminal coding agent can follow.
Launching a supported harness inside it for your primary session instantiates your first mate - and makes you the captain.
firstmate runs on Linux, macOS, and Windows. GitHub Copilot CLI is supported for both the primary first mate session and crewmate workers, alongside the other supported harnesses.
- One liaison - you talk only to the first mate; it dispatches, supervises, escalates only real decisions, and reports plain outcomes.
- A visible crew - every crewmate works in its own tmux window or Herdr tab, or in an experimental Zellij tab, experimental cmux workspace, or experimental Orca terminal you can watch or type into; the first mate reconciles.
- Disposable worktrees - each task runs in a clean treehouse git worktree, or an Orca-managed worktree when
backend=orca, so parallel work on one repo never collides. - Two task shapes - ship tasks deliver authorized changes; scout tasks leave standalone investigation reports when the intake contract warrants separate research.
- Explicit project modes - each project ships via
no-mistakes,direct-PR, orlocal-only, with an optional+yolomerge-autonomy flag, an optionalbranch=<prefix>override for the defaultfm/ship-branch prefix, and an optionalforge=gerritbinding under which the worker publishes a Gerrit change instead of opening a pull request. - Optional secondmates - opt in to persistent second mates that run from isolated firstmate homes with their own
FM_HOME, state, projects, and session lock, either locally or as a whole home on an SSH-reachable host, with guarded updates and recovery that never turns an unavailable remote route into a local replacement. - Event-driven, zero-token supervision - a bash watcher sleeps on the fleet and wakes the first mate only when something needs you; verified primary harnesses also get a turn-end backstop that blocks or follows up on a blind stop when work is under way and supervision is not live.
- Optional Relay - opt in with one local
.envpairing token so firstmate can answer your public mentions on X and Discord alike, act on normal reversible mention requests through the same lifecycle as chat requests, acknowledge spawned work, and post up to three public-safe completion follow-ups within seven days for genuine milestones and the final outcome without changing non-Relay behavior; a final reply promised in a thread becomes durable state that is reconciled from disk, so a restart or a compacted conversation cannot lose it; dry-run preview records would-be replies and dismissals locally before go-live. - Strict project boundary - the first mate is read-only over your projects except for the narrow guarded and captain-approved operations authorized by hard rule 1, including fleet sync's guarded safe branch pruning; crewmates make every other project change behind the configured merge authority.
- Restart-proof - all state lives on disk and in the active session backend (tmux by hard default, herdr or cmux when selected or auto-detected, zellij/orca when explicitly selected); the next session reconciles after a restart, while ordinary supervision recovers confirmed-dead secondmate agents without waiting for one.
Full detail on every feature lives in docs/architecture.md.
- Linux, macOS, or Windows; Windows setup uses the PowerShell installer below.
- A verified primary agent harness: Claude Code, GitHub Copilot CLI, Grok, Pi,
pi-signed, Oh My Pi (omp), Codex, OpenCode, or Cursor Agent CLI. - Git and the GitHub CLI, authenticated through
gh auth login. - The CLI and dependencies for your selected runtime backend; tmux is the reference default, while the Windows quick start uses Herdr.
The first mate detects and offers to install supported missing tools after you approve. Backend-specific setup is linked in Documentation.
Claude Code, Grok, and Pi are equal co-primary recommendations for running the primary firstmate session, with pi-signed supported as Pi's distinct signed-wrapper identity.
Claude Code uses a tracked Stop hook for tokenless watcher re-arm and rewake, Grok uses background-notify wake cycles, and Pi uses its tracked primary watcher extension.
All three have verified turn-end guard paths when launched with their documented setup.
Pick whichever one matches your subscription and workflow.
Oh My Pi (omp), a Pi fork, is verified as a primary with the same extension-owned watcher model as Pi and a stronger turn-end guard: its blocking session_stop hook compels a continuation instead of requesting one.
Codex and OpenCode are also verified and supported as primary harnesses; Codex uses bounded foreground checkpoints, and OpenCode uses a TUI plugin, so both carry more harness-specific supervision tradeoffs than the three co-primaries.
Cursor Agent CLI is verified as a primary too, using a tracked project-scope .cursor/hooks.json whose stop hook parks on the watcher between turns, closest in shape to Claude Code's.
Launch it with --trust, or none of its project hooks load; it also has no turn-end hook in headless cursor-agent -p, so run the primary session interactively.
GitHub Copilot CLI is verified for primary and worker use through tracked .github/hooks/firstmate.json.
Its tracked asynchronous watcher, Windows bridge, recovery bounds, and current away-mode limitation are documented in the Copilot supervision protocol.
gh auth login
git clone https://github.com/timbarreto/firstmate
cd firstmateOn Windows, install Firstmate's required tools from PowerShell:
.\bin\fm-install-windows.ps1The Windows installer also installs Git for Windows and Python 3.13, configures the AXI integration hooks, and disables this repository's Claude project hooks by renaming .claude/settings.json to .claude/settings.json.disabled.
It does not install Herdr or your agent CLI.
For the Windows launch sequence, continue with Windows: run the crew in Herdr.
Launch a verified primary harness from this repository, inside Herdr when following the Windows setup; AGENTS.md takes over from there:
Claude Code
claudeGrok
grok --trustGitHub Copilot CLI
copilotIf Copilot requests routine shell approval even with --yolo and reports mcpServers.ide.type: Invalid literal value, see the Copilot IDE approval-loop workaround.
Pi
pi
# or, when the signed wrapper is installed
FM_PI_HARNESS=pi-signed pi-signedOh My Pi
omp
# or, when starting from inside a Claude Code pane
FM_OMP_HARNESS=omp ompStart omp with this checkout as its working directory: it auto-discovers the tracked .omp/extensions/*.ts files with no trust dialog, and naming them with -e as well would load each twice.
For Grok, --trust is needed once per clone so project hooks and the turn-end guard load; /hooks-trust inside Grok works too.
For Pi, approve the project trust prompt once per clone on first launch so the tracked .pi/extensions/*.ts files auto-load.
The /calm toggle on Pi, and on Claude Code behind its default-off early-access function-hooks flag, hides supported transcript chrome, including canonically classified Firstmate operational user rows, and uses a Calm-only animated working boat during active runs while preserving all model context and session data.
Calm changes only presentation, not the user-role delivery, ordering, authority, persistence, or exports of the operational inputs it hides.
The preference persists for the effective Firstmate home, and toggling it off restores ordinary rendering.
Calm's current behavior and supported limits are separate from its version-scoped maintainer evidence.
Pi's /supervision-model command pins a cheaper model and a shallower reasoning effort for the supervision branch alone, from the eligible models and thinking levels Pi itself reports, and with no pin the branch normally follows your own conversation's model and effort; see the configuration schema.
Herdr is the terminal layer, not another coding agent. It keeps the first mate and its workers in visible terminal panes, tabs, and workspaces inside your terminal application. Firstmate coordinates the work, Copilot (or another supported harness) does the coding, and Treehouse supplies isolated git worktrees. Herdr is key to this fork's native Windows workflow: it provides the session management without tmux or WSL, while Firstmate's shell helpers still use Git for Windows' Bash.
After running the Firstmate installer above, install Herdr separately using its Windows installation instructions.
The Firstmate Herdr setup guide owns the required protocol and dependencies.
Open a fresh PowerShell window so the installed tools are on PATH, change to your Firstmate clone (adjust the example path), and start Herdr:
Set-Location C:\src\firstmate
herdr --version
herdrIn a PowerShell pane inside Herdr, start the primary Firstmate session from the clone:
Set-Location C:\src\firstmate
$env:FM_BACKEND = "herdr"
copilotThis explicitly selects Herdr for new workers launched by this session.
For automatic detection or a persistent config/backend setting, see backend selection.
Ask the first mate for work as usual; it creates the worker terminals, so there is no need to start a Copilot session manually for each task.
Workers appear in task workspaces when presentation spaces are enabled, or in tabs alongside their launching first mate otherwise.
Use the mouse to select workspaces and tabs, or use these default Herdr shortcuts: press Ctrl+B, release it, then press the action key.
| Action | Key after Ctrl+B |
|---|---|
| Navigate workspaces | w |
| Next / previous tab | n / p |
| Show active keybindings | ? |
| Detach without stopping the agents | q |
Run herdr again to reconnect to the same default session rather than launching another first mate.
Detaching leaves the agents running; stopping the Herdr server or rebooting Windows does not preserve those running processes.
Let Firstmate manage task cleanup instead of closing worker panes or stopping the shared server to tidy the display.
If herdr is not found, reopen PowerShell and check PATH; for other issues, see Herdr's Windows support notes, client compatibility, and Firstmate's current Herdr limits.
> ahoy! look at my github project xyz, then fix the flaky login test and add dark mode
# firstmate checks its toolchain (asking your consent before installing anything),
# clones the project under projects/ and spawns two isolated workers in the active backend.
# Minutes later:
PR ready for review, captain: https://github.com/you/xyz/pull/42
(fix flaky login test - risk: low - CI green)
> alright merge itSetup guides for tmux (the default) and every other supported backend (herdr, zellij, Orca, cmux) are linked in Documentation below.
you (the captain)
│ chat: requests, decisions, "merge it"
▼
┌─────────────────────────────────────┐
│ firstmate (this repo) │
│ reads projects/ + firstmate routes │
│ writes guarded backlog/briefs/state │
└──┬──────────────┬───────────────┬───┘
│ backend sends / status files │
▼ ▼ ▼
┌────────┐ ┌────────┐ ┌────────┐
│fm-task1│ │fm-task2│ ... │fm-taskN│ tmux windows, herdr/zellij tabs, cmux workspaces, or Orca terminals
│crewmate│ │crewmate│ │crewmate│ one autonomous agent each
└───┬────┘ └───┬────┘ └───┬────┘
▼ ▼ ▼
treehouse worktree, Orca worktree, or isolated secondmate home
│
├─ ship: project mode ► PR/local merge ► teardown
│
└─ scout: report at data/<id>/report.md ► decision inventory ► relay findings ► teardown
You chat with the first mate.
It routes each request to a crewmate in its own session endpoint and git worktree, supervises the fleet with a zero-token event-driven watcher, and brings you finished PRs, approved local merges, or investigation reports.
Optional secondmates extend this to persistent local or whole-home remote second mates, dispatch profiles let you steer which harness handles which task, and opt-in Relay lets the same fleet answer public mentions.
codex-app is not a runtime backend yet; docs/codex-app-backend.md owns the Codex App boundary.
Full architecture - the supervision engine, worktree isolation, secondmates, dispatch profiles, project modes, optional Relay, fleet sync, and self-update - is in docs/architecture.md.
Firstmate ships these user-invocable built-in skills.
Claude and grok use the slash form shown here; codex uses the same names with $, such as $afk.
| Skill | What it does |
|---|---|
/afk |
Enter away-mode supervision: Pi's in-process branch, an opt-in supervision host beside the other primaries, or the daemon handles wakes while you step away; see the away procedure for the posture and return contract |
/quiet |
Keep routine wakes off main while staying and chatting: where Pi's branch or an attended supervision host already does this, it only says so; otherwise it starts the quiet daemon, which stays active through ordinary chat until /quiet off |
/ahoy |
Recap visible session events since the prior real captain message plus visibly unanswered captain decisions, then guide the captain through any open decisions one at a time in agent-judged impact order; fall back to Bearings when invoked as the session's first real captain message |
/bearings |
Generate a concise four-section chat digest from bounded fleet state, including registered remote-home ledgers and measured follow-up for owned contributions; use /bearings file to also replace today's dated report in data/, and add include PRs for live GitHub enrichment |
/updatefirstmate |
Guardedly update the running firstmate and its secondmates - fast-forward, or reconcile a redundant post-squash-merge divergence - then persist and restart every live mate successfully left on the target commit - including already-current homes - with an honest re-read nudge only when restart cannot be proven |
/stow |
Sweep the session for uncaptured durable knowledge, persist the open work records this session knows are unfiled or now wrong, curate tiered startup memory with decay and cold archival, enforce each home's budget or surface the required decision, cascade to registered second mates, and report what is safe to reset |
Bearings invocation examples:
/bearingsreturns the fresh four-section digest in chat only.- Owned-contribution follow-up comes from the cached coverage projection;
include PRsremains the opt-in for repository-wide live PR enrichment. /bearings include PRskeeps chat-only mode and opts into live PR enrichment./bearings filereplaces today'sdata/status-report-<YYYY-MM-DD>.mdfrom scratch and links it from the four-section chat digest./bearings file include PRscombines the dated report with live PR enrichment.
Agent-only reference skills live under .agents/skills/ and are loaded by firstmate at the trigger points named in AGENTS.md.
Firstmate's skills live in two separate places with different audiences:
.agents/skills/- agent-loaded skills (this section's table, plus firstmate's agent-only reference skills). Every one of these assumes a live firstmate home and is meaningless, or actively misleading, installed anywhere else, so each carriesmetadata.internal: truein its frontmatter. That flag hides them from installer discovery (tools like the skills.shnpx skills addinstaller) without affecting how firstmate itself loads them - frontmatter metadata is inert to the agent's own skill loader.skills/- public, installer-facing skills for external agents and never part of a live firstmate's loaded instruction surface. Each one is self-contained and must not depend on a live firstmate home or private fleet state; a skill may be generic or may target maintenance of the Firstmate repository itself.skills/stowis a generic session-knowledge-sweep skill that routes findings by explicit instruction first, then existing local conventions, then a private.stow-notes.mdfallback, and curates tiered entries through decay, local archival, and user-approved on-demand offload proposals. It intentionally shares no code with the firstmate-internal.agents/skills/stowit is named after, so the two can evolve independently.skills/reconcile-firstmate-upstreamis an external-maintainer workflow for freezing onekunchenguid/firstmaterevision, reconciling thetimbarreto/firstmatefork, running changed-aware local validation, and opening an ordinary unmerged PR.
- docs/architecture.md - maintainer architecture for the crew, supervision, worktrees, secondmates, and project modes.
- docs/configuration.md - environment variables,
FM_HOME, runtime backend selection, optional Relay and its X and Discord setup steps, trusted external process-event adapter setup, the files you set, and harness support. - docs/extension-bindings.md - maintainer architecture for the narrow trusted external
process-event-adapter/1package, binding, handshake, and evidence boundary. - docs/remote-secondmates.md - current setup, routing, transfer, recovery, and safety behavior for whole-home remote second mates.
- docs/calm.md - current
/calmbehavior on Pi and Claude Code and its supported presentation limits. - docs/voice-relay.md - the optional spoken interface: setup on both machines, measured round-trip cost, what a spoken answer may read, and what this build does not do yet.
- docs/fleet-ledger.md - the opt-in activity ledger outside tools can read to follow a home's tasks, and its record contract.
- docs/wedge-alarm.md - configure the active alert for an away-mode escalation delivery that gets stuck.
- docs/tmux-backend.md - current setup and limits for the tmux reference backend.
- docs/herdr-backend.md - current setup, CI coverage, safety boundaries, and limits for the Herdr backend.
- docs/zellij-backend.md - current setup and limits for the experimental Zellij backend.
- docs/orca-backend.md - current setup and limits for the experimental Orca backend.
- docs/cmux-backend.md - current setup, socket security, and limits for the experimental cmux backend.
- docs/codex-app-backend.md - the current blocked Codex App backend boundary and rollout contract.
- docs/verification/runtime-backends.md - active maintainer verification for runtime backend guarantees.
- docs/gerrit-forge-integration.md - maintainer architecture for the forge axis: why change-shaped review is not a forge variant, the mode/forge/shape composition test, and where responsibility for forge mechanics sits.
- docs/gitlab-merge-watch.md - maintainer verification for watching and merging GitLab merge requests on arbitrary instances.
- docs/gerrit-change-watch.md - maintainer verification for watching Gerrit changes read-only, and why the merge path refuses one.
- docs/turnend-guard.md - the primary session's current "no turn ends blind" backstop, scope, loop safety, and compatibility limits.
- docs/verification/supervision.md - active maintainer verification for session-start, guard, continuity, and wedge integrations.
- docs/supervision-protocols/ - rendered primary-harness watcher protocols for Claude, Codex, GitHub Copilot CLI, OpenCode, Pi and
pi-signed, omp, Grok, Cursor, and unknown harness fallback. - docs/scripts.md - the
bin/toolbelt reference. - docs/documentation-audiences.md - documentation audiences and the machine-checked placement boundary.
AGENTS.md- the supervisor contract, role boundary, and routing index for conditional procedures.- CONTRIBUTING.md - how to contribute, including the dev/test commands.
Contributions are welcome - see CONTRIBUTING.md for the workflow, repo conventions, and how to run the tests.
MIT - see LICENSE.
