CodeWhale AGENTS.md

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

▶ DeepSeek TUI | CodeWhale: Free Claude Code Alternative Built in Rust (Full Install & Demo) AI BrainBox · about CodeWhale AGENTS.md · on YouTube →
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/hmbown/codewhale/agents-md
Clone the repo
git clone --depth 1 https://github.com/Hmbown/CodeWhale

Made for: Codex, OpenCode.

Per session 2,763 This file is loaded in full into every session.
When invoked 2,763 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.02763 $0.02763
Opus 5 $0.01381 $0.01381
Sonnet 5 $0.00553 $0.00553
Haiku 4.5 $0.00276 $0.00276

Measured today against content hash bb6ef1ed9316, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 today.

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 · 215 lines

How it starts

The opening of the file, as written. The whole thing — 215 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. A worktree remains the right safety boundary for conflicting, dirty, stale, or independent work. 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.

Read the full file on GitHub · 215 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. today Changed · +55 lines · +662 tokens per session bb6ef1ed9316
  2. 3d 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 (40,889 stars, last pushed today), licensed MIT. It adds 2,763 tokens to every session, about $0.0138 per session on Opus 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.