fleet-commander: Instructions file for Claude Code

CLAUDE.md

fleet-commander CLAUDE.md is an instructions file for Claude Code from MrBenJ/fleet-commander. It costs 2,884 tokens per session, scanned A, original, MIT.

Repository instructions for Fleet Commander, a Go and React tool that manages several AI coding sessions in separate Git worktrees. A Git worktree is an additional working copy of a repository.

In plain words
What is it for?
Use them when working on Fleet Commander to build its Go binary or web interface, run tests, install it, or understand its tmux and worktree setup.
Why use it?
They record the commands and project rules needed to build, run, test, and install the tool correctly.

Instructions file for Claude Code

Written for Claude Code: PreToolUse hook event. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions Claude Code.

This is MrBenJ/fleet-commander's own configuration. It tells Claude Code how to work on fleet-commander itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything fleet-commander configures →

Reuse

Borrowing it

Nothing to install: this file belongs to MrBenJ/fleet-commander. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/MrBenJ/fleet-commander/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/MrBenJ/fleet-commander

Made for: Claude Code.

Wrote 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.

agentmods badge for fleet-commander CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/mrbenj/fleet-commander/claude-md/github.svg)](https://agentmods.dev/instructions/mrbenj/fleet-commander/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/mrbenj/fleet-commander/claude-md"><img src="https://agentmods.dev/badge/instructions/mrbenj/fleet-commander/claude-md/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.

agentmods 80×15 button for fleet-commander CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/mrbenj/fleet-commander/claude-md"><img src="https://agentmods.dev/badge/instructions/mrbenj/fleet-commander/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,884 This file is loaded in full into every session.
When invoked 2,884 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.02884 $0.02884
Opus 5.5 $0.01154 $0.01154
Sonnet 5.5 $0.00577 $0.00577
Haiku 4.5 $0.00288 $0.00288

Measured 2mo ago against content hash cdb1598a8443, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

fleet-commander CLAUDE.md 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 2mo ago.

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.

CLAUDE.md · 133 lines

How it starts

The opening of the file, as written. The whole thing — 133 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

For agent-neutral guidance (self-contained), see AGENTS.md. Keep both files in sync when architecture changes.

Build & Run

# Build the binary
go build -o fleet ./cmd/fleet/

# Run directly without building
go run ./cmd/fleet/ <command>

# Install to PATH
go install ./cmd/fleet/

# Run tests
go test ./...

# Run a single package's tests
go test ./internal/monitor/...

# Build web UI + Go binary with embedded SPA (installs to PATH)
make build-all

# Build web UI only
make build-web

# Run web tests
cd web && npm run test

The binary must be placed alongside fleet.tmux.conf for the tmux config to be auto-sourced (it looks for the conf file relative to the executable path).

Tech stack: Go 1.21+ (backend), React 18 + TypeScript + Vite (frontend), tmux (session management), git worktrees (isolation).

Architecture

Fleet Commander is a CLI + TUI tool for managing parallel AI coding agent sessions, each in its own git worktree. The user stays in control — there is no AI coordinator.

Data model:

  • Fleet — owns RepoPath, ShortName, and a list of Agents. Persisted at .fleet/config.json inside the managed repo.
  • Agent — Name (unique, used as tmux session: fleet-<Name>), Branch, WorktreePath, Driver (one of claude-code, codex, aider, kimi-code, antigravity, generic), StateFile, optional Persona, FightMode bool.
  • Global index: ~/.fleet/repos.json tracks all registered repos for cross-repo commands (fleet queue --all).

Package layout:

  • cmd/fleet/ — Cobra CLI wiring split across main.go, cmd_agents.go, cmd_context.go, cmd_launch.go, cmd_repos.go, cmd_utils.go. Commands: init, add, list, start, attach, stop, queue, remove, hint, hangar, context, repos, launch, signal, unlock, rename, clear.
  • cmd/fleet/embed.go — go:embed all:webdist directive for the compiled React SPA (cmd/fleet/webdist/).
  • internal/fleet/ — Core data model. Fleet and Agent structs, JSON config persistence at .fleet/config.json. Load() walks up the directory tree to find a fleet.
  • internal/global/ — Global cross-repo state at ~/.fleet/ (repos index, global context/log).
  • internal/tmux/ — Thin wrapper around tmux CLI commands. Sessions are named fleet-<agentName>. Sources fleet.tmux.conf after creating a session (best-effort).
  • internal/monitor/ — Reads tmux pane content via capture-pane and classifies agent state as working, waiting, stopped, or starting. State detection inspects only the bottom 15 lines and checks for Claude Code-specific patterns: "esc to interrupt", spinner characters, "Esc to cancel", ❯ prompt, etc.
  • internal/tui/ — Bubble Tea TUI for fleet queue. Lists all agents with live state indicators, refreshes every 2 seconds. Selecting an agent starts its session if stopped, then attaches. After detaching (Ctrl+B, Q), the TUI loop restarts automatically.
  • internal/worktree/ — Git worktree CRUD: Create, CreateFromExisting, Remove, List, Move, Exists. Manager.Create(path, branch) runs git worktree add -b <branch> <path>.
  • internal/context/ — Shared context store (.fleet/context.json). Agents can publish and read context from each other. Uses POSIX advisory file locks (flock) on .fleet/context.lock with a 5-second timeout. Supports named private channels with fixed membership (names are used as-is; an empty name defaults to channel-default).
  • internal/state/ — State file read/write for agent state signaling between Claude Code hooks and the monitor. Atomic writes via temp-file + rename. States live in .fleet/states/<name>.json. IsStale(ttl) helper for fallback-detection.
  • internal/hooks/ — Claude Code hook injection/removal. Injects fleet signal working (PreToolUse) and fleet signal waiting (Stop) into .claude/settings.json in each worktree. Entries are tagged with "_fleet": true for safe removal. Hooks read FLEET_STATE_FILE and FLEET_AGENT_NAME env vars.
  • internal/hangar/ — Web-based squadron mission control (fleet hangar). Go HTTP server + embedded React SPA.
    • internal/hangar/server.go — HTTP server, route registration, SPA serving (embedded or Vite dev proxy).
    • internal/hangar/tui.go — Bubble Tea TUI shown in the terminal while the server runs (zen/log views).
    • internal/hangar/api/ — REST handlers for fleet info, personas, drivers, squadron launch, agent generation, and stop.
    • internal/hangar/ws/ — WebSocket hub that polls .fleet/context.json every 2s and broadcasts new channel messages and agent state changes.
    • internal/hangar/terminal/ — WebSocket-to-PTY proxy for tmux attach-session, powers the browser terminal.
  • internal/driver/ — Driver interface and implementations (claude-code, codex, aider, kimi-code, antigravity, generic). Each driver implements state detection, hook injection (where supported), and command building.
  • internal/squadron/ — Squadron launch logic. RunHeadless() creates worktrees, tmux sessions, context channels, and prompt files. BuildMergerSuffix(), BuildConsensusSuffix(), ApplyPersona(), and fight-mode suffix assembly live here.
  • web/ — React 18 + TypeScript + Vite SPA for the hangar UI. Built with make build-web, embedded into the Go binary via make build-all.
    • web/src/components/wizard/ — Squadron setup wizard (SetupStep → AgentsStep → ReviewStep, with PersonaStep as a per-agent modal from AgentsStep).
    • web/src/components/mission/ — Mission control view (MissionControl, ContextLog, AgentPill, AgentTooltip, MultiView).
    • web/src/components/terminal/ — xterm.js terminal page for "Assume Control".
    • web/src/hooks/ — useWebSocket (auto-reconnect JSON event stream), useFleet (fleet data fetching).
    • web/src/api.ts — Typed API client for all REST endpoints.

Read the full file on GitHub · 133 lines

Changes

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.

  1. 2mo ago First seen · 133 lines · 2,884 tokens per session scan A cdb1598a8443

Subscribe to this mod's changes

fleet-commander CLAUDE.md is an instructions file published in the GitHub repository MrBenJ/fleet-commander (11 stars, last pushed 3mo ago), licensed MIT. It adds 2,884 tokens to every session, about $0.0115 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-08-30.

Related

fleet-commander CLAUDE.md compared with instructions from other repositories

fleet-commander CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
fleet-commander CLAUDE.mdMrBenJ/fleet-commanderInstructions file113mo agoMITA2,884Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode