firstmate is an agent distribution that lets one coding agent coordinate a crew of autonomous agents working in separate git worktrees. It is for running parallel fixes, investigations, plans, and audits while receiving completed pull requests, merges, or reports through one supervising agent. The catalogue entries provide skills, hooks, instructions, and settings for operating this workflow.
Borrowing it
Nothing to install: this file belongs to kunchenguid/firstmate. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/kunchenguid/firstmate/main/.agents/skills/session-start-recovery/SKILL.mdgit clone --depth 1 https://github.com/kunchenguid/firstmateWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/kunchenguid/firstmate/session-start-recovery)<a href="https://agentmods.dev/skills/kunchenguid/firstmate/session-start-recovery"><img src="https://agentmods.dev/badge/skills/kunchenguid/firstmate/session-start-recovery/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/kunchenguid/firstmate/session-start-recovery"><img src="https://agentmods.dev/badge/skills/kunchenguid/firstmate/session-start-recovery.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00026 | $0.01420 |
| Opus 5.5 | $0.00010 | $0.00568 |
| Sonnet 5.5 | $0.00005 | $0.00284 |
| Haiku 4.5 | $0.00003 | $0.00142 |
Grade A, and why
session-start-recovery scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 44 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Session-start recovery
The digest itself makes no external-network call and never waits for one.
Every network check a session start owes - GitHub auth, secondmate recovery, secondmate convergence, pending handoff delivery, and project clone refresh - runs off the digest's blocking path in a bounded worker owned by bin/fm-startup-network.sh and is reported in the digest's own NETWORK CHECKS section.
The locked startup inactive-outcome scan joins that worker so a slow local current-state read cannot block the digest; its findings use the ordinary durable wake queue.
- Lock - acquires the per-home session lock first, before anything mutates shared state, then starts the deferred startup stage above.
- Bootstrap - detect-only checks (tool/version problems, the worktree-tangle check, harness override, dispatch-profile validation, backlog-backend status) always run, but routine confirmations stay silent by default.
When the lock could not be acquired, the worktree-tangle check uses read-only advisory wording without a checkout repair command.
Home-local stale Herdr projection cleanup and the six bootstrap MUTATING sweeps - same-home backlog reconciliation, fleet sync, secondmate convergence, secondmate liveness, pending remote handoff retry, and Relay artifact writes - run only when this session actually holds the lock from step 1; the four network ones among them run in the deferred stage rather than in this section.
The secondmate liveness sweep accounts for every registered secondmate and reports skipped or failed recovery as
SECONDMATE_LIVENESS:lines. The sweep and the watcher's cadence-gated tick share the recovery contract; for T3 threads, follow the native recovery guide. - Wake queue - when locked, drains and presents the durable wake queue without running the inactive-outcome scan inline, and prints the raw records prominently as this turn's first work queue; a clearly labeled status-event annotation may follow a valid
signalrecord and includes every status line still unread at the presentation cursor, but never replaces the raw record or current-state reconciliation, and a lapsed watcher chain still surfaces here via the same guard alarm. Presented records remain durable until the handling turn runs the generation-bound acknowledgement printed by the drain. Every locked drain also prints a bounded fleet-wideOPEN DECISIONSsection when durable decision records remain open, including when the queue itself is empty; reconcile those entries before continuing. A main drain may also print a bounded, one-shotSTATUS OUTCOME BACKSTOPwhen a task's newest captain-facing status event has no covering supervision-branch outcome; handle it as a recovered wake even when no queue row remains. The same drain prints every still-unreadnote:line and pending-reply resolution since the last presentation in an unboundedUNREAD STATUSsection, so an answer buried under a later routine line is not dropped; those lines are not re-printed after that presentation. It also prints a boundedRECORD DIVERGENCEsection naming every captain call the status log reads as resolved while its backlog task is still held; nothing is closed for you, andcaptain-hold-lifecycleowns the reconciliation. When the lock could not be acquired and verified, the queue is left untouched because no session mutation is authorized, and the guard's tangle/watcher-liveness alarms still print in read-only advisory mode without drain, supervision repair, or checkout repair commands. - Supervision operating instructions - after the wake queue and before both digests, the digest emits exactly one operating block for the detected primary harness, followed by the read-once contract that governs them. The script itself never starts supervision; the emitted harness protocol owns the exact wait or wake mechanism.
- Fleet-state digest - after that read-once contract and ahead of the context digest, the compact backlog listing owned by
bin/fm-session-start.sh; everystate/<id>.meta; a bounded tail of each task'sstate/<id>.status(labeled as wake-EVENT history, not current state, with the full log path printed for a deeper read); the away or quiet posture (state/.afk-contract, plus thestate/.afkdaemon flag where a daemon runs); and one cheap alive/dead read of each task's recorded backend endpoint. That liveness line is a fast presence check only, not a full state read - when you need a crew's actual current state (a run-step, not just "is the pane there"), read it withbin/fm-crew-state.sh <id>as before; the digest deliberately skips that deeper, slower read for every task so it stays fast and bounded. - Network checks - after the fleet-state digest, the deferred stage's result, or an explicit statement of what it has not confirmed yet. A read-only session runs no network checks at all and says so.
- Context digest and next step - last of the bulk sections, the full contents of
data/projects.md,data/secondmates.md,data/captain.md,data/captain-shared.md, anddata/learnings.md, each clearly delimited, followed by the closing reminder. A file that does not exist prints an explicitABSENTmarker, never confused with an empty-but-present file: absence is meaningful (captain.mdabsent means use the firstmate repo's built-in defaults,projects.mdabsent means rebuild it from the clones underprojects/, etc.). The closing reminder points back to the emitted supervision block and preserves only the lock, afk, Relay, and read-once reminders.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- today Changed ef7cd34c9cb8
- 2d ago Changed d8777669cc36
- 25d ago Changed 772e416e09fb
- 27d ago First seen · 44 lines · 26 tokens per session scan A ff705c5c4b87
session-start-recovery is a skill published in the GitHub repository kunchenguid/firstmate (8,295 stars, last pushed today), licensed MIT. It adds 26 tokens to every session and 1,420 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-28.
Other skills, from other repositories
gke-workload-troubleshooting
Diagnoses GKE workload failures (CrashLoopBackOff, OOMKilled, ImagePullBackOff, Pending, etc.) via logs and events. Use when pods fail to start or crash repeatedly. Don't use for GKE cluster infrastructure provisioning, node pool creation, or non-Kubernetes Google Cloud services.
application-integration-troubleshooting
Diagnoses failed, stuck, or silent Google Cloud Application Integration runs and Integration Connectors tasks using the REST API, Cloud Logging, and Cloud Monitoring. Use when an integration fails, returns HTTP 200 without doing the expected work, hangs in a suspended or retry state, or hits IAM, run-as service…
gke-workload-scaling-troubleshooting
Diagnoses GKE HorizontalPodAutoscaler (HPA) failures — metrics showing as , FailedGetResourceMetric / FailedGetScale / FailedComputeMetricsReplicas events, missing Pod resource requests, custom/external metrics-pipeline breakage (FailedGetExternalMetric / FailedGetCustomMetric, unavailable metrics adapter…
gke-ai-troubleshooting-tpu-mxla-hang
Diagnose GKE Cloud TPU multi-slice training hangs (Megascale HANGDETECTED logs and hang monitored events) using the ML Diagnostics Megascale XLA (MXLA) Hang Analyzer (gcloud alpha mldiagnostics monitored-events) and 1-minute Cloud Monitoring multi-slice latency metrics (kubernetes.io/container/multislice/).…
gke-ai-troubleshooting-tpu-performance-degradation
Diagnose GKE Cloud TPU training throughput drops and step-time regressions (15%+ TPU duty-cycle drop) using ML Diagnostics Workload Monitoring (gcloud alpha mldiagnostics monitored-events / hypercomputecluster.googleapis.com/v1alpha) and 1-minute Cloud Monitoring system metrics (kubernetes.io/node/accelerator/).…
gke-ai-troubleshooting-jobset-interruption
Diagnoses GKE JobSet interruptions, restarts, and preemptions for AI/ML training workloads autonomously. Use when troubleshooting JobSet restart loops, spot VM preemptions, node readiness failures, host VM issues, or coordinator worker crashes. Don't use for general GKE cluster creation, basic workload deployment, or…