firstmate README

The project's README from github.com/kunchenguid/firstmate. As one markdown file: README.md.

firstmate

Platform X Discord

Talk to one agent. Ship with a crew.

firstmate - talk to one agent, ship with a crew

What it is

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.

Features

Full detail on every feature lives in docs/architecture.md.

Quick Start

Requirements

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.

Install and launch

gh auth login
git clone https://github.com/kunchenguid/firstmate
cd firstmate

Then launch one of the co-primary harnesses; AGENTS.md takes over from there:

Claude Code

claude

Grok

grok --trust

Pi

pi
# or, when the signed wrapper is installed
FM_PI_HARNESS=pi-signed pi-signed

Oh My Pi

omp
# or, when starting from inside a Claude Code pane
FM_OMP_HARNESS=omp omp

Start 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. Pi's /calm toggle 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. Those Calm-hidden operational inputs remain ordinary user-role messages with unchanged delivery, ordering, authority, persistence, and exports. 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.

Talk to it

> 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 it

More backends

Setup guides for tmux (the default) and every other supported backend (herdr, zellij, Orca, cmux) are linked in Documentation below.

How It Works

            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.

Built-in skills

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: the sub-supervisor self-handles routine notifications in bash, escalates captain-relevant events and bounded declared-external-wait rechecks as batched digests, and actively alerts if delivery gets stuck while you step away
/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; use /bearings file to also replace today's dated report in data/, and add include PRs for live GitHub enrichment
/updatefirstmate Fast-forward the running firstmate and its secondmates, 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:

Agent-only reference skills live under .agents/skills/ and are loaded by firstmate at the trigger points named in AGENTS.md.

Two-tier skill layout

Firstmate's skills live in two separate places with different audiences:

Documentation

Contributing

Contributions are welcome - see CONTRIBUTING.md for the workflow, repo conventions, and how to run the tests.

License

MIT - see LICENSE.

firstmate (kunchenguid/firstmate)

Searching Database…

这是什么?firstmate 是一个 agent 发行版:你与一名「大副」agent 对话,由它生成并监督一组并行工作的编程 agent,最后交给你完成的 PR、已批准的本地合并,或调查报告。
这是需要安装的应用吗?都不是——没有需要安装的应用、CLI 或服务器。克隆下来的仓库本身就是这个发行版:由 AGENTS.md、内置技能和辅助脚本组成,任何受支持的终端编程 agent 都会遵循它们。
怎么把它跑起来?克隆仓库,然后用其中一个共同主力工具——Claude Code、Grok 或 Pi——以该检出目录为工作目录启动;之后 AGENTS.md 会接管一切。
开始之前需要准备什么?需要一个验证可用的主力工具、git,以及通过 gh auth login 完成认证的 GitHub CLI,还需要一个运行时后端,比如 tmux(默认选项);大副会检测缺失的工具,并在你同意后帮你安装。
某些工具有什么坑吗?Cursor Agent CLI 必须加 --trust,否则项目钩子永远不会加载;无头模式的 cursor-agent -p 没有回合结束钩子,所以要交互式运行;Codex 和 OpenCode 在监督方面比共同主力工具有更多取舍。
Windows 上能用吗,还是只支持 macOS 和 Linux?这是一套终端方案:tmux 是参考默认后端,herdr、zellij、cmux 和 Orca 可作为替代。它面向 macOS 和 Linux;Windows 只以 CI 中实验性的 herdr 尝试形式存在。
它能擅自改动我的项目到什么程度?大副对你的项目保持只读,只有少数受保护、且需经「船长」批准的操作除外;其余所有改动都由船员 agent 在配置的合并权限范围内完成。
内置的斜杠命令能做什么?内置了五个:/afk 用于离开模式监督并批量汇总消息,/ahoy 用来回顾未决事项,/bearings 输出一份四部分的船队摘要,/updatefirstmate 负责自更新并重启运行中的大副,/stow 则把会话中的知识整理成持久笔记。
secondmates 是什么?可选开启的持久化「二副」,从各自隔离的 firstmate 主目录运行——拥有独立的 FMHOME、状态、项目和会话锁——既可在本地运行,也可在另一台可通过 SSH 访问的主机上运行,并带有受保护的更新与恢复机制。
Relay 是干什么用的?一项可选功能,只需一个本地 .env 配对令牌即可启用:它让大副用与聊天请求相同的生命周期来回复你在 X 和 Discord 上的公开提及,对已派发的工作做出确认,并在七天内发布最多三条适合公开的完成跟进。上线前还可通过试运行预览记录将要发出的回复。
ship 任务和 scout 任务有什么区别?ship 任务会把获得授权的改动交付到你的项目;scout 任务则留下一份独立的调查报告,适用于需要单独研究而非写代码的请求。
Size
46.4 MB
Stars
8.1K
Updated
CommitOct 18
Age
4mo
Commits · 90 Days