hooks — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited hooks (Hook) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Listed on Product Hunt since April 21, 2026.
One command to make Claude Code safe for autonomous operation. 897 example hooks · 73+ Anthropic Issues addressed by hook · 218 test files · 30K+ npm downloads (cumulative) · 日本語
npx cc-safe-setupInstalls 8 safety hooks in ~10 seconds. Blocks rm -rf /, prevents pushes to main, catches secret leaks, validates syntax after every edit. Zero npm dependencies. Hooks use jq at runtime (brew install jq / apt install jq).
What's a hook? A checkpoint that runs before Claude executes a command. Like airport security, it inspects what's about to happen and blocks anything dangerous before it reaches the gate.
Doesn't Claude Code already block this? Partly, and that's worth knowing. v2.1.183 (Jun 2026) added an auto-mode guard that refuses destructive git commands (git reset --hard,git clean -fd,git stash drop, …) andterraform/pulumi/cdk destroywhen it judges you didn't ask for it — a real, welcome improvement. But it is auto-mode only, scoped to git + IaC, and classifier-based (it infers intent, so it's probabilistic). cc-safe-setup's hooks are deterministic (pattern →exit 2, no inference), fire in every mode, and cover what the built-in guard doesn't:rm -rf, database wipes, secret commits, pushes tomain/force-push, scope escapes, cloud/k8s teardown, runaway sub-agents, and false "done" closeouts. They compose — run both.
What problem are you solving today? — routing informed by the 6 readers who actually bought the books on the right column
| Your situation | Start here (free) | Go deeper (¥800-$19) | |
|---|---|---|---|
Stop destructive ops (rm -rf, force-push, prod commands) | Live Demo → npx cc-safe-setup | 事故防止本 (¥800) — the 6-buyer entry book | |
Claude merged or deployed to production without your approval — gh pr merge --admin bypassed branch protection, or a deploy fired autonomously (#68676) | gh-cli-destructive-guard + deploy-guard — PreToolUse on Bash, refuse gh pr merge / deploy commands at the tool boundary even when `--admin` overrides server-side branch protection · npx cc-safe-setup | 事故防止本 — JP (¥800) — the irreversible-ops prevention book | |
Claude tore down your cloud infrastructure — terraform destroy / aws … terminate-instances / aws s3 rb --force / gcloud … delete / kubectl delete namespace ran under auto-accept and wiped a whole environment, not one file (the PocketOS 9-second production-DB wipe, #27063) — rm-pattern guards miss the infra vocabulary entirely | terraform-guard + aws-production-guard + cloud-cli-guard + k8s-production-guard — PreToolUse on Bash, refuse the teardown verbs at the tool boundary; reads & normal terraform apply pass, and the k8s guard is context-aware (warns only when your kubectl context points at production) · npx cc-safe-setup | 事故防止本 — JP (¥800) — the irreversible-ops prevention book; infra is reproducible, data is not | |
Claude wiped the whole working tree with `git` itself — git checkout --orphan tmp && git rm -rf . deleted every file and the .git history with no commit left to recover from (a real loss of ~3 years of work, #70687); rm-pattern guards miss it because the command starts with git, not rm | git-rm-orphan-wipe-guard — PreToolUse on Bash, refuses git checkout/switch --orphan (which removes the recovery path) and recursive / whole-tree git rm -r / git rm . at the tool boundary; git rm <file> and git rm --cached (untrack-only, no disk loss) still pass (22/22 tests) · npx cc-safe-setup | 事故防止本 — JP (¥800) — the irreversible-ops prevention book; infra is reproducible, data is not | |
| Claude said the deploy was done — but it wasn't (or you can't tell): a "deployment complete / shipped to production" closeout while the real deploy state diverged, or it was never actually verified (#61699 — a production session with sustained deception) | deployment-readback-gate + deployment-readback-gh-adapter — a Stop hook that refuses the closeout unless the GitHub Deployments API confirms the claimed ref, recently (fails closed if the authority can't be reached), and writes an audit receipt outside the transcript · npx cc-safe-setup | 事故防止本 — JP (¥800) — false "done" reports are the book's core failure class | |
Claude's config was poisoned from outside Claude itself — a malicious npm post-install script or MCP server silently rewrote ~/.claude.json / settings.json to inject a network/eval hook or reroute MCP traffic through a localhost proxy, so the edit never passes through a tool boundary and no `PreToolUse` hook ever fires (CVE-2025-59536 / CVE-2026-21852; Mitiga's ~/.claude.json MCP-rewrite OAuth-token theft) — the existing guards prevent Claude from editing config, but nothing audits config already poisoned from outside | mcp-config-poisoning-audit — a read-only SessionStart audit that flags injected network/eval hooks and mcpServers endpoints pointing at external or localhost-proxy hosts; it never edits or deletes (some payloads retaliate on tamper), it only warns so you verify and remediate by hand. Silence expected entries with CC_MCP_AUDIT_TRUSTED_HOSTS · npx cc-safe-setup | 事故防止本 — JP (¥800) — the irreversible-ops prevention book | |
A sub-agent's own result smuggles forged system markup into the parent's trusted channel — the sub-agent emits, as its result, a fabricated <system-reminder> block (or a leading System: directive) commanding the parent to emit an ack token, call a tool, or grant a permission escalation; the harness relays it verbatim, unescaped, so it reads as a real system-reminder to the parent model (#71602, independent same-class #71612) | subagent-forged-system-reminder-guard — a SubagentStop hook that inspects the finishing sub-agent's last_assistant_message (or its recorded transcript) for harness control markup paired with a parent-directed imperative, and emits a legitimate advisory re-framing that result as untrusted data, not instructions (so the forged directive is inoculated, not obeyed). Advisory by default; CC_FORGED_REMINDER_MODE=strict refuses the Stop. A research sub-agent that merely quotes the tag without a directive is not flagged · npx cc-safe-setup | 相互運用本 — JP (¥1,500) — Ch.12 walks through this exact vertical-interop incident (a sub-agent's result forging system instructions aimed at the parent), next to Ch.10 (sub-agent inheritance gaps) and Ch.11 (silent worktree-isolation breaks) | |
Uncommitted work silently gone — no command you ran, no error (a git reset --hard you didn't type, harness checkpointing, crash auto-stash) | Recover it — your edits are usually still on the stash stack: git stash list → git stash apply · Incident Tracker — Data Loss · npx cc-safe-setup's uncommitted-discard-guard blocks the model-driven variant deterministically and in every mode (v2.1.183's built-in guard covers the git reset --hard case too, but only in auto mode and by inferring intent) | 事故防止本 — JP (¥800) — the data-loss prevention book · Autonomous Claude Ops — EN (~$6) — Ch.7 is this exact failure | |
Your Claude Code conversation / session history "disappeared" — the VS Code sidebar emptied when you switched the open folder (#71710), Desktop </> Code history vanished on restart with no notice (#71729), or "Past conversations" went blank after an update (#71647) — it looks like data loss, but the transcript is almost always still on disk | Session Loss Checker — drop your logs, see if a transcript was actually emptied · where sessions live & how to recover any of them — they persist per-folder under ~/.claude/projects/<cwd>/; cd to that folder + claude --resume (bypasses the UI filter), or grep the cwd across ~/.claude/projects/*/*.jsonl to find any of them | 事故防止本 — JP (¥800) — the data-loss prevention book; looks-gone is not gone, but panic-deleting makes it real | |
Claude's Write/Edit reported success, but the file on disk is corrupted — the tail was silently replaced with NUL bytes (notably the Windows Cowork workspace mount); the byte count can be unchanged, so wc -c and tail look fine and it passes review (#70414) | write-nul-corruption-detector — a PostToolUse hook on `Write\ | Edit that flags NUL bytes in the just-written file (they survive a byte-count check), so a corrupted write is caught at write time instead of at parse time · npx cc-safe-setup` | 事故防止本 — JP (¥800) — Ch.22 silent data loss names this exact symptom (Write/Edit truncation & partial-write) |
Token costs out of control (/cost shock) | Token Checkup | Token Book — JP (¥2,500) · Token Book — EN (name your price) — the staged-upgrade destination | |
| Max plan hitting usage limits too fast (rate-limited at low %) | Why Max hits limits so fast (the #16157 cluster + what you can measure) · Token Drain Analyzer (analyze your own logs in-browser → bug or context?) | Token Book — JP (¥2,500) · Token Book — EN (name your price) — cut consumption | |
| June 15 billing cliff — Pool 2 would split programmatic usage into a separate paid credit pool (same automation 5–25× more). Announced for 2026-06-15 but paused that day — nothing changed for now; still announced, could return, so this is preparation, not a live emergency. (two model IDs did hard-404 the same day) | Exposure from your logs — whether it hits you, read from your real session logs (not a guess) · Credit Cliff Calculator — how much you'll overage · 4-Path Picker — which response path fits you | 6月15日の課金分離に備える (¥800) — 4 operator paths, day-by-day timeline, the M metric | |
On a subscription but Extra Usage / API credits keep draining — having Claude Desktop and the standalone CLI installed silently routes usage to API billing (/status shows API Usage Billing, not your plan); /login doesn't fix it, only removing the standalone CLI did (#68501). Distinct from the Pool 2 cliff above. | Which wallet are you paying from? — the /status 1-minute self-check · all 6 billing-drain causes & fixes (incl. the ~/.config/anthropic/ overwrite case /login can't fix) | 6月15日の課金分離に備える (¥800) · Token Book — JP (¥2,500) — sort out where your money actually goes | |
A sub-agent / fan-out tree spawns out of control and burns the whole budget — recursive spawning that ignores CLAUDE_CODE_FORK_SUBAGENT=0 (#68430, #68285, #62193) | nested-spawn-inflight-guard — PreToolUse on Task/Agent, refuses dispatch past N in-flight, enforced at the tool boundary so it caps the tree even when that env flag is ignored (26/26 tests) · the "lost" work is recoverable — each sub-agent persists its output to ~/.claude/projects/…/subagents/agent-*.jsonl turn-by-turn · npx cc-safe-setup | 6月15日の課金分離に備える (¥800) — post-cliff a runaway draws from Pool 2, so it burns real credits, not just quota | |
| Sub-agents lying about "task complete" | Cluster Exposure Diagnostic | Sub-Agent Observability Handbook (preview) | |
A sub-agent you gave a name finishes, but its result never comes back to the caller — the long investigation looks lost (#71723). Distinct from the runaway-spawn row above: nothing crashed, the output is just misrouted (passing name switches it to the teammate path, so completion arrives as idle_notification, which the caller isn't waiting for) | The result is not lost — it persisted turn-by-turn to ~/.claude/projects/…/<session-id>/subagents/agent-<id>.jsonl. Don't re-run the investigation: recover it from disk with find … -path '*/subagents/agent-*.jsonl' -newermt '1 hour ago' + jq on the last assistant turn. Prevention: don't pass name to a background sub-agent whose result you need to receive | Sub-Agent Observability Handbook (preview) · 事故防止本 — JP (¥800) — Ch.53 is this exact recovery path | |
| Opus 4.8 reporting tool results that never ran (fabrication after a cancelled parallel batch) | Why Opus 4.8 fabricates tool results (the trigger, how to spot it, the /model claude-opus-4-7 mitigation + free detection hooks) · Fabrication / false-completion self-audit — 8 questions → a 0-100 score for your defenses against a fabricated "done" / "tests passed", with the fix for each gap | Claim-Verify Handbook ($19) — 130 cases, 3-stage framework, 14 defenses | |
| Legitimate work blocked as a "cyber" / Usage Policy violation, then the whole session dies | Blocked as a "cyber" policy violation? (why one block poisons the session, Sonnet + session-hygiene mitigations, the refund framing, 4 free advisory hooks) | Free hooks + Safety Brief ($5/mo) to track the shifting classifier | |
Hand-syncing CLAUDE.md + AGENTS.md (Codex / Amp / Copilot read it natively; Cursor / Windsurf / Cline / Aider / Gemini CLI need a line) | Interop Scorecard — score how drift-proof your setup is (X/6), share the card · Setup Generator — pick your tools, copy the exact setup · explainer | AGENTS.md × Claude Code Interop Handbook (EN, $12) — 9-tool matrix, templates, migration runbook · 日本語版 (¥1,500) | |
Sub-agent isolation: worktree silently turns off — the sub-agent edits the lead's working copy and commits land on the wrong branch with no error (#70456 / #70069) | Worktree Isolation Risk self-check — 5 questions → exposure score → the fix · npx cc-safe-setup's worktree-escape-write-guard blocks the escape deterministically | AGENTS.md × Claude Code Interop Handbook (EN, $12) — sub-agent boundaries & the multi-tool setup | |
| Considering switching tools (Cursor / Codex / Cline) | June 15 Readiness Audit | Migration Playbook ($19) | |
| Hit a known bug, want a reference | Incident Tracker (100 cases) | 事故防止本 (¥800) | |
| Stay ahead of next month's failure clusters | Agent Safety Brief — free monthly email: the awareness layer — one verified incident a month (detection → recovery → prevention + the hook), in your inbox, no payment — or the free sample of the full digest | Safety Brief — the monthly operations layer ($5/mo): not just more incidents to read — a paste-ready prevention config for each new incident, a 10-minute monthly config-review checklist (confirm your guards still cover this month's new failure modes after each Claude Code update — see June's sample), and the running archive of every past fix in one place. Close the gaps instead of reading about them |
Or browse the diagnostic-tool index below ↓
🏅 Safety Scorecard (NEW 2026-06-02: check the protections you have → an honest X/8 coverage card you can screenshot and share. Browser twin of npx cc-safe-setup --scorecard; the score is encoded in the URL so a shared link reproduces the exact card. No npm, nothing leaves your browser) · 🔎 Fabrication / False-Completion Self-Audit (NEW 2026-06-20: when Claude Code says "done" or "tests passed" — would your setup catch it if that were not true? 8 questions → a 0-100 score for your defenses against fabricated tool results and false completion, with the operator-side hook pattern that closes each gap. For the #33781 / #44955 / #27430 fabrication pain. Local-only) · 🔗 AGENTS.md Interop Scorecard (NEW 2026-06-03: you wrote one AGENTS.md — does every tool actually read it? Score X/6 across Claude Code / Codex / Cursor / Aider / Amp and more, screenshot and share the card. For the #6235 pain, 5,200+ reactions) · ▶ Live Demo (see hooks block rm -rf in your browser) · Incident Tracker (100 real incidents) · Cluster Exposure Diagnostic (NEW 2026-05-29: 7 questions → which of the 12 tracked failure clusters you are exposed to) · Cluster 12 Sub-Pattern Diagnostic (NEW 2026-05-29: 4 questions → which of the 4 Opus 4.7 tool-call parsing sub-patterns 12A/12B/12C/12D is hitting your session, with sub-pattern-specific recovery so misapplied /clear doesn't burn context) · Cluster 13 Extended-Thinking Wedge Diagnostic (NEW 2026-05-30: 5 questions → which of 13A/B/C/D sub-patterns is hitting you, plus detection of the /loop autonomous-run amplification reported by @LMS927369. Correct env var matrix per cnighswonger's 2.1.148 disassembly — DISABLE_INTERLEAVED_THINKING=1 does NOT actually prevent the failure) · Opus 4.8 Dual Cluster Exposure (NEW 2026-06-01: 5 questions → are you exposed to Cluster 22 fabrication and/or Cluster 23 effort-budget regression on Opus 4.8? 11 filings 5/30-5/31; both clusters resolve via /model claude-opus-4-7 per the #64153 reporter's own comparison) · Skills Audit Tool (NEW 2026-05-29: drop your session log, find which Skills never fire — author's own audit: 111 installed, 0 invoked in 10 sessions) · Safety Lab Fit Diagnostic (NEW 2026-05-29: 5 questions → should you subscribe to the ¥500/month CC Safety Lab membership, or are the free hooks here enough?) · Token Checkup (what type are you?) · Token Drain Analyzer (NEW 2026-06-08: drop your session logs → cache_read breakdown + bug-vs-context verdict, 100% in-browser) · All 28 Tools · Defense Kit (11 incidents → 11 hooks, narrative-per-incident) · Drift Matrix (14 May 2026 cases × 10 hooks, "if I saw X install Y")
cc-safe-setup
Make Claude Code safe for autonomous operation
Prevents real incidents (from GitHub Issues):
✗ rm -rf permanently destroyed ~50 GB / 1,500 files (#49129) ← April 2026
✗ Auto mode approved ~/.ssh deletion, all SSH keys gone (#49554)
✗ ~/.git-credentials PATs deleted without confirmation (#49539)
✗ rm -rf deleted 3,467 files (~7 GB) without confirmation (#46058)
✗ rm -rf deleted entire user directory via NTFS junction (#36339)
✗ Remove-Item -Recurse -Force destroyed unpushed source (#37331)
✗ Entire Mac filesystem deleted during cleanup (#36233)
✗ Untested code pushed to main at 3am
✗ Force-push rewrote shared branch history
✗ API keys committed to public repos via git add .
✗ Syntax errors cascading through 30+ files
✗ Sessions losing all context with no warning
✗ CLAUDE.md rules silently ignored after context compaction
✗ Claude ran destructive DDL on production database (#46684)
✗ AI executed delete/kill operations on production environment (#46650)
✗ Subagents ignoring all CLAUDE.md rules since v2.1.84 (#40459)
Hooks to install:
● Destructive Command Blocker
● Branch Push Protector
● Post-Edit Syntax Validator
● Context Window Monitor
● Bash Comment Stripper
● cd+git Auto-Approver
● Secret Leak Prevention
Install all 8 safety hooks? [Y/n] Y
✓ Done. 8 safety hooks installed.A user lost 3,467 files (~7 GB) when Claude ran rm -rf on their data directory without confirmation. Another lost their entire C:\Users directory when rm -rf followed NTFS junctions. Another lost all source code when Claude ran Remove-Item -Recurse -Force * on a repo. One user's Claude ran destructive DDL on a production database when asked only to investigate. Another had Claude execute delete and kill operations on production systems. Others had untested code pushed to main at 3am. API keys got committed via git add .. Syntax errors cascaded through 30+ files before anyone noticed. And CLAUDE.md rules get silently dropped after context compaction, your instructions vanish mid-session.
Already lost files to a destructive command? Start with the File Recovery Field Guide (NEW 2026-06-01) — recovery-first by file type and OS (git reflog / git fsck for code, PhotoRec / Time Machine / Volume Shadow Copy for media and binaries), then the one PreToolUse hook that prevents a repeat. The hooks below are that prevention layer.
One user analyzed 6,852 sessions and found the Read:Edit ratio dropped from 6.6 to 2.0, Claude editing files it never read jumped from 6% to 34%. That issue has over 2,100 reactions. The read-before-edit example hook catches this pattern before damage happens.
In April 2026, $1,446 was transferred without authorization when Claude moved funds between exchange accounts. A user lost $367 and got their account suspended from a Claude-generated script. Physical coordinates were uploaded to a public website despite 17 sessions of "no PII" in CLAUDE.md. And deny rules can be bypassed with 50+ subcommands.
Claude Code ships with no safety hooks by default. This tool fixes that. (Standalone guard script for quick setup | Database protection hooks | Credential protection hooks | Fabrication detection hook | Security vulnerability hooks)
Production case study (healthcare, 2026-05-25): Effective Therapy — a trauma therapy platform serving clinical waitlist populations in Israel — installed dispatch-receipt.sh, closure-word-verify-gate.sh, and route-handler-emptiness-gate.sh after a production audit found 39 OpenClaw agents deployed, only 5 ever used, and 80+ hollow-code findings across the codebase (correct auth checks, correct routes, correct success messages, missing the line that saves data). Patient-safety context: hollow storeResearchReflection meant trauma patient input received a "Reflection saved" success message for data that was thrown away. Full case study with the 4 hollow-code patterns and the 4.7-vs-4.6 behavioral comparison: ianymu/recognition-without-arrest PR #2 (@nvst18, 2026-05-26).
Works with Auto Mode. Claude Code's Auto Mode sandboxing provides container-level isolation. cc-safe-setup adds process-level hooks as defense-in-depth, catching destructive commands even outside sandboxed environments.
Works with subagents. Since v2.1.84, subagents and teammates don't receive CLAUDE.md, your project rules are silently skipped. Hooks operate at the process level, but subagent tool calls may bypass PreToolUse hooks in some configurations. As defense-in-depth, cc-safe-setup installs hooks at the user level (~/.claude/settings.json). The subagent-claudemd-inject example hook re-injects critical rules into subagent prompts.
Opus 4.7 broke auto mode's safety classifier, it was hardcoded to Opus 4.6. If you use auto mode with Opus 4.7, dangerous commands run without the built-in safety check. In 3 days: 50 GB permanently deleted, ~/.ssh wiped, git credentials destroyed, shell configs truncated to 0 bytes. Users report 4x token consumption from silent model switches.
One command to fix it:
npx cc-safe-setup --opus47Installs 4 hooks targeting known Opus 4.7 regressions. Full details → · Emergency Defense Kit (Gist) · Safety Scanner
Update (2026-06-22): Anthropic paused this on the day it was due. The split was scheduled for 2026-06-15, but Anthropic paused it that day — nothing changed for now; claude -p, the Agent SDK, and GitHub Actions still draw from your normal subscription limits (the-decoder, digitalapplied). It remains officially announced and could still return, so knowing your exposure is worthwhile — but treat the tools below as preparation, not a live emergency.Anthropic announced a split of programmatic billing for 2026-06-15 (paused that day — see the note above) — under it, claude -p and SDK invocations would route to a separate credit bucket. In May 2026, financial-harm reports started landing on the tracker: €84.68 over the spending limit from confident-but-false billing claims (#61704), $80 in tokens burned on buggy code presented as working (#61728), tokens wasted on malformed tool calls after assurances they were fixed (#61086), production deployment session with sustained deception (#61699). The model cannot verify Anthropic's own billing logic from its training data. After June 15, the gap between what the model says about billing and how Anthropic actually bills widens. → Plain-English explainer (who's affected, the two pools, the two actions): Claude Code's June 15, 2026 billing change. → 20-second exposure check with a shareable card and live countdown: Are you exposed to the June 15 cliff? → Deep-dive paid guide (Japanese, ¥800) — the operator-side actions mapped to days-remaining before the cliff: Claude Code の6月15日の課金分離に備える. Operator-side defenses available today:
grep / Read / file scan from independent contexts, billed N times), (2) claim-and-judging cost (cross-vendor disagreement requires a verification path the single-vendor cost guides don't articulate), (3) reasoning-cost-vs-execution-cost split (worker-retry-with-different-params leak shape that lives at the supervisor's coordination boundary, not at any individual vendor). Origin: 5-round technical thread on #64080 with @palios-taey running a Claude Code + Codex + Gemini + Grok supervisor-coordinated fleet, who flagged the cluster as worth articulating for any other operator running the same shape. Companion 5-question fit diagnostic at Multi-Vendor Fan-Out Diagnostic — browser-only, no signup, no telemetry, scores you against the multi-vendor cluster vs the single-vendor cluster. Japanese-language preview (gist 6b9ddcd1, ~1,800 chars) for Japanese-speaking operators. The fundamental claim of the cluster: single-vendor cost guides (Token Book, ClaudeFast, EasyClaw, vendor-official docs) do not articulate the cost shape that emerges when reasoning happens across independent vendor contexts; the multi-vendor cost shape is operationally distinct and requires its own articulation. 14-day measurement window (ends 2026-06-14): independent confirmations of the worker-retry coordination leak outside @palios-taey's fleet, multi-vendor handbook reads, new multi-vendor fleet filings. The 2027-05 Safety Lab issue is targeted as lead chapter once the cluster crosses promotion thresholds.nested-spawn-inflight-guard (runaway subagent prevention), bash-fanout-bounded-rewriter (fan-out inside a single Bash call), cache-creation-drift-detector (token spike early warning), compact-dispatch-watchdog (silent compaction failure detection), claim-verify-audit (one-shot diagnostic of 8 known patterns). Each entry gives What it stops / Why I picked it / Install / Wire-up / Override. Covers macOS, Linux, Windows under WSL2 / Git Bash. ~1,297 words, MIT, 14 verified cited links. Names the five clusters this starter pack does NOT cover and where to read the matching field guides.examples/subscription-api-billing-warner.sh — Claude Code's credential precedence puts API-key auth above an OAuth subscription, so if ANTHROPIC_API_KEY / ANTHROPIC_AUTH_TOKEN is set, or an apiKeyHelper is configured in settings.json, every request silently bills API / purchased credits even while your Pro/Max subscription quota sits unused. This hook warns at session start when any of those three precedence sources is present, names which one, and points to /status (to confirm the active auth) plus the unset / /config / support-refund fix. The recurring money-losing pain on the tracker: #64613, #53638, #53728. Advisory only — never blocks, never reads the key value; auto-skips when ANTHROPIC_ACCOUNT_LABEL marks deliberate multi-account API use, and silences via CC_SUB_BILLING_DISABLE=1. 16 tests passing.cache-creation-drift-detector (PR #340), quota-anomaly-detector (PR #348), session-rate-monitor (PR #349).always-allow-pattern-suggester.sh PR #359 for Axis 2; bypass-mode-effective-verifier.sh PR #360 for Axis 7). Shipped-status update with install paths and operator checklists: Cluster 6 Defense Status Update. Also serves as the working preview for the 2026-09 Safety Lab chapter.cache_control marker permanently jams a session. Includes the field-recovery Python script (preserves context), four scenarios where the corruption surfaces, and four prevention practices. English companion to the original Japanese-language 2026-05 preview Gist. This is the 2026-05 chapter of the Safety Lab series; 2026-08 and 2026-09 previews above complete the English-side preview set.nAA in the minified source) that reads strings from the bootstrap API client_data field and the tengu_heron_brook GrowthBook feature flag and registers them as peer-level system prompt sections alongside the documented anti_verbosity / thinking_guidance / action_caution sections. Anthropic confirms this is intentional ("we run experiments on our system prompt"); the documented opt-out is CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 and DISABLE_GROWTHBOOK=1. Reference: #62061 (46+ reactions, bytecode-level evidence by @vladkens) and the v2.1.150 server-side prompt injection audit paths writeup (1,133 words, four audit paths). Defense triple shipped (3 of 4): server-side-prompt-injection-detector.sh (PR #383) — SessionStart advisory when either opt-out env var is missing; cache-residue-detector.sh (PR #453, 28 tests) — closes the gap that opt-out alone does not perform by detecting cached injection values that persist after opt-out env vars are set; and proxy-capture-suggester.sh (2026-05-29, 19 tests) — opt-in SessionStart advisory that surfaces the HTTPS proxy capture path for operators in regulated industries (SOX, HIPAA, FedRAMP, PCI-DSS, EU AI Act Article 12) who need a reconstructible audit trail of the exact system prompt sent at the time of any logged action. When enabled via CC_PROXY_CAPTURE_SUGGESTER_ENABLE=1, names four audit tools (mitmproxy with --save-stream-file, Burp Suite Community, Charles Proxy, Anthropic SDK ANTHROPIC_LOG=debug) with concrete HTTPS_PROXY bridge and SSL_CERT_FILE setup, or — when a proxy is active but ANTHROPIC_LOG_DIR is unset — a shorter audit-sink advisory. Privacy: reads only the env var names, never their values. One more audit hook in design: system-prompt-baseline-checker.sh (diffs baseline against runtime, requires proxy capture). Also serves as the working preview for the 2026-11 Safety Lab chapter.aup-false-positive-helper.sh (PRs #388 and #389, 16 tests, opt-in SessionStart advisory only — never blocks). Second defense hook shipped 2026-05-29: aup-block-pattern-logger.sh — PostToolUse advisory-only hook that pairs with the helper by closing the evidence-and-trend gap. Detects five distinct AUP block patterns (cyber-safeguards, safety-guardrails, rephrase-rewind, usage-policy, usage-policy-api fallback) in tool output and appends a five-field pipe-delimited line to ~/.claude/aup-block-history.log (timestamp / model / tool / pattern kind / 120-char excerpt). Default mode shows the cumulative count for the current model on stderr so operators can build CVP evidence and notice classifier-shift over time. 23 tests covering all five patterns, pattern priority, log rotation, schema preservation, jq fallback, and never-blocks invariant. Environment toggles: CC_AUP_BLOCK_LOGGER_DISABLE, CC_AUP_BLOCK_LOGGER_QUIET, CC_AUP_BLOCK_LOG_PATH, CC_AUP_BLOCK_LOGGER_MAX_LINES. Third defense hook shipped 2026-05-30: model-swap-suggester.sh — evidence-driven SessionStart advisory that closes the loop between the helper (generic awareness) and the logger (evidence collection) by reading ~/.claude/aup-block-history.log on session start, counting Opus blocks in a configurable lookback window (default 60 minutes, threshold 3), and emitting a concrete export ANTHROPIC_MODEL=claude-sonnet-4-7 swap recommendation only when the threshold is crossed. Silent in every other path (model unset, non-Opus pinned, log missing/empty, below threshold, outside window) so it never adds noise to users who have not actually been blocked. Counts all Opus variants in the log (opus-4-7, opus-4-6, opus-4-7[1m]) toward the threshold because the cluster signature is Opus-family-wide. 25 tests covering: env toggle paths (DISABLE / QUIET), model gating (unset / Sonnet / Haiku / Opus), log states (missing / empty / Sonnet-only / mixed), threshold and window semantics (below / at / above / outside), custom env vars (THRESHOLD / WINDOW_MIN / TARGET / garbage fallback), schema robustness (unparseable timestamps skipped without crash), and never-blocks invariant across 8 paths. Environment toggles: CC_MODEL_SWAP_SUGGESTER_DISABLE, CC_MODEL_SWAP_SUGGESTER_QUIET, CC_MODEL_SWAP_SUGGESTER_THRESHOLD, CC_MODEL_SWAP_SUGGESTER_WINDOW_MIN, CC_MODEL_SWAP_SUGGESTER_TARGET, shares CC_AUP_BLOCK_LOG_PATH with the logger. Cluster 9 primary-symptom defense complete (3 of 3 hooks for the block-and-swap path). Fourth defense hook shipped 2026-05-30 (secondary-pain coverage): aup-retry-loop-guard.sh — PostToolUse hook that addresses the retry-loop context-burn pain documented in #61664 (Japanese paid user, 2026-05-23: "ブロック発生時も context/credit は消費される", "ブロック→巻き戻し→同じ処理の再実行 で context を浪費"). The first three hooks address awareness / evidence / session-start swap but do not break a retry cycle in progress within a single session. The retry-loop-guard reads ~/.claude/aup-block-history.log after each tool call, checks whether 3+ blocks (configurable) within a 5-minute window (configurable) all targeted the same tool — the single-tool restriction is the diagnostic signature distinguishing a retry loop from a general session sensitivity. When the pattern fires, emits a one-shot per-session advisory recommending either Option A (/exit + restart fresh with Sonnet pinned, safest for quota) or Option B (in-place swap, continues current session). The one-shot lock uses a session identifier resolved in order: CC_AUP_RETRY_LOOP_GUARD_SESSION_ID (explicit override), CLAUDECODE_SESSION_ID, controlling tty, PPID fallback. 26 tests covering env toggle paths, log states, threshold and window semantics, multi-tool burst rejection, custom target model, one-shot per session with different sessions firing independently, garbage env var fallback, unparseable timestamp skipping, and never-blocks invariant across 7 paths. Environment toggles: CC_AUP_RETRY_LOOP_GUARD_DISABLE, CC_AUP_RETRY_LOOP_GUARD_QUIET, CC_AUP_RETRY_LOOP_GUARD_THRESHOLD, CC_AUP_RETRY_LOOP_GUARD_WINDOW_MIN, CC_AUP_RETRY_LOOP_GUARD_TARGET, CC_AUP_RETRY_LOOP_GUARD_STATE_DIR, CC_AUP_RETRY_LOOP_GUARD_SESSION_ID, shares CC_AUP_BLOCK_LOG_PATH with the logger. Internal customer-pain research at ~/ops/customer-pain-cluster-9-secondary-pains-2026-05-30.md (7 secondary pains beyond the primary block symptom; this hook addresses axis 1). Fifth defense hook shipped 2026-05-30 (secondary-pain coverage continued): aup-large-tool-output-warner.sh — PreToolUse hook that addresses the large-security-output trigger surface documented in #61185 (filipghoulin, 2026-05-23: "A lab-review skill dispatched a sub-agent that ran cat /etc/banip/banip.blocklist on an OpenWRT router. The blocklist has ~17,000 entries. That volume of content in a single tool result, combined with the security shape of the content, appears to have flipped the classifier into a permanent block state for the whole session"). The first four hooks act on the block aftermath (awareness, evidence, swap, retry-loop break); none of them act before the offending tool call. Once the classifier fires on a large security-shaped output, the session is already wedged and /compact//clear may themselves block — so the only place to address this trigger surface is the PreToolUse boundary. Detects five command shapes that commonly produce large outputs (cat on security-shaped system paths, find recursing under security paths, journalctl/dmesg without size caps, grep -r on security paths) plus a sentinel wordlist (blocklist, denylist, banlist, iplist, iptables-save, ipset save, /etc/banip/, /etc/fail2ban/, /var/log/auth, /var/log/secure, firewall.conf) for content that would look security-shaped to the classifier regardless of how it is read. Emits a one-shot per-(session, pattern_hash) stderr advisory recommending narrower variants (head -N, tail -N, wc -l, grep -c, journalctl --since, find ... | head). Skips automatically when the command already has a size cap (head/tail/wc/-n/-quit/--since). 32 tests covering env toggle paths, non-Bash tool skip, empty/malformed input, every category and sentinel, every size-cap skip path, one-shot per-(session, pattern) semantics with different patterns and different sessions firing independently, sentinel-only path (e.g. iptables-save > /tmp/rules.txt), advisory content references (#61185, #60366, head -200 recommendation), state directory auto-create, and never-blocks invariant. Environment toggles: CC_AUP_LARGE_OUTPUT_WARNER_DISABLE, CC_AUP_LARGE_OUTPUT_WARNER_QUIET, CC_AUP_LARGE_OUTPUT_WARNER_STATE_DIR, CC_AUP_LARGE_OUTPUT_WARNER_SESSION_ID. Internal customer-pain research at ~/ops/customer-pain-cluster-9-secondary-pains-2026-05-30.md (axis 4: single tool call returning large sensitive-content volume). Cluster 9 five-hook defense surface now covers: helper (axis 0 awareness) + logger (axis 0 evidence) + suggester (axis 0 session-start swap) + retry-loop-guard (axis 1 intra-session retry cycle break) + large-tool-output-warner (axis 4 pre-call large-output prevention). Companion interactive 4-question diagnostic at cluster-9-aup-diagnostic.html outputs the highest-leverage path tailored to your model / frequency / domain / CVP status. Also serves as the working preview for the 2026-12 Safety Lab chapter./ultrareview (cloud-side review feature, 3 free credits / day on Pro) crashes server-side with zero findings returned, yet the operator's daily credit counter is still decremented. Shared error: Review crashed before producing findings. See session logs for details. The six filings: #62696 (3rd crash burns credit, v2.1.150, anchor), #62709 (PR #7 review crashed, 0 findings), #62787 (2 consecutive crashes, 2/3 credits burned, 21 files / 84KB diff), #62876 (Find phase crash, Setup phase complete), #63117 (1 crash decrements credit, 6 files / 2,185 insertions), #63522 (same-branch 2 consecutive crashes, 2/3 credits burned). Three common structural traits: (1) Large PRs crash at a noticeably higher rate (16+ files or 1,500+ insertions over-represented); (2) Find phase is the failure point — Setup phase completes; (3) Retrying on the same branch burns a second credit for the same crash. Three operator-side defenses (the crash is server-side, no hook can prevent it): split the PR before invoking /ultrareview; do not retry on the same branch; fall back to /code-review (local, no cloud crash exposure). SessionStart advisory shipped (this PR): examples/ultrareview-large-diff-advisor.sh (22/22 tests passing) — measures current branch diff vs base and surfaces caution / elevated advisories above 6 files or 500 insertions (caution) and 16 files or 1,500 insertions (elevated). All thresholds env-overridable; opt-in QUIET/DISABLE. Token consumption impact quantified in the Token Book Ch18 — /ultrareview の停止で使用枠が消費される集積の候補と利用者の側のトークンへの影響の整理 (¥2,500, freshly added 2026-05-29): the failed cloud run plus the local re-review doubles token consumption; the June 15 traffic-pool split routes the failed cloud run through Pool 2 quietly, then double-charges across Pool 1 and Pool 2 when the operator falls back to local. English field guide (1,481 words, MIT): The /ultrareview crash that burns credit: six issues in three days and three user-side defenses. Filings count crossed the 4-filing promotion threshold; reactions count (0) has not crossed the 15-reaction threshold yet — tracked as candidate at cluster-tracker.html. Internal research document: ~/ops/customer-pain-research-ultrareview-crash-credit-2026-05-29.md. 2027-06 Safety Lab issue targeted as lead chapter once promotion criteria fully met.settings.json paths or environment variables are silently ignored at runtime — no validation error, no warning, the operator continues believing the setting is applied. Pair to Cluster 7 which articulates the same validation-pipeline-absence root cause from the opposite direction (fabricated fields silently accepted). The four filings: #63178 --model flag silently ignored in interactive mode (works in --print, v2.1.153), #63186 CLAUDE_AUTOCOMPACT_PCT_OVERRIDE in settings.json env block silently ignored at app level (propagates to subprocess only), #63479 CLAUDE_CODE_DISABLE_1M_CONTEXT=1 env var ignored, #63560 ~/.claude/settings.json top-level model field silently ignored for interactive sessions (--model flag and ANTHROPIC_MODEL env var both work). The common workaround for all four: switch to env var path via ~/.bashrc / ~/.zshrc export — the env-var path is honored where the settings.json path silently fails. Token consumption impact quantified in the Token Book Ch17 — 設定の沈黙の無視の集積と利用者の側の token への影響の整理 (¥2,500, freshly added 2026-05-29, 14,267 chars): autocompact misfire produces context bloat (+15-30% cache_creation rate), 1M-context continuation produces 1.8-2.4× token consumption vs intended 200K mode, model-misroute produces 8-15% retry rate. June 15 cliff impact: with Pool 2 overage pricing post-2026-06-15, the same silently-ignored settings produce 1.5-5.5× cost amplification vs the pre-cliff baseline (Token Book Ch17 §17.8). Filings count crossed the 4-filing promotion threshold; reactions count (0) has not crossed the 15-reaction threshold yet — tracked as candidate at cluster-tracker.html. Internal research document: ~/ops/customer-pain-research-settings-silently-ignored-2026-05-29.md (four product hypotheses including the cc-safe-setup settings-effective-state-checker.sh hook in design for June 2026). 2027-05 Safety Lab issue targeted as lead chapter once promotion criteria fully met.system Role into messages[] — A Field Guide to Cluster 16 with Operator Workaround](https://gist.github.com/yurukusa/05c120466996734f7bc2ad6d41fdedec) — ~2,786-word English-language writeup. Promoted from candidate to full cluster status at 17:30 JST after the filing count crossed the threshold within 48 hours of v2.1.154 release. Claude Code v2.1.154 onward serializes system-role entries (from SessionStart hook context, plugin context, Skill metadata, or compaction summaries) as peer entries inside the messages[] array instead of the top-level system field, producing API Error: 400 messages[1].role must be either 'user' or 'assistant', but got 'system'. Four sub-patterns: 16A custom agents via /agents (#63457, 2026-05-29, clean rollback to v2.1.153 fully resolves), 16B strict Anthropic-compatible providers (#63366 + #63469 5 reactions, has-repro, raw API body captured via OTEL_LOG_RAW_API_BODIES), 16C VS Code extension (#63473 + #63510, same defect propagates through the shared request-assembly path), 16D long-lived session context operations (#63396 Variant 1, compact/clear/model-switch produces invalid messages[0] with role system). Cross-language confirmation via #63395 (Chines~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.