Captain Barbossa
Captain Barbossa launches a native agent CLI (Claude Code, Codex, or pi) as a captain inside a Herdr workspace. The captain recruits further native agents as crew in new Herdr panes or tabs, so a team of native agent sessions can work on the same checkout at once. There is no daemon, custom UI, or tmux layer: everything runs through Herdr, plus a small graph memory stored outside the repo and a curated repo scope committed with it.
Requirements
- macOS or Linux, Python 3.11+
- uv
- Herdr, as your terminal workspace
- Claude Code, Codex, and/or pi, installed and already signed in
Install
uv tool install captain-barbossa
If your shell cannot find captain afterward, run uv tool update-shell and
restart the terminal.
Upgrade
uv tool upgrade captain-barbossa
Running captains keep the old code until restarted with
captain --session <session-id>.
Quickstart
Run these in an interactive Herdr workspace:
captain --agent codex
# Ask the captain: "Recruit crew to review the current changes."
# Then ask: "Wait for Jack."
The captain stays in the current pane and recruits crew into the declared tab layout. You can ask it for every crew operation in plain language or run the commands below from a shell attached to the same session.
Restarting a captain
Find the id with captain session before you exit. Then exit the running
agent with /exit or Ctrl+D, and rerun:
captain --session <session-id>
Graph memory carries over; the chat transcript does not. You get a fresh
native conversation, not a provider transcript resume. Use captain session
to print the ID; --session ID selects it when restarting. See
memory.md
for what persists.
Starting a captain
Launch captain from an interactive terminal inside a Herdr workspace:
captain # asks: Claude Code, Codex, or pi?
captain --agent claude # Claude Code in this pane
captain --agent codex # Codex in this pane
captain --agent pi # pi in this pane
captain --prompt "Inspect this project"
--agent claude|codex|pi selects the native CLI, --prompt TEXT supplies its
first task, --session ID resumes Captain state, and --no-dashboard skips an
enabled dashboard for this launch.
It renames the current tab to Captain Barbossa and replaces itself with the chosen native CLI, so native input, history, permissions, and login all stay with that agent.
Outside a Herdr workspace, captain offers to bootstrap one instead of
failing. If Herdr is missing it asks before running Herdr's installer
(curl -fsSL https://herdr.dev/install.sh | sh); then it opens a Herdr
workspace at the project, starts captain there with the same --agent,
--session, and --prompt, and attaches your terminal to it. Declining, or
running non-interactively, leaves the old error untouched.
See settings.md for launch defaults and troubleshooting.md for launch failures.
Recruiting crew
captain crew opens a native agent in the same workspace and project, then
submits its task without stealing focus. NAME is optional; flags select the
agent, model, pane or tab, split target, and direction.
captain crew --task "Review the current changes"
captain crew Gibbs --task "Review the current changes" --agent claude --model mid
With no preferences, the captain uses its own CLI, automatic placement, and
the cheap tier. Only the captain recruits; captain-only commands are refused
for crew, which forward delegation requests back to it. See
crew-lifecycle.md
for naming, launch behavior, failure handling, and shared-checkout guardrails.
Placing crew
Automatic recruits fill [placement] captain_tab, then existing crew tabs,
then a new [placement] crew_tab. The declared arrays are columns whose
numbers are pane counts; crew fill breadth first.
captain crew Gibbs --task "Review UI" --placement pane \
--split-pane auto --direction vertical
--placement pane|tab, --split-pane ID|auto, and
--direction vertical|horizontal|auto override the grid for one recruit. See
placement.md
for slot order, split ratios, dismissal behavior, and validation.
Choosing models
--model accepts a provider-neutral tier, model ID, or alias:
| Tier | Claude Code | Codex |
|---|---|---|
cheap |
claude-haiku-4-5 | gpt-5.6-luna |
mid |
claude-sonnet-5 | gpt-5.6-sol |
strong |
claude-opus-5 | gpt-6-astra |
cheap is the default: omitting --model recruits a cheap crew rather
than falling through to whatever the native CLI is configured to use, so
routine work never silently lands on an expensive model. cheap covers
commits, tests, lint, formatting, docs, chores, renames, and mechanical
edits. mid is for a normal feature or a change inside one area, strong
for design, debugging, or multi-file and long-context work.
The captain is instructed not to step up just because a task feels ambiguous,
risky, or important: it steps up only when you ask for a stronger model, or
after a cheap crew has already failed or stalled. Retier a running crew in
place with captain model <name> mid|strong rather than recruiting high
up front.
Free text also works and is matched to the closest model the chosen CLI
offers (exact IDs and aliases first, then prefixes, substrings, and close
spellings): Claude Code additionally offers claude-fable-5-1 (fable);
Codex additionally offers gpt-5.6-terra (terra) and gpt-5.5. Ambiguous
or unknown text reports the options and creates nothing.
captain crew --task "Debug the failure" --model strong
See settings.md for retiering providers and setting model defaults.
Configuring defaults
Nothing is required. Project settings override global settings one key at a
time, and CLI flags win for one invocation. init writes a fully commented
template and never overwrites an existing file.
captain init
captain init --global
The only flag is --global; without it the command writes
<project>/.captain/settings.toml, otherwise ~/.captain/settings.toml. See
settings.md
for precedence, validation, and the complete key list.
Waiting for crew to finish
captain wait Jack
captain wait Jack --timeout 300
captain wait Jack --json --ack <delivery-id>
New crew use explicit assignments: wait reports activity, questions, approval
prompts, or completion; native idle alone does not mean the assignment is done.
Notifications repeat until acknowledged with --ack; --json returns a stable
envelope with status, delivery ID, crew, assignment ID, and summary.
--timeout SECONDS overrides the 900-second default. It follows native
lifecycle events, with pane-tail fallbacks documented in
crew-lifecycle.md.
Sending a follow-up
captain tell Jack "also update the changelog" --assignment <assignment-id>
tell appends to an active assignment while keeping the pane, model, and
conversation; it does not replace the original task. New assignments declare
owned paths with repeated --owns PATH and grants with repeated --allow ACTION.
Use ask/answer for a question, done --report for completion, and
assign --handoff to reuse a finished assignment's crew. Dismissed crew are refused.
assign, tell, and answer no longer type the message into the crew's
pane. Each writes a durable mail file, then rings a content-free doorbell in
the pane telling the crew to run captain inbox NAME; that read is what
proves delivery and writes the receipt. done refuses while mail is unread.
Newly launched crew may omit --assignment on ask, done, and check: their
launch-bound CAPTAIN_ASSIGNMENT is validated against crew identity, incarnation,
and the active assignment. Missing or stale context fails; captain calls and
replacement assignments still require explicit IDs. See
crew-lifecycle.md
for assignment and event-cursor behavior.
Checking crew status
captain status
captain status --all
status prints each crew's name, provider, model, pane, live status, and task.
--all includes dismissed crew. See
crew-lifecycle.md
for fallbacks and output details.
Watching crew token usage
captain dashboard
captain dashboard --interval 5
captain dashboard --refresh-prices
captain dashboard refreshes a plain-text table of the session's crew in the
current pane every 2 seconds by default (--interval SECONDS to change that).
Usage reads use cached prices; only --refresh-prices opts into a background
network refresh when the cache is missing or stale.
A captain can also open it for you: set [dashboard] enabled = true in
.captain/settings.toml and launching captain splits a second pane below
itself, titled Dashboard, running the same table. It is off by default;
captain --no-dashboard skips it for one launch even when it is enabled.
NAME AGENT STATUS CTX NOW CUM TOK CUM $ $/h 10m
CAPTAIN claude/opus-5 idle ..... 7% 2.70M $2.66 $1.84
Jack codex/gpt-5.6-terra idle #.... 11% 130k $0.07 $0.05
Will claude/haiku-4-5 idle ##... 31% 366k $0.09 $0.00
TOTAL - - - 6.30M $3.38 $1.89
TOTAL includes retired(1): 3.10M tok/$0.56; USD list est; rounded
The table distinguishes live context from cumulative tokens and list-price cost, keeps dismissed crew in totals, and marks unknown readings instead of inventing zeroes. See dashboard.md for every column, pricing and context sources, provider limits, totals, and responsive pane behavior.
Focusing crew
Tell the captain "focus on Jack", "switch to Will", or "take me to Elizabeth", or run the command directly:
captain focus Jack
Names are case-insensitive; crew IDs and Herdr agent names also work.
focus has no flags and never sends input or interrupts work. See
crew-lifecycle.md
for pane moves and name resolution.
Switching a running crew's model
Ask the captain to step a crew up or down a tier when its model stops fitting the work, or run the command directly:
captain model Jack strong
captain model Will cheap
The model argument accepts a tier, model ID, or alias. The command verifies the native CLI's confirmation and keeps the pane, conversation, and assignment. See crew-lifecycle.md for provider-specific effects and failure behavior.
Dismissing crew
captain dismiss Jack
dismiss has no flags. It permanently closes the pane, records the dismissal,
and permits name reuse with an explicit handoff; handle unreported or uncommitted work first.
Unread mail is bounced, not delivered, and the command reports which messages
bounced. See
crew-lifecycle.md
for dismissal and shared-checkout guardrails.
Inspecting files, state, and Git
captain inspect files src
captain inspect read README.md
captain inspect search "literal text" src
captain inspect state repo graph.json
captain inspect git diff --staged
inspect runs without Herdr lookup. Paths are literal and project-bounded;
state selects only session, project, or repo storage (crew: repo only).
Git operations are fixed: status, log, current-branch, root, and diff.
No shell, arbitrary flags, or external helpers are accepted. Results are JSON,
bounded to 64 KiB, 200 results, 10,000 entries, 8 MiB searched, and five seconds;
limits produce truncation markers or explicit errors. Filesystem deadlines are
cooperative. Git requires a trusted system installation and an ordinary stable
local checkout; linked worktrees, partial clones, alternates, and unsupported
config are refused. Git must be root-owned at /usr/bin/git on Linux or the
Command Line Tools installation on macOS; the macOS /usr/bin/git launcher is
not used. Reads accept regular UTF-8 text files; enumeration skips symlinks and
.git, and direct symlink reads fail. Native sandbox permissions still apply. See
crew-lifecycle.md for protocol and safety limits.
Memory
Captain stores session and project graph relationships outside the repository,
and a third repo scope committed with the code as .captain/graph.json.
add accepts --scope session|project|repo plus --because and --supersede
for repo scope; show accepts --scope, --all, and --json; path accepts
--scope session|project|repo; prune accepts
--older-than DAYS. query uses optional Graphify.
show and path do not create, migrate, lock, or rewrite memory; scoped JSON
reads only the selected scope.
captain memory add "rate limiter" "uses" "per-user windows"
captain memory add "test command" "is" "python -m unittest" --scope project
captain memory add "placement" decided "declared tab shapes" --scope repo \
--because "even ratios must survive a dismissal"
captain memory init --apply
captain memory show
captain memory show --scope repo
captain memory query "rate limiter"
captain memory path
captain memory prune --older-than 30
The default scope is session; project facts survive into future sessions. Repo
facts are shared with the team through version control, so the code fixes their
shape: an explicit --scope repo only, a relation from the closed set
decided|method|convention, a required --because rationale, deterministic
sorted bytes that re-add as a no-op, and --supersede to change one rather than
newest-wins. Nothing is committed for you.
captain memory init seeds that graph from the rules the project already
states, the counterpart of captain init writing .captain/settings.toml. It
reads AGENTS.md, else CLAUDE.md (--from PATH overrides), turns each bullet
under a Rules/Key facts section into one convention fact, and previews
them until you pass --apply. Re-running adds only what is new. See
memory.md
for paths, identity, retention, Graphify isolation, and pruning safeguards.
Running commands from another pane
These commands run inside the launched agent's environment. From a separate Herdr shell in the same project/workspace, pass the session explicitly:
captain --session <session-id> memory show
captain --session <session-id> crew --task "Check boundary cases"
captain --session <session-id> --agent codex
--session reuses the captain's graph memory; it starts a fresh native
conversation, not a provider transcript resume. See
memory.md
for session and project identity.
Troubleshooting
For install, TTY, crew startup, approval, model confirmation, session, memory-root, Graphify, and ambiguous-name failures, see troubleshooting.md.
herdr agent read Jack
Read the affected pane before retrying or approving anything.
Command reference
| Command | Purpose |
|---|---|
captain [--agent claude|codex|pi] [--prompt TEXT] [--no-dashboard] |
Start a captain in this pane |
captain crew [NAME] --task TEXT [--owns PATH] [--allow ACTION] [--handoff ID] [--agent ...] [--placement pane|tab] [--direction ...] [--split-pane ...] [--model ...] |
Recruit crew |
captain wait NAME [--timeout SECONDS] [--json] [--ack DELIVERY_ID] |
Read and acknowledge a crew notification |
captain model NAME cheap|mid|strong|<model> |
Switch a running crew's model |
captain tell NAME MESSAGE [--assignment ID] |
Append a follow-up to an active assignment |
captain inbox NAME |
Print a crew's queued mail oldest first and write the read receipt |
captain assign NAME --task TEXT --handoff ID [--owns PATH] [--allow ACTION] |
Start the next assignment after acknowledged completion |
captain ask NAME QUESTION [--assignment ID] |
Record one pending question; ID may default for newly launched crew |
captain answer NAME QUESTION_ID MESSAGE --assignment ID |
Answer that question |
captain done NAME [--assignment ID] --report TEXT |
Record explicit completion; ID may default for newly launched crew |
captain check NAME ACTION [PATH ...] [--assignment ID] |
Check grants; ID may default for newly launched crew; executes nothing |
captain resolve NAME MESSAGE_ID sent|cancelled --assignment ID |
Resolve uncertain prompt delivery after inspection |
captain inspect files|read|search|state|git ... |
Bounded local inspection |
captain status [--all] |
Print a table of this session's crew |
captain dashboard [--interval SECONDS] [--refresh-prices] |
Refresh a crew token-usage table; optionally refresh prices |
captain focus NAME |
Focus crew's pane and tab |
captain session |
Print the current session id |
captain init [--global] |
Write a commented .captain/settings.toml template |
captain dismiss NAME |
Close and retire crew |
captain memory add SUBJECT RELATION TARGET [--scope session|project|repo] [--because WHY] [--supersede] |
Save a memory relationship |
captain memory init [--from PATH] [--apply] |
Seed repo memory from the project rulebook |
captain memory query QUESTION |
Search memory with Graphify |
captain memory show [--scope SCOPE] [--json] [--all] |
Print memory relationships |
captain memory path [--scope session|project|repo] |
Print a scope's directory without creating it |
captain memory prune [--older-than DAYS] |
Remove finished sessions' memory |
captain --session ID ... |
Run any command against another shell's session |
captain --version |
Print the installed version |
All NAME arguments are case-insensitive and accept the crew's display
name, ID, or Herdr agent name.
Development
See CONTRIBUTING.md for setting up a checkout, running checks, and the commit/PR workflow. Current implementation scope is tracked in docs/plan.md.
Related CLIs: Herdr, Graphify, and Codex's additional instructions.
License
Licensed under MIT.
Metadata
Release files for captain-barbossa 0.22.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| captain_barbossa-0.22.1.tar.gz | 191.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| captain_barbossa-0.22.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 282.2 kB
Release files / captain_barbossa-0.22.1.tar.gz
| Download URL | captain_barbossa-0.22.1.tar.gz |
|---|---|
| Size | 191.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c882a7bb1adc044aa3f670a160287ad3024b011cef50137c5b598ad388ef5655
|
|
BLAKE2b-256 checksum How to use checksums |
ac7cf45abcbb2699d01c7810f0ac724172e22902f49904ab3f061fda62c667ff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / captain_barbossa-0.22.1-py3-none-any.whl
| Download URL | captain_barbossa-0.22.1-py3-none-any.whl |
|---|---|
| Size | 91.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
452aec00b33d4dc6d3a6daaa5accb93d460fba8c58ed81ee41d3b63a84552737
|
|
BLAKE2b-256 checksum How to use checksums |
be1ce5a1c98fb2d433588109f16ae62d104d553d3c62481c10f428ac141a2c9f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for captain-barbossa 0.22.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.