Skip to main content

Captain Barbossa

CI PyPI

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; crew 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

wait blocks until the crew is done, idle, or blocked and prints its report. --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"

tell has no flags. It prompts an existing crew in place while keeping its pane, model, and conversation; dismissed crew are refused. 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 refreshes a plain-text table of the session's crew in the current pane every 2 seconds by default (--interval SECONDS to change that).

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 frees the name for reuse; handle unreported or uncommitted work first. See crew-lifecycle.md for dismissal and shared-checkout guardrails.

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; prune accepts --older-than DAYS. query uses optional Graphify.

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 [--agent ...] [--placement pane|tab] [--direction ...] [--split-pane ...] [--model ...] Recruit crew
captain wait NAME [--timeout SECONDS] Wait for crew to finish
captain model NAME cheap|mid|strong|<model> Switch a running crew's model
captain tell NAME MESSAGE Send a follow-up prompt to crew
captain status [--all] Print a table of this session's crew
captain dashboard [--interval SECONDS] Refresh a crew token-usage table until interrupted
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 Print this session's memory directory
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.

Release files for captain-barbossa 0.20.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for captain-barbossa 0.20.1
File Size Uploaded
captain_barbossa-0.20.1.tar.gz 147.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for captain-barbossa 0.20.1
File Interpreter ABI Platform
captain_barbossa-0.20.1-py3-none-any.whl Python 3 none any Details

Total release size: 216.8 kB

Release files / captain_barbossa-0.20.1.tar.gz

Download URL captain_barbossa-0.20.1.tar.gz
Size 147.0 kB
Tags Source
SHA-256 checksum
How to use checksums
b4945f7054d15129a745bb574affc22b2ecbf03fdb84d8b56d7b593ef1d61944
BLAKE2b-256 checksum
How to use checksums
df76df8220ea7b1857455efe388d829bf16aefec5b0f459990ac092192831feb
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.20.1-py3-none-any.whl

Download URL captain_barbossa-0.20.1-py3-none-any.whl
Size 69.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
06366e5a2f553cbf776aceaaf685d629de54ada2fe2d19a8f64c6d81fbf9c499
BLAKE2b-256 checksum
How to use checksums
ad05a5028e577f41e6ddfc989b6d3f127559a4aa436748554e714114ccd55fea
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 history Release notifications | RSS feed

0.20.2

2 release files

This release

0.20.1 This release

2 release files

0.20.0

2 release files

0.19.0

2 release files

0.18.0

2 release files

0.17.1

2 release files

0.17.0

2 release files

0.16.1

2 release files

0.16.0

2 release files

0.15.3

2 release files

0.15.2

2 release files

0.15.1

2 release files

0.15.0

2 release files

0.14.0

2 release files

0.13.2

2 release files

0.13.1

2 release files

0.13.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page