cw-slice

cw-slice is a skill for Claude Code, Codex from Hmbown/Codewhale. It costs 47 tokens per session (1,591 once invoked), scanned A, original, MIT.

A planning guide for finding the existing owner of a behavior before writing code and limiting work to one reviewable slice. It favors reusing existing modules, libraries, and platform features over creating duplicates.

In plain words
What is it for?
Use it before a feature, upgrade, refactor, or new module, especially when the requested behavior may already exist.
Why use it?
It reduces duplicate implementations and overly broad changes. The codebase is checked first so the agent changes the right place and defines how the result will be verified.

Skill for Claude CodeCodex

Which agent this was written for is unclear — built for codewhale. Also seen: mentions subagents; mentions AGENTS.md; built for codewhale.

Good fit Use it before a feature, upgrade, refactor, or new module, especially when the requested behavior may already exist.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hmbown/codewhale/cw-slice
About the project

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.

Hmbown/Codewhale · 41,035 stars · on GitHub · codewhale.net

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.

Any agent
npx skills add Hmbown/Codewhale --skill cw-slice
Clone the repo
git clone --depth 1 https://github.com/Hmbown/Codewhale

Made for: Claude Code, Codex.

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 cw-slice

README.md
[![agentmods](https://agentmods.dev/badge/skills/hmbown/codewhale/cw-slice/github.svg)](https://agentmods.dev/skills/hmbown/codewhale/cw-slice)
Your own site
<a href="https://agentmods.dev/skills/hmbown/codewhale/cw-slice"><img src="https://agentmods.dev/badge/skills/hmbown/codewhale/cw-slice/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 cw-slice

Your own site · 80×15
<a href="https://agentmods.dev/skills/hmbown/codewhale/cw-slice"><img src="https://agentmods.dev/badge/skills/hmbown/codewhale/cw-slice.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 47 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,591 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. ✓ AI security review Sonnet 5 · 6 Sept 2026 📄 Read the review Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00047 $0.01591
Opus 5.5 $0.00019 $0.00636
Sonnet 5.5 $0.00009 $0.00318
Haiku 4.5 $0.00005 $0.00159

Measured 24d ago against content hash e1cb83a3f11f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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 24d 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.

docs/skills/cw-slice/SKILL.md · 118 lines

How it starts

The opening of the file, as written. The whole thing — 118 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

  1. Walk the ladder before opening an editor (AGENTS.md, "The ponytail method" — not restated here, since a second copy is what rung 2 forbids). Stop at the first rung that answers. 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. State the rung only when the choice isn't obvious from the diff itself.

  2. 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 -30
    

    Search 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.

  3. Check the contracts you are about to walk into. One of these is guard-tested, the rest are convention — either way, move them with their code, not around it:

    • One turn loop: crates/tui/src/core/engine/turn_loop.rs, guarded by crates/core/tests/single_turn_loop.rs. A second loop fails the guard; changing the shape means changing the guard with it.
    • One base prompt: BASE_PROMPT in crates/tui/src/prompts/text.rs.
    • The subagent tool is agent; agent_open / agent_eval / agent_close / delegate_to_agent are removed surfaces. If the shape must move, move the code and add the guard test that judges the new shape — the convention is not a fence around the area.
    • 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/core is a different crate that runs no turns. Do not confuse them.
    • Repeatedly misidentified as dead, verify consumers before removing: runtime/src/context_budget.rs, tui/src/model_registry.rs, runtime/src/prompt_zones.rs, tui/src/tools/remember.rs, config/src/route/.

Read the full file on GitHub · 118 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. 24d ago Changed e1cb83a3f11f
  2. 27d ago Changed · -13 lines 1f16b6bdeeea
  3. 1mo ago Changed · +8 lines ecc2e7a1e09f
  4. 1mo ago Changed 36539725c9a6
  5. 1mo ago First seen · 123 lines · 47 tokens per session scan A e4c6d479d5d1

Subscribe to this mod's changes

cw-slice is a skill published in the GitHub repository Hmbown/Codewhale (41,035 stars, last pushed 18d ago), licensed MIT. It adds 47 tokens to every session and 1,591 once invoked, about $0.0002 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-09-06.