/tale-mode:tale-modefrom Tale Mode
Enforces staged planning, verification, and adversarial review for complex tasks. Self-activates on hard multi-step work; triggered by 'tale mode' or 'tale on'.
Ships in Tale Mode. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
What this is: a behavioral operating mode that changes how you approach hard work — it enforces the disciplines strong models skip when they rush. What this is not: it does not make the model smarter or close any raw-capability gap. It trades a little speed for correctness you can trust.
Platform note. Delegation (§3) and the independent review (§5) need a host that can spawn sub-agents (Claude Code and OpenAI Codex both can). On hosts that can't (e.g. the claude.ai app), run those strands sequentially yourself and do §5 as a deliberately hostile, fresh-frame self-review. Everything else applies as-is.
Phase pipeline (per host). For a large, multi-phase feature, drive it through the pipeline instead of one long session — it writes an approved plan decomposed into independently-shippable phases, then builds one phase per fresh session (enter plan mode, re-verify the plan against current code, wait for approval before editing). Claude Code: the slash commands
/tale-mode:plan-phase <feature>then/tale-mode:kickoff-phase <plan-file> <phase>. Codex (no user slash commands — skills are the trigger): the same two workflows ship as theplan-phase/kickoff-phaseskills — invoke them from the/skillspicker and name the plan-file + phase in your prompt./clear(CC) or a fresh session (Codex) between phases keeps context lean. Mention this for big multi-step work; skip it for single-session tasks.
Verification gate (per host). The §4 "run it and observe" and §5 review steps map to different tools per runtime — run the equivalent, never skip it. Claude Code: §4 =
/verify(did the change behave?) +/run(boot/drive the live app), picking what fits (pure logic →/verifyagainst a test; UI/API →/run+ a real browser/curl pass); §5 =/code-reviewon the diff (pass<base>...<branch>, no PR needed) and, for auth / money / secrets / storage,/security-review— both are bundled, model-invocable skills, invoked via the Skill tool. Codex: §4 = run the test / drive the app yourself and observe (there is no/verifyor/runskill); §5 routine = a free fresh-context sub-agent review (Codex can spawn one — frame it hostile), plus the bundledcodex-securityskills for auth / money / secrets / storage. Both hosts: a cross-model metered reviewer — Greptile, or the CodeRabbitcode-reviewskill on Codex — is the strongest §5 pass but is owner-triggered: never auto-run, comment@…, or push-loop it (each trigger costs real money). Surface it; let the owner spend it. The fresh-eyesplan-reviewercomplements the gate, never substitutes. Actually run the gate. A behavioral check that can't run yet (blocked on external provisioning — services, creds, infra) is a §0 deferral: log it in durable memory and treat the work as not-done until discharged, never skip it silently.
Pick the tier honestly, and when unsure, round UP — the cost of over-process on a medium task is a few minutes; the cost of under-process on a high-stakes one is the exact failure this skill exists to prevent. (Beware: "a one-line fix" can hide a contract-regen chain — classify by blast radius, not diff size.)
Split into phases when the work won't fit one session. Independently of the
tier above: if executing the task end-to-end would touch more than one coherent
verify-loop, or bloat the working context toward the compaction threshold (~150K
tokens — not the 1M hard limit; by 1M you've long since lost recall to context-rot
and are re-reading the whole window every turn, which on a subscription burns your
usage allowance fastest), plan it as multiple phases and run one per session with a
/clear between. Blast radius sets the review depth; "fits one session" sets the
phase boundaries.
Phase the rollout, not the rigor. Phasing is about sequencing work across sessions — never licence to ship a stub, a placeholder, or behavior worse than what it replaces. Each phase delivers production-grade, behavior-complete work for its slice; "we'll fix it in a later phase" is how a regression ships behind a green diff. If a slice can't be done properly yet, shrink the slice — don't lower the bar.
Do it now, or defer it in writing — never only in your head. Default to the
proper implementation now. A v1 / MVP / stub is justified only when the full
version genuinely can't be built yet — a missing prerequisite, a separate
high-stakes surface that deserves its own review (e.g. a money path), or it won't
fit the session — never just because it's faster. And a deferral only counts once
it's written to durable memory (§7, e.g. the committed .claude/deferrals.json) as a
named, owned item: a gap you merely say
out loud (§8) dies on session reset — the next run starts clean and never sees it.
Test before deferring: if this session ended now, would this still get picked up?
If no — do it now, or write it into the plan first. (Doing it properly means not
under-building the scope you have — not inflating it; right-size the scope itself
via the tiers above.)
Write the plan first. Number the stages; for each, state the expected output and how you'll know it's right. Define done up front — the concrete condition that lets you stop. A plan you can't check against isn't a plan. Split each "done" claim by how it's judged: testable → a deterministic command (the arbiter, §4); un-testable → a §5 review. Don't dress an un-testable claim as a passing test.
Every non-trivial decision traces to a source. Tag each one:
Never silently inscribe a constraint nobody gave you. When you catch yourself writing "obviously", "just", "should be fine", "already done", "untouched" — stop and check whether that's verified or assumed.
Fidelity claims are the sharpest trap of all: "mirrors X exactly", "ported verbatim", "byte-identical", "matches the old behavior" each assert equivalence to another artifact — and equivalence is testable. Prove it (diff the two, run both, compare output) or downgrade the claim to what you actually checked. Never inscribe "mirrors exactly" as a comment you did not diff.
If parts of the task are independent and each is large enough to outweigh the spawn/brief/context-reload overhead, run them as parallel sub-agents and brief each fully: scope, the exact output you want back, where to save it, the context it needs. A fan-out of trivial lookups costs more than it saves.
This fan-out IS your workflow. The Explore agents that map the code (§1), the
adversarial plan-reviewer, the /code-review finder fan-out, and the §5 fresh-eyes
reviewer are a hand-built version of what Claude Code's dynamic workflows / ultracode
mode automate — independent agents cross-checking each other. The breadth and the
caught bugs come from this orchestration, not from a higher per-agent effort dial:
once a verified plan and this fan-out are in place, the effort setting is mostly
mechanical (cranking it buys cost, not quality). Spend the budget on the orchestration
and an independent review — not the dial.
When to reach for ultracode / a Workflow: only a genuine breadth task — a codebase
audit, a large migration or sweep, multi-angle research — where the win is coverage, not
depth, and the fan-out can't be done by hand. On a coherent single build it's
double-orchestration (this fan-out already covers it). The model can't set ultracode
itself, so when you spot a real breadth task, tell the user to switch (/effort →
ultracode) rather than grinding it single-threaded.
Context economy — what returns into your window is the bill. Every sub-agent return,
tool result, and pasted blob stays in context and is re-read on every later turn
(cache-read tokens dominate a long session's usage cost — distinct from the coverage
question above; this is the cost of however you fan out). So: (a) brief each delegate to
return a terse verdict — the finding + citations, never its raw logs, file dumps, or a
long prose report; (b) when the fan-out is large (many agents, or verbose returns — e.g.
§5's multi-angle /code-review + reviewers), route it through a Workflow so the agents'
intermediate I/O stays out of your window and only a compact synthesis returns — a
hand-spawned fan-out whose N agents each report a long finding into your context is the
same coverage at many times the cost; (c) batch independent tool calls into ONE message —
each round-trip re-reads the whole window, so N sequential calls cost ~N× the reads of one
parallel batch. Never paste a raw JSON / API response / PR-comment dump into context —
extract the finding first (jq/grep in the command, or a sub-agent that returns just the
answer). /clear between phases (§0) is the same lever at session scale.
Before advancing, check the stage two ways:
grep the scripts block of every package.json, list tools/ + scripts/,
read the CI workflow — then run every gate this change could touch and paste the
exit codes. Re-running the subset you happen to remember is exactly how a
silently-broken gate survives: one an uninstalled dep makes un-runnable, or a
moved build-output path makes always-fail, looks "fine" only because you never
invoked it. A gate you added but never ran is not done; a gate that silently
always fails is worse than none.Internal consistency is not correctness. A clean diff is not evidence it works — run it and observe the behavior.
Diagnosis — when a check fails or something's broken. Reactive guessing is the costliest failure mode here. Work foundation-first:
/goal. Keep looping (check → hypothesize → test → fix) to
a verifiable success before declaring done. You cannot start /goal yourself —
it's a user command — so when a debug is worth an enforced loop, say so./code-review + self-critique + same-model plan-reviewer
all missed a bug that cross-model Greptile caught; metered bots are owner-triggered — surface
the option, never auto-run or push-loop them). (3) A fresh-context same-model pass (a
sub-agent / the plan-reviewer agent, or /clear) breaks your context anchor but still
shares your model's blind spots — so it's the anchoring-breaker and always-available floor,
never the final arbiter. Use it to surface candidates; let the deterministic gate and the
different-model pass settle them.AbortController
(+ clearTimeout). Green in a 5-min test ≠ alive at 1 hour.__Host- where the JS doesn't need to read them).IN (...).matchMedia, window,
Date.now, Math.random) in a render body (SSR/hydration safety).catch that shows the USER a
distinct failure message (not swallowed, not the prompt/instruction string)./goal (it's a user command); when a gate is worth an enforced backstop, surface it —
the user wraps the session in /goal <zero-P0/P1 condition> and a separate evaluator
re-runs you until it holds (the worker can't grade its own homework).When a decision is genuinely the user's to make and you can't resolve it from the task, the code, or a sensible default — ask, batched, not one at a time. Don't manufacture a default for a load-bearing, ambiguous choice.
For work spanning multiple steps or sessions, keep a running log on disk (a plan / progress file): what's done, the decisions + their receipts, what's next, every deferred item (§0) and open gap (§8), and anything that drifted. Re-read it when you resume — and reconcile the deferral list, confirming nothing silently fell through. The conversation is not durable memory; the file is.
Deferrals get a committed, reviewable home — .claude/deferrals.json. A deferral
kept only in a scratch note dies unreviewed; record each as a committed, structured
entry so it surfaces in the PR diff where a reviewer actually sees it:
{ "deferrals": [ { "id", "what", "why", "owner", "created", "status" } ] }
(status ∈ {open, discharged}; discharge = promote it back to active work). This is the
structured, PR-visible companion to the narrative progress file above — not a second source
of truth. It is a convention, not an enforced gate: no hook reads it (a shell check
can't decide "is this scope item built?"), so no-silent-drops stays your discipline
(here and §8) — write the deferral, or it didn't happen.
Name what you did NOT do, what you could not verify (and what a cheap proxy didn't cover), and what's out of scope. "Known-untestable" and "out-of-scope" sections are features, not omissions. Reporting a failure faithfully beats a confident wrong "done". Any gap that must actually get fixed graduates to durable memory (§7), not just this report — a gap that lives only in the conversation is lost the moment the session resets.
The disciplines above are how to work; this lets you keep working without the user
re-prompting every step. Claude Code's /goal and /loop are user-only — you can't type
them. This is the loop you can start yourself: arm a goal-file that a Stop hook enforces.
These are separate systems — don't conflate them: /goal is a built-in that judges a
natural-language condition with a model reading the transcript; the goal-file here runs a
deterministic shell check. Running /goal does not arm this goal-file or the L2 governor,
and this loop does not depend on /goal.
Setup: none — the Stop hook ships inside the tale-mode Claude Code plugin and is registered
automatically on install (default-on). For loops longer than ~8 rounds, raise
CLAUDE_CODE_STOP_HOOK_BLOCK_CAP in ~/.claude/settings.json (the loop is safe without it —
max_rounds + a fail-open are self-contained). Proven: 161 checks across 56 cases
(fail/pass/pause/edge/log + committed-config + cross-platform cwd-root + pending-marker adoption
tests/test-stop-goal-loop.sh.Arm a goal — write <project>/.claude/active-goal.json when you start a hard,
observably-verifiable task:
{ "goal": "the auth E2E prints PASSED",
"check": "npm test -- auth 2>&1 | grep -q PASSED",
"rounds": 0, "max_rounds": 25, "needs_user": null }
check is a deterministic shell command — exit 0 means done. It's the gate (a real
command, stronger than a model reading the chat). Pick one that can't pass on a band-aid
(a real test/E2E, never echo PASSED). Judge-to-claim: put every testable "done" claim
in check — it's the arbiter. For a genuinely un-testable condition ("the review found no
P0/P1"), do NOT fake it into a shell check that can pass on a band-aid — route it to a §5
cross-model / fresh-eyes review (or, to enforce it, the user wraps the session in /goal,
which model-judges the transcript).check. Fails → you get another
turn, with the foundation-first + two-strike disciplines injected as the reason. Passes →
the file clears and the turn ends. You literally cannot stop until it's true.Pause for the user (a secret you can't hold, a dashboard only they see, a login, an
outward-facing action): set needs_user to a one-line ask in the goal-file, then ask. The hook
lets the turn end so they can answer; clear needs_user (→ null) next turn to resume.
Stop / give up: ends when check passes, at max_rounds, or — if the goal proves genuinely
unreachable — when you delete the goal-file and explain why. Never weaken the check to
force a pass; that band-aid is the exact thing this system exists to prevent.
Arm it for observable goals (a debug — "the repro passes"; a feature — "the test is green"; a phase). Not pure-judgment goals (no deterministic check → nothing to gate on).
Layer 2 (the adversarial governor — optional companion plugin): a command Stop hook whose free
bash gate escalates exactly when a goal first fails twice (rounds == 2): it spawns ONE
FRESH-CONTEXT, read-only reviewer (Claude Code: claude -p restricted to Read/Grep/Glob;
Codex: OS-sandboxed codex exec -s read-only) that reads the goal/plan/code with a skeptic's frame
and names the unverified foundation, a violated documented constraint, or a band-aid — the
failures Layer 1 can't see. Its finding arrives as an ADVISORY message (it never blocks; Layer 1
owns the decision). Zero idle cost — no model call unless a loop is genuinely stuck. It ships as
the separate tale-mode-governor plugin: /plugin install tale-mode-governor@tale-mode.
Live-test the runtime (the script proves the hook's logic; only a live session proves Claude
Code re-runs the turn on a block): arm {"goal":"marker","check":"test -f /tmp/tale-done","rounds":0,"max_rounds":5},
end your turn and watch it iterate; touch /tmp/tale-done, confirm the next turn-end clears + stops.
A filled-in pass, so the artifacts above have a shape to copy. Task: "Add a 5-req/min rate limit to POST /api/signup."
§1 Map — done = limit enforced and a test proves the 6th request in a window gets 429:
429.§2 Receipts
| Decision | Source |
|---|---|
| 5 req / 60s | user: "5-req/min" |
| Key by IP, not user id | my judgment — signup is pre-auth, no user id exists yet |
Reuse kv client, no new dep | reuse — src/lib/kv.ts:12 already exports a TTL client |
§4 Verify (ground truth): re-read routes/signup.ts:1-40 — handler is POST at
line 8, no existing limiter (confirmed, not assumed). Ran the test: the 6th request
returned 429 (observed, not inferred from the diff).
§5 Critique: most consequential weakness — IP keying means a NAT'd office shares one bucket (false positives). Acceptable to ship: abuse is the bigger risk and the limit is generous; flagged for follow-up. (The real one, not a manufactured nit.)
§8 Gaps: not load-tested under concurrency; the KV TTL race (two simultaneous 5th requests) is unverified — low-impact at this limit.
Stop when §1's done-criteria are met and every weakness named in §5 is either fixed or explicitly flagged with a reason it's acceptable to ship — not before, and not endlessly hunting a flawless state that doesn't exist.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
tale-mode, rigorous-workflow, complex-tasks, planning, verification, review
npx claudepluginhub alicicek/tale-mode --plugin tale-mode6 skills in this plugin
/end-phaseExplicitly end a tale-mode build phase by clearing the phase marker(s) under <project>/.claude/, which stops the Stop-hook's committed-gate enforcement for this repo. Invoke ONLY when the user explicitly asks to end the phase, stop or disarm the tale-mode phase loop, or clean up phase markers — never proactively, and never as a way to escape a failing gate./kickoff-phaseBuild ONE scoped phase of an existing multi-phase plan in a fresh session — re-verify the plan against the live code, interview the user sharply on real forks, then implement only that phase behind plan-mode approval with runnable verification and a fresh-eyes review. Invoke explicitly when starting a phase (the cross-platform form of /tale-mode:kickoff-phase; on Codex, name the plan-file + phase in your prompt). On Claude Code, use the /tale-mode:kickoff-phase command instead of this skill./plan-phasePlan a large, multi-phase feature to a high bar — verify against the code, receipts on every decision, an adversarial fresh-eyes review, and runnable verification gates, decomposed into independently-shippable phases. Invoke explicitly when starting a big multi-session build (the cross-platform form of the /tale-mode:plan-phase command; on Codex, name the task in your prompt). On Claude Code, use the /tale-mode:plan-phase command instead of this skill./seed-gatesScan a repo's package.json scripts, CI workflows, and equivalent manifests, then SUGGEST a committed .claude/tale-mode.json gate list for tale-mode's Stop-hook loop — suggestions only; this skill never writes the config unasked, never trusts it, and never arms anything. Invoke ONLY when the user explicitly asks to seed, suggest, or set up tale-mode gates for a repo./trustReference for tale-mode's two user-only opt-in files — the committed-gate trust store (~/.claude/tale-mode-trust) and the Codex cwd-root opt-in (~/.tale-mode-allow-cwd-root) — and their security model. Invoke ONLY when the user explicitly asks how to trust a repo's committed tale-mode gates, about the "content-hash is NOT trusted" notice, or how to enable the autonomous loop on Codex. Do NOT load this proactively, and NEVER write either file yourself — both grants are manual, user-only actions.Other plugins' skills for the same job