-
Notifications
You must be signed in to change notification settings - Fork 3
Home
Operator-side defenses for Claude Code. MIT-licensed hooks, free interactive diagnostics, and curated guides. Independent operator, not affiliated with Anthropic.
- Token Checkup — 5-question token waste diagnostic
- Version Check — Is your CC version affected by token inflation?
- Cache Health — Paste /cost output for instant cache diagnosis
- Security Checkup — 6-question vulnerability scan
- Hook Selector — Find your ideal hook set
- Sub-Agent Failure Self-Audit — 12-question audit for the four sub-agent failure sub-patterns
Four hooks for the four sub-patterns surfaced in the 2026-05-20–22 cluster on anthropics/claude-code (issues #60987, #61102, #61107, #61167, #61315, #61405, #61547):
| Hook | Catches | PR |
|---|---|---|
| dispatch-receipt | Dispatch fabrication (claim of completion with zero tool calls) | #283 |
| dispatch-allowlist-preflight | Silent stall (sub-agent blocks on hidden condition) | #286 |
| dispatch-liveness-watchdog | Absence of observation and control (12-hour silent hang) | #298 |
| scope-expansion-receipt | Scope expansion (sub-agent output treated as authorization) | #282 (merged) |
Full reference: Sub-Agent Observability — sub-pattern walk-through, case studies, free preview chapters, self-audit tool.
| Hook | Purpose |
|---|---|
| token-budget-guard | Block when cost exceeds threshold |
| large-read-guard | Warn before reading 100KB+ files |
| session-agent-cost-limiter | Cap agents per session |
| compact-alert-notification | Alert on compaction |
Full reference: Token Optimization Guide — free fixes for token waste, known issues, install commands.
| Hook | Purpose |
|---|---|
| destructive-guard | Blocks rm -rf /, git reset --hard, git clean -fd, PowerShell Remove-Item -Recurse -Force
|
| branch-guard | Blocks force-push to main/master |
| secret-guard | Blocks committing .env and credential files |
| scope-guard | Limits filesystem reach to project root |
Install all: npx cc-safe-setup --shield
npx cc-safe-setup # interactive
npx cc-safe-setup --shield # maximum safety preset
npx cc-safe-setup --status # show installed hooks + June 15 cliff countdown
npx cc-safe-setup --verify # run sample inputs against installed hooks749 unique installs in the last 14 days. Docs site.
On 2026-06-15 Anthropic splits programmatic billing: claude -p invocations route to a separate credit bucket from interactive use. Operators running automated agent fleets need to inventory their claude -p cost exposure before the cliff.
- Free 90-second self-audit: Wrong Charge Diagnostic (refund template included)
- Free 7-day worksheet: Trim a $200/mo subscription (cost-per-prompt tracking)
- Decision framework (stay / switch / hybridize): Migration Playbook Edition 2 ($19)
The CLI's --status output shows the remaining days dynamically.
- Sub-Agent Observability — Four sub-patterns + four hooks + preview chapters + self-audit (May 2026 cluster)
- Token Optimization Guide — Free fixes for token waste + known issues
- Claude Code Token FAQ — Common token problems with quick solutions
- CLAUDE.md Best Practices — Write a CLAUDE.md that saves tokens (5 patterns)
The hooks above are MIT-licensed and free regardless of any purchase below. The paid handbooks document the architectural reasoning behind the hooks, the case-study catalog, and the operator-vs-harness boundary mapping.
| Handbook | Subject | Pages | Price |
|---|---|---|---|
| Migration Playbook (Edition 2) | June 15 cliff decision framework | ~50 | $19 |
| Claim-Verify Handbook | Main-agent claim-verify gap (130 cases) | ~80 | $19 |
| Sub-Agent Observability Handbook (ships 2026-05-27) | Four sub-agent failure sub-patterns | 73 | $19 |
| Incident Postmortems | 10 production incidents forensic | ~60 | ¥4,350 |
Monthly digest (operator-side defense updates as new clusters emerge): CC Safety Lab Founder Membership (¥500/mo).
Token Book Chapter 1 — free chapter on the token waste root causes. The full Token Book is 10 chapters, 44K words, on Zenn.
- Discussions — questions, patterns that worked
- Issues — false positives, install issues, hook bug reports
Independent operator. Not affiliated with Anthropic. All hook code and tests in this repo are MIT-licensed.
cc-safe-setup is an independent operator-side defense toolkit for Claude Code. MIT-licensed hooks and tests. Not affiliated with Anthropic. Issues and PRs welcome on the main repo.
Start here
- Home — repo overview, three defense axes
Defense guides
- Sub-Agent Observability — May 2026 cluster, 4 sub-patterns, 4 hooks
- Token Optimization Guide — free fixes for token waste
- CLAUDE.md Best Practices — 5 patterns for token-efficient CLAUDE.md
Quick reference
- Claude Code Token FAQ — common problems + quick fixes
- Claude Code トークン節約ガイド — 日本語版
Free interactive tools
June 15 cliff
Project