Codewhale is an open-source coding agent that runs in the terminal and can read repositories, edit files, execute commands, and inspect results while pursuing a task. Developers use it with hosted providers or local models, with controls for how much access it receives.
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.
npx agentmods add skills/hmbown/codewhale/cw-slicenpx skills add Hmbown/Codewhale --skill cw-slicegit 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/skills/hmbown/codewhale/cw-slice)<a href="https://agentmods.dev/skills/hmbown/codewhale/cw-slice"><img src="https://agentmods.dev/badge/skills/hmbown/codewhale/cw-slice.svg" alt="Measured on agentmods" 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.00047 | $0.01638 |
| Opus 5 | $0.00023 | $0.00819 |
| Sonnet 5 | $0.00009 | $0.00328 |
| Haiku 4.5 | $0.00005 | $0.00164 |
Grade A, and why
cw-slice 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.
How it starts
The opening of the file, as written. The whole thing — 123 lines — stays where its author put it; the contents beside it link to each section on GitHub.
cw-slice
The expensive mistake in this repo is not a bad implementation — it is a second
implementation. A new model_*, *_config, provider_*, or "bridge" module
beside the one that already does the job ships two systems and a comment that is
no longer true. This skill is the ponytail ladder's rung 2 with commands
attached: find the thing that already exists, then edit it.
Stage 2 of the loop: cw-orient → slice → cw-gates → cw-dogfood → cw-land → cw-handoff.
When to use
- Any feature, upgrade, refactor, or "make X work like Y" request.
- Before creating a new module, trait, config struct, or command.
- When a plan or issue tells you to build something and you have not yet confirmed it does not already exist.
Workflow
-
Walk the ladder, out loud, before opening an editor. Stop at the first rung that answers, and say which one you stopped at:
- 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 reading the code, never instead of it. A short diff written without reading the call sites is a guess, not a small change.
-
Grep for the predecessor. This is the step that gets skipped and the one that costs the most:
grep -rn "<the concept, in the words the code would use>" crates --include='*.rs' | head -40 ls crates grep -rln 'model_\|_config\|provider_' crates/*/src --include='*.rs' | head -30Search behavior and symbols, not just filenames. If you find an owner, edit it. If you are still adding a new layer, its module doc must name the predecessor it replaces — otherwise you are editing the wrong file.
-
Check the contracts you are about to walk into. These are the ones this repo actively guards, and a guard test fails if you duplicate them:
- One turn loop:
crates/tui/src/core/engine/turn_loop.rs, guarded bycrates/core/tests/single_turn_loop.rs. Do not add a second. - One base prompt:
BASE_PROMPTincrates/tui/src/prompts/text.rs. - The subagent tool is
agent. Do not reviveagent_open/agent_eval/agent_close/delegate_to_agent. - The system prompt + tool catalog are a session-pinned KV-cache prefix
(
docs/CACHE.md). Any new session-context contributor must state its cache effect — frozen prefix vs. append-only history. Never splice a volatile fact into the prefix. crates/tui/src/core/is a module inside the TUI crate.crates/coreis a different crate that runs no turns. Do not confuse them.- Repeatedly misidentified as dead, verify consumers before removing:
tui/src/context_budget.rs,tui/src/model_registry.rs,tui/src/prompt_zones.rs,tui/src/tools/remember.rs,config/src/route/.
- One turn loop:
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.
- today First seen · 123 lines · 47 tokens per session scan A e4c6d479d5d1
cw-slice is a skill published in the GitHub repository Hmbown/Codewhale (40,916 stars, last pushed today), licensed MIT. It adds 47 tokens to every session and 1,638 once invoked, about $0.0002 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-09-06.
Other skills, from other repositories
contributor-onboarding
Help a new contributor get productive on this checkout - inspect sync state against main, build, run the repository's exact verification gate, and produce a local what's-new digest. Never fetches, pulls, or modifies a dirty tree on its own. Explicit-only.
codew-release-qa-sweep
Use before claiming Codewhale release work is done: run the full gate sweep and list the manual QA targets.
gh-find-prs
Survey open Codewhale PRs and triage each for mergeability and disposition against the real landing branch.
best-of-n
Generate a small set of independent candidate solutions in worktrees, judge them against one explicit rubric, and apply the winner only after PASS verification.
fleet-manager
Use when managing, triaging, restarting, escalating, or summarizing Codewhale fleet runs and workers.
handoff
Write a compact, decision-ready handoff so the next session (or the user) can continue without reconstructing the current one. Use when the session is ending, context is running low, the user asks for a handoff / "pass the baton" / "hand off", or a long-running operation needs a durable state checkpoint.