Hmbown/CodeWhale is an open-source coding agent that runs in the terminal and is written in Rust. Developers use it to inspect repositories, edit files, run commands, and coordinate work with configurable model providers, skills, MCP servers, and approval controls; the catalogue entries extend its available workflows.
Borrowing it
Nothing to install: this file belongs to Hmbown/CodeWhale. 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/Hmbown/CodeWhale/main/AGENTS.mdgit clone --depth 1 https://github.com/Hmbown/CodeWhaleWrote 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/instructions/hmbown/codewhale/agents-md)<a href="https://agentmods.dev/instructions/hmbown/codewhale/agents-md"><img src="https://agentmods.dev/badge/instructions/hmbown/codewhale/agents-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.
<a href="https://agentmods.dev/instructions/hmbown/codewhale/agents-md"><img src="https://agentmods.dev/badge/instructions/hmbown/codewhale/agents-md.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.03187 | $0.03187 |
| Opus 5.5 | $0.01275 | $0.01275 |
| Sonnet 5.5 | $0.00637 | $0.00637 |
| Haiku 4.5 | $0.00319 | $0.00319 |
Grade A, and why
Codewhale AGENTS.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 1mo 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.
How it starts
The opening of the file, as written. The whole thing — 241 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Codewhale agent guidance
Keep this file durable. Derive changing release, provider, branch, and flake
state from the repository, tests, CI, and current issue tracker rather than from
instructions or memory. The nearest scoped AGENTS.md adds path-specific rules.
The ponytail method
From dietrichgebert/ponytail — "the laziest senior dev in the room." He says nothing. He writes one line. It works. The best code is the code you never wrote.
Before writing code, walk the decision ladder in order and stop at the first rung that answers:
- Does this need to exist? → Skip it.
- Already in this codebase? → Reuse it.
- Stdlib does it? → Use it.
- Native platform feature? → Use it.
- Installed dependency? → Use it.
- One line? → One line.
- Only then: the minimum that works.
The ladder runs after understanding the problem. Lazy about solutions, never about reading the code first — a short diff written without reading the call sites is not ponytail, it is a guess.
Never cut, at any rung: trust-boundary validation, data-loss handling, security, accessibility. Brevity is not a reason to drop a guard.
Rung 2 is the one this repository keeps failing. The model_* / *_config /
provider_* grep rule below is rung 2 with a name; so is "one turn loop, one
base prompt". Two more corollaries earned here:
- An abstraction must delete caller code. If adopting it is pure obligation — required methods, no default bodies that do work — it gets built, adopted once, and abandoned.
- Migrate the last consumer, or do not start. Framework, one caller,
ticket the rest, silence the warning: that ships two systems and a comment
that is no longer true. If the migration will not fit, narrow the slice —
never the adoption. The standing
#[allow(dead_code)]count is the running receipt;scripts/check-dead-code-budget.pyprints it.
Working rules
- Inspect status and existing consumers before editing. Preserve unrelated, dirty, and untracked work.
- Before adding a module named
model_*,*_config,provider_*, or anything that "bridges", "mirrors", or "stages" an existing thing, grep for the existing thing and edit it. A new layer must name the predecessor it replaces in the module doc; otherwise edit the original. - Prefer the simplest implementation that preserves observable contracts. A rewrite is acceptable when justified by product intent and observed behavior, not as a shortcut around understanding existing code.
- Search for behavior and symbols before reviving work from an old branch. If a lane is obsolete, preserve its intent and evidence rather than merging stale code mechanically.
- A small coherent change may be committed directly to
mainwhen that checkout is current, clean, and owns the affected files. Default to the checkout that already exists: when several agents share it, partition by file, stage only the paths your slice touched, and retry a commit that fails onindex.lock. A fresh worktree is for conflicting, dirty, stale, or independent lanes (seecw-land), not for parallel agents on the same lane. Local commit permission never implies push, merge, tag, release, or deploy permission. - When the task is local-only, stay fully offline: no browsing, GitHub or remote Git operations, downloads, dependency installation, provider calls, or source/diff transmission. Record the missing external receipt and keep working locally.
- Public name is Codewhale. Compatibility identifiers such as
CodeWhale,codew, protocol names, and storage keys change only through an explicit migration. - Keep providers and models first-class and provider-neutral.
- Never rewrite published history, retag a release, force-push a shared ref, or publish without explicit authorization. Preserve human contributor credit.
- Model-visible means logged. Anything that reaches a model request must be reconstructable from the session log, and a new model-visible input needs a session event. Live presentation and the persisted record must agree; when they disagree the record is right.
- Misconfiguration fails loud, at load when it is self-contained, otherwise at the earliest point it can be resolved. Never silently skip a missing referent.
- Write down what a design does not do, beside the behaviour it owns — a short known-limitations note in the owning module. A stated limit stops the next reader from assuming a capability that was never built.
- Agents do not comment on issues or PRs (founder, 2026-09-22). Spend the time on code: evidence goes in the commit message and PR body, claims go in Linear. Do not reply to review bots or post status, "superseded", or "for the record" notes. The one exception is closing or superseding a human contributor's PR or issue: one sentence saying why, with the link. The PR and issue review workflows are disabled; re-enable one only by founder decision.
- A user feature lands with its registry row. A new command,
[features]flag, provider or user-visible feature adds or updates its row indocs/features.tomlin the same change;cargo test -p codewhale-tui --test feature_registryfails on flag drift. - Write
close/fix/resolve #Nonly when you mean it. GitHub closes the issue on merge even inside "does not close #N"; useRefs #Notherwise.
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.
- 1mo ago Changed · +4 lines · +68 tokens per session 736fc3cfe7d0
- 1mo ago Changed · -3 tokens per session 889c84a26d6c
- 1mo ago Changed · -23 lines · -335 tokens per session c3c1e815242a
- 1mo ago Changed · +4 lines · +57 tokens per session 72a47c7b7cce
- 1mo ago Changed · +13 lines · +202 tokens per session ba4521b57e7a
- 1mo ago Changed · +28 lines · +435 tokens per session 0c67189ac214
- 2mo ago Changed · +55 lines · +662 tokens per session bb6ef1ed9316
- 2mo ago First seen · 160 lines · 2,101 tokens per session scan A f2831867d8be
Codewhale AGENTS.md is an instructions file published in the GitHub repository Hmbown/CodeWhale (41,163 stars, last pushed 5d ago), licensed MIT. It adds 3,187 tokens to every session, about $0.0127 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.
Codewhale AGENTS.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| Codewhale AGENTS.mdHmbown/CodeWhale | Instructions file | 41k | 5d ago | MIT | A | 3,187 | Codex, OpenCode |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | today | MIT | A | 7,461 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 5,516 | GitHub Copilot |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | today | MIT | A | 4,680 | Codex, OpenCode |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 274k | 2d ago | MIT | A | 4,313 | Codex, OpenCode |