Badger Quickstart
chimera badger Quickstart
Section titled “chimera badger Quickstart”chimera badger is the seventh Chimera coding-agent CLI. Where
chimera mink ships a TUI-first ergonomic and
chimera ferret ships an IDE-first sandboxed
posture, badger ships a harness-rewrite posture: tighter step budget
(--max-steps 25), rerun-on-failure discipline as a first-class concern,
a parity-tracker subcommand that diffs the live surface against a schema
file, and the largest slash palette of any Chimera coding CLI (28
commands including the full /git family, /memory, /bughunter,
/ultraplan, and /teleport).
Deeper dives:
harness-discipline.md— why max-steps=25.rerun-on-failure.md— failure markers, budgets.parity.md— declare a schema and diff live.providers.md— Anthropic-first chain.parity-matrix.md— surface vs sibling CLIs.
Prerequisites
Section titled “Prerequisites”- Python 3.11+
uv- One of: an Anthropic key, an OpenAI key, an OpenRouter key, or an
Ollama account (
OLLAMA_API_KEYfor:cloudtags)
uv --version # >= 0.4uv sync --extra dev --extra anthropic # core + Anthropic SDKProvider configuration
Section titled “Provider configuration”Badger resolves the provider in this order (first match wins):
--model <id>on the CLI.$BADGER_MODELenvironment variable.$ANTHROPIC_API_KEY→ defaults toclaude-sonnet-4-6.$OPENAI_API_KEY→ defaults togpt-4o.$OPENROUTER_API_KEY→ defaults toanthropic/claude-sonnet-4.$OLLAMA_API_KEY→ defaults togpt-oss:120b-cloud.- A reachable Ollama daemon on
:11434→ first installed tag.
export ANTHROPIC_API_KEY=sk-ant-...# ORexport OLLAMA_API_KEY=<your-key>export OLLAMA_HOST=https://ollama.comFirst one-shot turn
Section titled “First one-shot turn”chimera badger -p "list the top-level files and read the README"Expected output shape (truncated):
I'll list the repo first, then read the README.
▶ list_files(path=".")CHANGELOG.md CLAUDE.md README.md chimera/ docs/ examples/ tests/
▶ Read(path="README.md")# ChimeraA composable coding agent framework...
The repo root has a README pitching Chimera as a composable coding agent framework.Useful one-shot flags:
chimera badger --model gpt-oss:120b-cloud -p "draft a release note"chimera badger --output-format json -p "ship it"chimera badger --max-steps 10 -p "summarize"chimera badger --allowed-tools Read,Bash -p "audit"chimera badger --no-save -p "ad-hoc, don't journal"chimera badger --no-color -p "..." | tee badger.logDrop into the REPL
Section titled “Drop into the REPL”Run chimera badger with no -p flag for the interactive REPL:
badger — Chimera coding agent (harness-rewrite posture)model: claude-sonnet-4-6 · max-steps: 25 · cwd: /Users/me/projType /help for commands, /exit to quit.badger> /toolsRead, Write, Edit, Bash, Grep, Glob, TodoWrite, list_files, ...badger> /git status## master...origin/master M chimera/badger/repl.pybadger> /teleport build_provider/teleport: 1 result(s) for 'build_provider' chimera/badger/providers.py:18 def build_provider(...) -> Provider:badger> refactor providers.py to extract the env-resolution helper…Harness-first defaults
Section titled “Harness-first defaults”| Knob | Badger | Other CLIs |
|---|---|---|
--max-steps | 25 | 50 (mink/otter) |
| Rerun-on-failure | opt-in (--rerun-on-failure, ≤ 2 reruns) | not exposed |
| Permission mode | suggest (5-mode standard) | varies |
--rerun-on-failure walkthrough
Section titled “--rerun-on-failure walkthrough”When the agent’s first attempt shows a failure marker (pytest failed,
mypy errored, a syntax error in a written file), badger resets the
conversation, refines the prompt with the captured failure, and runs
again — up to --max-reruns extra attempts. Total ≤ 1 + --max-reruns.
# Default budget — one rerun on a failure marker.chimera badger --rerun-on-failure \ -p "fix the failing test in tests/test_util.py"
# Wider budget — three reruns.chimera badger --rerun-on-failure --max-reruns 3 \ -p "regenerate broken type hints across chimera/core/"Inside the REPL the same knob is a slash command:
badger> /rerun/rerun: rerun_on_failure=False max_reruns=2badger> /rerun 3/rerun: enabled, max_reruns=3badger> /rerun off/rerun: disabled--profile usage
Section titled “--profile usage”Discipline presets bundle the common knob combinations:
| Profile | --max-steps | Permissions | Rerun |
|---|---|---|---|
strict | 15 | strict (ask every tool call) | off |
balanced | 25 | suggest (ask for writes + shell) | on (1) |
yolo | 50 | yolo (no asks) | on (3) |
chimera badger --profile strict -p "explain the OAuth flow"chimera badger --profile balanced -p "fix this failing test"chimera badger --profile yolo -p "ship it"Profiles always lose to explicit flags.
Parity tracking
Section titled “Parity tracking”chimera badger parity diffs the live CLI surface against a schema
file. Catches drift between an intended surface (declared in
PARITY.md or PARITY.json) and the shipped one.
chimera badger parity # auto-resolvechimera badger parity --against docs/badger/PARITY.md # explicit pathSample output:
PARITY REPORT (schema: PARITY.md)────────────────────────────────────flags ✓ 21 / 21 presentslashes ✓ 28 / 28 presentsubcommands ⚠ 3 / 4 present (missing: bench)exit codes ✓ 4 / 4 documented────────────────────────────────────verdict: 1 drift, see lines aboveInside the REPL the same check is wired as /parity.
Slash commands
Section titled “Slash commands”The non-trivial palette entries, grouped by purpose:
/git family — six native wrappers (added W14-4)
badger> /git status## master...origin/master M chimera/badger/repl.py
badger> /git log 38df78c3 docs(teams): refresh agent-teams.md8b65604 docs(ollama,inspirations): document Path A2234c91 fix(shrew,stoat): respect OLLAMA_HOST
badger> /git commit -m "wire BADGER_MODEL fallback"[master 4a3b1d2] wire BADGER_MODEL fallback/memory — per-CLI scratch notes at ~/.chimera/badger/memory.md
badger> /memory edit/memory: edited /Users/me/.chimera/badger/memory.mdbadger> /memory append "Investigate rerun budget overflow #214"/memory: appended to /Users/me/.chimera/badger/memory.md/bughunter — queue a multi-perspective bug-hunt prompt
badger> /bughunter chimera/core//bughunter: queued bug-hunt workflow (487 chars)/ultraplan — five-phase planning prompt (no edits this turn)
badger> /ultraplan migrate auth from session-cookies to JWT/ultraplan: queued five-phase plan for 'migrate auth from session-cookies to JWT'/teleport — symbol/path resolver (Python, JS/TS, Rust)
badger> /teleport build_provider/teleport: 1 result(s) for 'build_provider' chimera/badger/providers.py:18 def build_provider(... ) -> Provider:Type /help at any prompt for the full 28-entry list.
Sessions / persistence
Section titled “Sessions / persistence”chimera badger sessions listchimera badger sessions list --all-clis # include otter/ferret/weasel/...chimera badger sessions show badger-20260514T091201-71032a5echimera badger share badger-20260514T091201-71032a5eChoose your model
Section titled “Choose your model”Recommended models for the harness-rewrite posture (frequent tool calls, rerun-loop stability):
| Backend | Tag | Why for badger |
|---|---|---|
| Anthropic | claude-sonnet-4-6 | Strongest tool calling; default. |
| Ollama Cloud | gpt-oss:120b-cloud | Free with Ollama account; native tools. |
| Ollama Cloud | kimi-k2.6:cloud | 256k context; preserves reasoning between reruns. |
| OpenAI | gpt-4o | Strong baseline; $OPENAI_API_KEY. |
See the Ollama Cloud recipe for the auth handshake.
OLLAMA_HOST=https://ollama.com OLLAMA_API_KEY=$KEY \chimera badger --model gpt-oss:120b-cloud -p "audit list of files"Real task: rerun a failing test until it passes
Section titled “Real task: rerun a failing test until it passes”chimera badger --profile balanced \ --rerun-on-failure --max-reruns 2 \ -p "fix tests/test_util.py::test_format_currency"Expected shape:
[badger] attempt 1/3▶ Bash$ uv run pytest tests/test_util.py::test_format_currency -xFAILED AssertionError: expected '$1,234.56', got '$1234.56'
I see — the formatter is missing the comma. Patching util.py…▶ Edit(file=src/util.py, …)▶ Bash$ uv run pytest tests/test_util.py::test_format_currency -xPASSED 1 passed in 0.04s
[badger] attempt 1 succeeded. Stop.If the first attempt fails, badger fires a fresh conversation with the captured failure as context. Compare with mink, where you’d drive the recovery manually.
Env vars at a glance
Section titled “Env vars at a glance”| Variable | Default | Meaning |
|---|---|---|
BADGER_MODEL | (unset) | Default model id. |
ANTHROPIC_API_KEY | (unset) | Anthropic provider chain. |
OPENAI_API_KEY | (unset) | OpenAI provider chain. |
OLLAMA_API_KEY | (unset) | Ollama Cloud :cloud tags. |
OLLAMA_HOST | http://localhost:11434 | Daemon URL. |
CHIMERA_HOME | ~/.chimera | Root for eventlog, exports, memory. |
NO_COLOR | (unset) | Plain output handler. |
Where to go next
Section titled “Where to go next”Verified (2026-05-14)
Section titled “Verified (2026-05-14)”Two commands from this quickstart, against Ollama Cloud
(gpt-oss:120b-cloud):
$ OLLAMA_HOST=https://ollama.com OLLAMA_API_KEY=*** \ chimera badger --model gpt-oss:120b-cloud \ -p "what is 2 plus 2" --max-steps 3 --no-color --no-save2 + 2 = 4.
$ chimera badger sessions listSESSION_ID DATE MODEL STEPS COST OK PROMPT(no persisted badger sessions found)
$ chimera badger --versionchimera badger 0.7.0