CodeWhale: Instructions file for Codex

AGENTS.md

Codewhale AGENTS.md is an instructions file for Codex, OpenCode from Hmbown/CodeWhale. It costs 3,187 tokens per session, scanned A, original, MIT.

A set of instructions for Claude Code in the CodeWhale repository, covering how to inspect existing work, make changes, handle branches, and verify claims about tests.

In plain words
What is it for?
Use it when changing CodeWhale code, especially when deciding whether to edit an existing module, revive older work, commit on the main branch, or report that a test passed.
Why use it?
It helps the agent follow the repository's working rules, preserve unrelated changes, avoid duplicate code, and rely on current project evidence.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions subagents; mentions AGENTS.md; built for codewhale.

This is Hmbown/CodeWhale's own configuration. It tells Codex and OpenCode how to work on CodeWhale 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 CodeWhale configures →

About the project

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.

Hmbown/CodeWhale · 41,163 stars · on GitHub · codewhale.net

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/Hmbown/CodeWhale/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/Hmbown/CodeWhale

Made for: Codex, OpenCode.

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 Codewhale AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/hmbown/codewhale/agents-md/github.svg)](https://agentmods.dev/instructions/hmbown/codewhale/agents-md)
Your own site
<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.

agentmods 80×15 button for Codewhale AGENTS.md

Your own site · 80×15
<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>
Per session 3,187 This file is loaded in full into every session.
When invoked 3,187 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.03187 $0.03187
Opus 5.5 $0.01275 $0.01275
Sonnet 5.5 $0.00637 $0.00637
Haiku 4.5 $0.00319 $0.00319

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

Security

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.

AGENTS.md · 241 lines

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:

  1. Does this need to exist? → Skip it.
  2. Already in this codebase? → Reuse it.
  3. Stdlib does it? → Use it.
  4. Native platform feature? → Use it.
  5. Installed dependency? → Use it.
  6. One line? → One line.
  7. 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.py prints 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 main when 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 on index.lock. A fresh worktree is for conflicting, dirty, stale, or independent lanes (see cw-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 in docs/features.toml in the same change; cargo test -p codewhale-tui --test feature_registry fails on flag drift.
  • Write close/fix/resolve #N only when you mean it. GitHub closes the issue on merge even inside "does not close #N"; use Refs #N otherwise.

Read the full file on GitHub · 241 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. 1mo ago Changed · +4 lines · +68 tokens per session 736fc3cfe7d0
  2. 1mo ago Changed · -3 tokens per session 889c84a26d6c
  3. 1mo ago Changed · -23 lines · -335 tokens per session c3c1e815242a
  4. 1mo ago Changed · +4 lines · +57 tokens per session 72a47c7b7cce
  5. 1mo ago Changed · +13 lines · +202 tokens per session ba4521b57e7a
  6. 1mo ago Changed · +28 lines · +435 tokens per session 0c67189ac214
  7. 2mo ago Changed · +55 lines · +662 tokens per session bb6ef1ed9316
  8. 2mo ago First seen · 160 lines · 2,101 tokens per session scan A f2831867d8be

Subscribe to this mod's changes

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.

Related

Codewhale AGENTS.md compared with instructions from other repositories

Codewhale AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
Codewhale AGENTS.mdHmbown/CodeWhaleInstructions file41k5d agoMITA3,187Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,516GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode