cc-safe-setup 29.8.0 → 30.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1017) hide show
  1. package/.claude-plugin/marketplace.json +72 -19
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/CONTRIBUTING.md +7 -2
  4. package/COOKBOOK.md +50 -46
  5. package/LICENSE +21 -0
  6. package/MIGRATION.md +8 -8
  7. package/README.md +421 -512
  8. package/SAFETY_CHECKLIST.md +15 -7
  9. package/SERVICES.md +194 -0
  10. package/SETTINGS_REFERENCE.md +236 -17
  11. package/SKILL.md +5 -5
  12. package/TROUBLESHOOTING.md +35 -14
  13. package/action.yml +12 -4
  14. package/audit/README.md +84 -0
  15. package/audit/audit-checklist.md +152 -0
  16. package/audit/boundary-selftest.sh +85 -0
  17. package/audit/boundary.sh +123 -0
  18. package/audit/count-hooks.py +42 -0
  19. package/audit/find-dead-hooks.sh +82 -0
  20. package/audit/find-unfirable-rules.sh +142 -0
  21. package/audit/fire.sh +97 -0
  22. package/audit/selftest.sh +42 -0
  23. package/audit/unfirable-selftest.sh +81 -0
  24. package/audit-web/index.html +9 -9
  25. package/examples/README.md +54 -17
  26. package/examples/account-billing-log.sh +98 -0
  27. package/examples/account-routing-preflight.sh +123 -0
  28. package/examples/agent-sdk-credit-pool-monitor.sh +145 -0
  29. package/examples/agent-view-quota-decrement.sh +32 -0
  30. package/examples/agent-view-quota-warn.sh +94 -0
  31. package/examples/agents-md-edit-drift-warner.sh +223 -0
  32. package/examples/agents-md-loader.sh +160 -0
  33. package/examples/agents-md-sync-checker.sh +102 -0
  34. package/examples/ai-slop-punctuation-arrest.sh +210 -0
  35. package/examples/allowlist.sh +70 -10
  36. package/examples/always-allow-pattern-suggester.sh +125 -0
  37. package/examples/ansible-vault-guard.sh +2 -1
  38. package/examples/anthropic-base-url-guard.sh +76 -0
  39. package/examples/api-busyloop-guard.sh +123 -0
  40. package/examples/api-endpoint-guard.sh +12 -0
  41. package/examples/api-key-in-url-guard.sh +17 -1
  42. package/examples/api-rate-limit-guard.sh +36 -1
  43. package/examples/api-rate-limit-tracker.sh +12 -0
  44. package/examples/articulated-scope-capture.sh +101 -0
  45. package/examples/askuserquestion-autonomy-gate.sh +102 -0
  46. package/examples/attachment-traversal-guard.sh +118 -0
  47. package/examples/aup-block-pattern-logger.sh +161 -0
  48. package/examples/aup-false-positive-helper.sh +124 -0
  49. package/examples/aup-large-tool-output-warner.sh +282 -0
  50. package/examples/aup-retry-loop-guard.sh +229 -0
  51. package/examples/auth-expiry-reminder.sh +157 -0
  52. package/examples/auth-macos-sleep-detector.sh +185 -0
  53. package/examples/auth-path-detector.sh +171 -0
  54. package/examples/auth-status-checker.sh +157 -0
  55. package/examples/authorized-reconfirmation-detector.sh +195 -0
  56. package/examples/auto-approve-build.sh +39 -0
  57. package/examples/auto-approve-cargo.sh +31 -1
  58. package/examples/auto-approve-docker.sh +35 -0
  59. package/examples/auto-approve-git-read.sh +37 -14
  60. package/examples/auto-approve-go.sh +30 -1
  61. package/examples/auto-approve-gradle.sh +29 -1
  62. package/examples/auto-approve-make.sh +29 -1
  63. package/examples/auto-approve-maven.sh +29 -1
  64. package/examples/auto-approve-python.sh +41 -1
  65. package/examples/auto-approve-readonly-tools.sh +1 -0
  66. package/examples/auto-approve-readonly.sh +110 -33
  67. package/examples/auto-approve-ssh.sh +30 -1
  68. package/examples/auto-approve-test.sh +44 -0
  69. package/examples/auto-checkpoint.sh +1 -1
  70. package/examples/auto-compact-prep.sh +0 -0
  71. package/examples/auto-git-checkpoint.sh +0 -0
  72. package/examples/auto-mode-safe-commands.sh +53 -1
  73. package/examples/auto-mode-safety-enforcer.sh +151 -4
  74. package/examples/auto-push-session-branch.sh +22 -0
  75. package/examples/aws-production-guard.sh +13 -1
  76. package/examples/aws-region-guard.sh +1 -1
  77. package/examples/background-cost-launch-guard.sh +82 -0
  78. package/examples/background-task-guard.sh +12 -0
  79. package/examples/backup-before-refactor.sh +0 -0
  80. package/examples/banned-command-guard.sh +12 -0
  81. package/examples/bash-allowlist-secondary-check.sh +157 -0
  82. package/examples/bash-domain-allowlist.sh +12 -0
  83. package/examples/bash-fanout-bounded-rewriter.sh +191 -0
  84. package/examples/bash-heuristic-approver.sh +112 -10
  85. package/examples/bash-project-fence.sh +194 -0
  86. package/examples/bash-safety-auto-deny.sh +12 -0
  87. package/examples/bash-secret-output-detector.sh +44 -3
  88. package/examples/bash-trace-guard.sh +12 -0
  89. package/examples/bashrc-safety-check.sh +0 -0
  90. package/examples/bg-permission-prompt-warner.sh +182 -0
  91. package/examples/bg-task-cooldown-guard.sh +12 -0
  92. package/examples/binary-read-detector.sh +135 -0
  93. package/examples/binary-upload-guard.sh +12 -0
  94. package/examples/block-database-wipe.sh +35 -10
  95. package/examples/branch-name-check.sh +8 -3
  96. package/examples/branch-naming-convention.sh +0 -0
  97. package/examples/broad-find-guard.sh +12 -0
  98. package/examples/broad-prefix-session-trap-warner.sh +106 -0
  99. package/examples/bulk-file-delete-guard.sh +45 -0
  100. package/examples/bypass-mode-effective-verifier.sh +203 -0
  101. package/examples/cache-creation-drift-detector.sh +120 -0
  102. package/examples/cache-residue-detector.sh +195 -0
  103. package/examples/cache-tier-logger.sh +70 -0
  104. package/examples/cache-ttl-eviction-detector.sh +149 -0
  105. package/examples/cargo-publish-guard.sh +14 -1
  106. package/examples/case-insensitive-path-guard.sh +21 -2
  107. package/examples/case-sensitive-guard.sh +23 -2
  108. package/examples/cch-cache-guard.sh +0 -0
  109. package/examples/cch-sentinel-precommit-guard.sh +47 -0
  110. package/examples/check-abort-controller.sh +1 -1
  111. package/examples/check-accessibility.sh +0 -0
  112. package/examples/check-aria-labels.sh +0 -0
  113. package/examples/check-before-act-enforcer.sh +12 -0
  114. package/examples/check-charset-meta.sh +0 -0
  115. package/examples/check-cookie-flags.sh +0 -0
  116. package/examples/check-cors-config.sh +0 -0
  117. package/examples/check-csp-headers.sh +0 -0
  118. package/examples/check-csrf-protection.sh +0 -0
  119. package/examples/check-debounce.sh +1 -1
  120. package/examples/check-dependency-age.sh +0 -0
  121. package/examples/check-dependency-license.sh +0 -0
  122. package/examples/check-dockerfile-best-practice.sh +0 -0
  123. package/examples/check-error-boundaries.sh +0 -0
  124. package/examples/check-error-class.sh +1 -1
  125. package/examples/check-error-handling.sh +0 -0
  126. package/examples/check-error-logging.sh +1 -1
  127. package/examples/check-error-message.sh +0 -0
  128. package/examples/check-error-stack.sh +0 -0
  129. package/examples/check-favicon.sh +0 -0
  130. package/examples/check-git-hooks-compat.sh +0 -0
  131. package/examples/check-gitattributes.sh +0 -0
  132. package/examples/check-https-redirect.sh +0 -0
  133. package/examples/check-input-validation.sh +0 -0
  134. package/examples/check-lang-attribute.sh +0 -0
  135. package/examples/check-npm-scripts-exist.sh +0 -0
  136. package/examples/check-package-size.sh +0 -0
  137. package/examples/check-port-availability.sh +0 -0
  138. package/examples/check-promise-all.sh +1 -1
  139. package/examples/check-rate-limiting.sh +0 -0
  140. package/examples/check-return-types.sh +0 -0
  141. package/examples/check-semantic-versioning.sh +0 -0
  142. package/examples/check-suspense-fallback.sh +1 -1
  143. package/examples/check-test-exists.sh +0 -0
  144. package/examples/check-test-naming.sh +0 -0
  145. package/examples/check-timeout-cleanup.sh +1 -1
  146. package/examples/check-tls-version.sh +0 -0
  147. package/examples/check-unsubscribe.sh +1 -1
  148. package/examples/check-viewport-meta.sh +0 -0
  149. package/examples/check-worker-terminate.sh +1 -1
  150. package/examples/checkpoint-tamper-guard.sh +12 -0
  151. package/examples/chmod-guard.sh +12 -0
  152. package/examples/chown-guard.sh +24 -0
  153. package/examples/ci-workflow-guard.sh +6 -1
  154. package/examples/claim-verify-detector.sh +109 -0
  155. package/examples/claim-vs-caveat-checker.sh +77 -0
  156. package/examples/classifier-fallback-allow.sh +114 -40
  157. package/examples/claude-cache-gc.sh +1 -0
  158. package/examples/claude-code-version-pin-advisor.sh +183 -0
  159. package/examples/claude-md-reinjector.sh +129 -0
  160. package/examples/claude-md-size-monitor.sh +66 -0
  161. package/examples/claude-update-budget-guard.sh +123 -0
  162. package/examples/claude-update-smart.sh +113 -0
  163. package/examples/claudeignore-enforce-guard.sh +12 -0
  164. package/examples/claudemd-enforcer.sh +0 -0
  165. package/examples/claudemd-tool-prohibition.sh +128 -0
  166. package/examples/clear-command-confirm-guard.sh +32 -15
  167. package/examples/cli-config-pinning-detector.sh +162 -0
  168. package/examples/cliff-countdown-advisor.sh +96 -0
  169. package/examples/clipboard-secret-guard.sh +12 -0
  170. package/examples/closure-word-verify-gate.sh +150 -0
  171. package/examples/cloud-cli-guard.sh +39 -2
  172. package/examples/commit-all-scope-guard.sh +44 -0
  173. package/examples/commit-message-check.sh +1 -1
  174. package/examples/commit-message-quality.sh +6 -1
  175. package/examples/commitment-carry-forward-arrest.sh +361 -0
  176. package/examples/compact-alert-notification.sh +0 -0
  177. package/examples/compact-dispatch-watchdog.sh +149 -0
  178. package/examples/completion-claim-without-verification-detector.sh +207 -0
  179. package/examples/composer-guard.sh +12 -0
  180. package/examples/compound-bash-permission-resolver.sh +156 -0
  181. package/examples/compound-command-allow.sh +1 -1
  182. package/examples/compound-command-deny-enforcer.sh +183 -0
  183. package/examples/compound-inject-guard.sh +12 -0
  184. package/examples/concurrent-edit-lock.sh +12 -0
  185. package/examples/conflict-marker-guard.sh +12 -0
  186. package/examples/consecutive-error-breaker.sh +0 -0
  187. package/examples/console-log-count.sh +1 -0
  188. package/examples/context-compact-advisor.sh +29 -2
  189. package/examples/context-length-budget.sh +69 -0
  190. package/examples/context-threshold-alert.sh +12 -0
  191. package/examples/context-usage-drift-alert.sh +41 -13
  192. package/examples/conversation-history-guard.sh +12 -0
  193. package/examples/core-file-protect-guard.sh +12 -0
  194. package/examples/cors-star-warn.sh +0 -0
  195. package/examples/cost-incident-self-audit.sh +162 -0
  196. package/examples/cowork-claude-md-load-checker.sh +100 -0
  197. package/examples/cowork-fuse-staleness-watcher.sh +140 -0
  198. package/examples/cowork-hook-absence-warner.sh +167 -0
  199. package/examples/cowork-model-picker-advisor.sh +115 -0
  200. package/examples/credential-exfil-guard.sh +65 -4
  201. package/examples/credential-file-cat-guard.sh +17 -1
  202. package/examples/cron-create-receipt.sh +112 -0
  203. package/examples/cron-modification-guard.sh +12 -0
  204. package/examples/cross-product-mcp-spawn-detector.sh +178 -0
  205. package/examples/cwd-project-boundary-guard.sh +0 -0
  206. package/examples/daemon-zombie-worker-surfacer.sh +118 -0
  207. package/examples/daily-cost-guard.sh +164 -0
  208. package/examples/daily-usage-tracker.sh +0 -0
  209. package/examples/dangerous-pip-flag-guard.sh +12 -0
  210. package/examples/db-connect-guard.sh +13 -1
  211. package/examples/denied-action-retry-guard.sh +12 -0
  212. package/examples/deny-bypass-detector.sh +12 -0
  213. package/examples/deny-rule-integrity-verifier.sh +181 -0
  214. package/examples/dependency-install-guard.sh +12 -0
  215. package/examples/deploy-guard.sh +14 -2
  216. package/examples/deploy-path-verify-guard.sh +12 -0
  217. package/examples/deployment-readback-gate.sh +135 -0
  218. package/examples/deployment-readback-gh-adapter.sh +247 -0
  219. package/examples/deployment-verify-guard.sh +25 -2
  220. package/examples/destructive-db-script-write-guard.sh +166 -0
  221. package/examples/destructive-migration-write-guard.sh +163 -0
  222. package/examples/diff-size-guard.sh +12 -0
  223. package/examples/disabled-feature-toggle-advisor.sh +88 -0
  224. package/examples/disk-partition-guard.sh +12 -0
  225. package/examples/dispatch-allowlist-preflight.sh +301 -0
  226. package/examples/dispatch-liveness-watchdog.sh +216 -0
  227. package/examples/dispatch-receipt.sh +174 -0
  228. package/examples/django-migrate-guard.sh +12 -0
  229. package/examples/dns-config-guard.sh +12 -0
  230. package/examples/docker-dangerous-guard.sh +12 -0
  231. package/examples/docker-volume-guard.sh +0 -0
  232. package/examples/dockerfile-latest-guard.sh +1 -0
  233. package/examples/dotenv-anthropic-key-billing-guard.sh +99 -0
  234. package/examples/dotenv-commit-guard.sh +12 -0
  235. package/examples/dotenv-read-guard.sh +12 -0
  236. package/examples/dotfile-protection-guard.sh +12 -0
  237. package/examples/dotnet-build-on-edit.sh +1 -1
  238. package/examples/drizzle-migrate-guard.sh +27 -2
  239. package/examples/echo-probe-spam-detector.sh +176 -0
  240. package/examples/edit-counter-test-gate.sh +12 -0
  241. package/examples/edit-error-counter.sh +1 -1
  242. package/examples/edit-guard.sh +12 -0
  243. package/examples/edit-old-string-validator.sh +12 -0
  244. package/examples/edit-quote-ambiguity-guard.sh +97 -0
  245. package/examples/edit-retry-loop-guard.sh +0 -0
  246. package/examples/edit-verify.sh +0 -0
  247. package/examples/env-inline-secret-guard.sh +14 -2
  248. package/examples/env-naming-convention.sh +0 -0
  249. package/examples/env-prod-guard.sh +0 -0
  250. package/examples/env-required-check.sh +0 -0
  251. package/examples/env-source-guard.sh +12 -0
  252. package/examples/env-var-check.sh +24 -1
  253. package/examples/ephemeral-container-detector.sh +147 -0
  254. package/examples/error-memory-guard.sh +12 -0
  255. package/examples/evidence-claim-gate.sh +187 -0
  256. package/examples/exploration-budget-guard.sh +12 -0
  257. package/examples/expo-eject-guard.sh +13 -0
  258. package/examples/extended-thinking-loop-guard.sh +139 -0
  259. package/examples/extended-thinking-resume-warning.sh +119 -0
  260. package/examples/extended-thinking-tool-use-mismatch-detector.sh +212 -0
  261. package/examples/fabricated-command-detector.sh +145 -0
  262. package/examples/false-disk-full-guard.sh +63 -0
  263. package/examples/feature-deprecation-detector.sh +109 -0
  264. package/examples/file-change-tracker.sh +1 -1
  265. package/examples/file-change-undo-tracker.sh +0 -0
  266. package/examples/file-edit-backup.sh +63 -14
  267. package/examples/file-reference-check.sh +0 -0
  268. package/examples/file-size-limit.sh +12 -0
  269. package/examples/financial-operation-guard.sh +12 -0
  270. package/examples/firewall-guard.sh +12 -0
  271. package/examples/fish-shell-wrapper.sh +125 -7
  272. package/examples/five-hundred-milestone.sh +1 -0
  273. package/examples/flask-static-route-guard.sh +89 -0
  274. package/examples/forbidden-response-phrase-detector.sh +161 -0
  275. package/examples/gem-push-guard.sh +13 -0
  276. package/examples/gh-cli-destructive-guard.sh +13 -1
  277. package/examples/git-checkout-safety-guard.sh +12 -0
  278. package/examples/git-checkout-uncommitted-guard.sh +12 -0
  279. package/examples/git-config-guard.sh +12 -0
  280. package/examples/git-crypt-worktree-guard.sh +12 -0
  281. package/examples/git-filter-repo-guard.sh +56 -0
  282. package/examples/git-history-rewrite-guard.sh +12 -0
  283. package/examples/git-hook-bypass-guard.sh +0 -0
  284. package/examples/git-maintenance-guard.sh +83 -0
  285. package/examples/git-merge-conflict-prevent.sh +0 -0
  286. package/examples/git-message-length-check.sh +0 -0
  287. package/examples/git-message-length.sh +0 -0
  288. package/examples/git-operations-require-approval.sh +68 -14
  289. package/examples/git-pack-temp-cleanup-guard.sh +102 -0
  290. package/examples/git-push-blast-radius-guard.sh +218 -0
  291. package/examples/git-remote-guard.sh +24 -3
  292. package/examples/git-rm-orphan-wipe-guard.sh +85 -0
  293. package/examples/git-stash-before-checkout.sh +12 -0
  294. package/examples/git-stash-before-danger.sh +0 -0
  295. package/examples/git-submodule-guard.sh +69 -2
  296. package/examples/git-tag-guard.sh +12 -0
  297. package/examples/github-actions-secret-guard.sh +0 -0
  298. package/examples/gitignore-check.sh +0 -0
  299. package/examples/gitops-drift-guard.sh +12 -0
  300. package/examples/go-mod-tidy-warn.sh +1 -0
  301. package/examples/go-vet-after-edit.sh +12 -0
  302. package/examples/goal-iteration-limit-warner.sh +152 -0
  303. package/examples/grep-nul-false-negative-guard.sh +30 -0
  304. package/examples/growthbook-flag-monitor.sh +257 -0
  305. package/examples/hallucination-url-check.sh +1 -1
  306. package/examples/halt-signal-detector.sh +135 -0
  307. package/examples/handoff-on-clear.sh +65 -0
  308. package/examples/hardcoded-ip-guard.sh +1 -0
  309. package/examples/headless-empty-result-guard.sh +0 -0
  310. package/examples/headless-stop-guard.sh +0 -0
  311. package/examples/helm-install-guard.sh +2 -1
  312. package/examples/home-critical-bash-guard.sh +17 -1
  313. package/examples/hook-debug-wrapper.sh +6 -2
  314. package/examples/hook-permission-fixer.sh +0 -0
  315. package/examples/hook-self-disable-detector.sh +99 -0
  316. package/examples/hook-stdout-sanitizer.sh +6 -2
  317. package/examples/hook-tamper-guard.sh +12 -0
  318. package/examples/idle-session-cost-alert.sh +0 -0
  319. package/examples/image-dimension-guard.sh +109 -0
  320. package/examples/image-file-validator.sh +0 -0
  321. package/examples/iteration-quality-degradation-detector.sh +170 -0
  322. package/examples/java-compile-on-edit.sh +1 -1
  323. package/examples/json-syntax-check.sh +0 -0
  324. package/examples/k8s-production-guard.sh +13 -1
  325. package/examples/kill-process-guard.sh +12 -0
  326. package/examples/kubernetes-guard.sh +13 -1
  327. package/examples/laravel-artisan-guard.sh +13 -0
  328. package/examples/large-file-guard.sh +1 -1
  329. package/examples/log-level-guard.sh +0 -0
  330. package/examples/log-truncation-guard.sh +12 -0
  331. package/examples/long-session-malformed-tool-call-detector.sh +183 -0
  332. package/examples/loop-detector.sh +12 -0
  333. package/examples/magic-number-warn.sh +1 -0
  334. package/examples/main-branch-warn.sh +12 -0
  335. package/examples/markdown-link-check.sh +0 -0
  336. package/examples/max-concurrent-agents.sh +12 -0
  337. package/examples/max-edit-size-guard.sh +13 -0
  338. package/examples/max-file-count-guard.sh +0 -0
  339. package/examples/max-file-delete-count.sh +0 -0
  340. package/examples/max-function-length.sh +1 -0
  341. package/examples/max-import-count.sh +0 -0
  342. package/examples/max-subagent-count.sh +0 -0
  343. package/examples/mcp-config-freeze.sh +12 -0
  344. package/examples/mcp-config-poisoning-audit.sh +150 -0
  345. package/examples/mcp-data-boundary.sh +1 -1
  346. package/examples/mcp-misdiagnosis-arrest.sh +209 -0
  347. package/examples/mcp-orphan-leak-warner.sh +49 -0
  348. package/examples/mcp-permissions-ask-warner.sh +151 -0
  349. package/examples/mcp-routine-approval-detector.sh +154 -0
  350. package/examples/mcp-server-allowlist.sh +12 -0
  351. package/examples/mcp-server-guard.sh +12 -0
  352. package/examples/mcp-startup-bloat-detector.sh +87 -0
  353. package/examples/mcp-stdio-compatibility-test.sh +153 -0
  354. package/examples/mcp-tool-audit-log.sh +0 -0
  355. package/examples/mcp-tool-guard.sh +101 -1
  356. package/examples/mcp-warmup-wait.sh +0 -0
  357. package/examples/memory-chain-audit.sh +56 -0
  358. package/examples/memory-orphan-detector.sh +188 -0
  359. package/examples/memory-write-guard.sh +99 -17
  360. package/examples/migration-verify-guard.sh +12 -0
  361. package/examples/model-swap-suggester.sh +177 -0
  362. package/examples/model-version-alert.sh +5 -1
  363. package/examples/model-version-lock.sh +63 -0
  364. package/examples/move-delete-sequence-guard.sh +33 -2
  365. package/examples/multi-file-plan-routing-gate.sh +192 -0
  366. package/examples/multi-vendor-concurrent-warner.sh +108 -0
  367. package/examples/multi-window-auth-drift-detector.sh +183 -0
  368. package/examples/multiline-command-approver.sh +161 -23
  369. package/examples/nested-background-agent-guard.sh +109 -0
  370. package/examples/nested-spawn-inflight-guard.sh +178 -0
  371. package/examples/network-exfil-guard.sh +12 -0
  372. package/examples/network-guard.sh +12 -0
  373. package/examples/network-interface-guard.sh +12 -0
  374. package/examples/nextjs-env-guard.sh +1 -1
  375. package/examples/no-absolute-import.sh +0 -0
  376. package/examples/no-alert-confirm-prompt.sh +0 -0
  377. package/examples/no-anonymous-default-export.sh +0 -0
  378. package/examples/no-any-type.sh +0 -0
  379. package/examples/no-any-typescript.sh +1 -0
  380. package/examples/no-ask-human.sh +12 -0
  381. package/examples/no-assignment-in-condition.sh +0 -0
  382. package/examples/no-base64-exfil.sh +12 -0
  383. package/examples/no-callback-hell.sh +0 -0
  384. package/examples/no-circular-dependency.sh +0 -0
  385. package/examples/no-cleartext-storage.sh +0 -0
  386. package/examples/no-commented-code.sh +0 -0
  387. package/examples/no-commit-fixup.sh +0 -0
  388. package/examples/no-console-assert.sh +0 -0
  389. package/examples/no-console-error-swallow.sh +0 -0
  390. package/examples/no-console-in-prod.sh +0 -0
  391. package/examples/no-console-log-commit.sh +12 -0
  392. package/examples/no-console-log.sh +0 -0
  393. package/examples/no-console-time.sh +0 -0
  394. package/examples/no-cors-wildcard.sh +4 -1
  395. package/examples/no-curl-upload.sh +0 -0
  396. package/examples/no-dangerouslySetInnerHTML.sh +0 -0
  397. package/examples/no-dangling-await.sh +1 -0
  398. package/examples/no-debug-commit.sh +12 -0
  399. package/examples/no-debug-in-commit.sh +0 -0
  400. package/examples/no-deep-nesting.sh +0 -0
  401. package/examples/no-deep-relative-import.sh +1 -0
  402. package/examples/no-default-credentials.sh +0 -0
  403. package/examples/no-deploy-friday.sh +13 -1
  404. package/examples/no-disabled-test.sh +0 -0
  405. package/examples/no-document-write.sh +0 -0
  406. package/examples/no-empty-function.sh +0 -0
  407. package/examples/no-eval-in-template.sh +0 -0
  408. package/examples/no-eval-template.sh +3 -1
  409. package/examples/no-eval.sh +0 -0
  410. package/examples/no-exec-user-input.sh +0 -0
  411. package/examples/no-fixme-ship.sh +12 -0
  412. package/examples/no-floating-promises.sh +0 -0
  413. package/examples/no-force-flag.sh +22 -5
  414. package/examples/no-force-install.sh +0 -0
  415. package/examples/no-git-amend.sh +12 -0
  416. package/examples/no-git-rebase-public.sh +0 -0
  417. package/examples/no-global-install.sh +12 -0
  418. package/examples/no-global-state.sh +0 -0
  419. package/examples/no-hardcoded-port.sh +1 -0
  420. package/examples/no-hardcoded-url.sh +0 -0
  421. package/examples/no-helmet-missing.sh +0 -0
  422. package/examples/no-http-url.sh +1 -0
  423. package/examples/no-http-without-https.sh +0 -0
  424. package/examples/no-inline-style.sh +0 -0
  425. package/examples/no-inline-styles.sh +1 -0
  426. package/examples/no-innerhtml.sh +0 -0
  427. package/examples/no-install-global.sh +12 -0
  428. package/examples/no-jwt-in-url.sh +0 -0
  429. package/examples/no-large-commit.sh +0 -0
  430. package/examples/no-localhost-expose.sh +0 -0
  431. package/examples/no-magic-number.sh +0 -0
  432. package/examples/no-md5-sha1.sh +0 -0
  433. package/examples/no-mixed-line-endings.sh +8 -1
  434. package/examples/no-mutation-in-reducer.sh +0 -0
  435. package/examples/no-nested-ternary.sh +0 -0
  436. package/examples/no-network-exfil.sh +0 -0
  437. package/examples/no-open-redirect.sh +0 -0
  438. package/examples/no-output-truncation.sh +12 -0
  439. package/examples/no-package-downgrade.sh +0 -0
  440. package/examples/no-package-lock-edit.sh +12 -0
  441. package/examples/no-path-join-user-input.sh +0 -0
  442. package/examples/no-port-bind.sh +0 -0
  443. package/examples/no-process-exit.sh +0 -0
  444. package/examples/no-prototype-pollution.sh +0 -0
  445. package/examples/no-push-without-ci.sh +0 -0
  446. package/examples/no-push-without-tests.sh +12 -0
  447. package/examples/no-raw-password-in-url.sh +0 -0
  448. package/examples/no-root-user-docker.sh +1 -0
  449. package/examples/no-root-write.sh +12 -0
  450. package/examples/no-secrets-in-args.sh +4 -1
  451. package/examples/no-secrets-in-logs.sh +0 -0
  452. package/examples/no-sensitive-log.sh +0 -0
  453. package/examples/no-sleep-in-hooks.sh +0 -0
  454. package/examples/no-star-import-python.sh +1 -0
  455. package/examples/no-string-concat-sql.sh +0 -0
  456. package/examples/no-sudo-guard.sh +12 -0
  457. package/examples/no-sync-fs.sh +0 -0
  458. package/examples/no-todo-in-merge.sh +0 -0
  459. package/examples/no-todo-in-production.sh +1 -0
  460. package/examples/no-todo-without-issue.sh +0 -0
  461. package/examples/no-unused-import.sh +0 -0
  462. package/examples/no-var-keyword.sh +0 -0
  463. package/examples/no-verify-blocker.sh +12 -0
  464. package/examples/no-wget-piped-bash.sh +12 -0
  465. package/examples/no-wildcard-cors.sh +0 -0
  466. package/examples/no-wildcard-delete.sh +0 -0
  467. package/examples/no-wildcard-import.sh +0 -0
  468. package/examples/no-with-statement.sh +0 -0
  469. package/examples/no-write-outside-src.sh +0 -0
  470. package/examples/no-xml-external-entity.sh +0 -0
  471. package/examples/non-english-quality-warner.sh +156 -0
  472. package/examples/notify-waiting.sh +1 -1
  473. package/examples/npm-audit-warn.sh +0 -0
  474. package/examples/npm-global-install-guard.sh +12 -0
  475. package/examples/npm-publish-guard.sh +12 -0
  476. package/examples/npm-script-injection.sh +0 -0
  477. package/examples/npm-supply-chain-guard.sh +0 -0
  478. package/examples/nuxt-config-guard.sh +1 -0
  479. package/examples/oauth-refresh-monitor.sh +210 -0
  480. package/examples/opus-degradation-tracker.sh +187 -0
  481. package/examples/opus48-routine-task-warning.sh +196 -0
  482. package/examples/opus48-thinking-wedge-advisor.sh +143 -0
  483. package/examples/output-credential-scan.sh +1 -1
  484. package/examples/output-secret-mask.sh +31 -9
  485. package/examples/output-token-spike-detector.sh +145 -0
  486. package/examples/package-json-guard.sh +12 -0
  487. package/examples/package-lock-frozen.sh +12 -0
  488. package/examples/parallel-batch-size-limiter.sh +121 -0
  489. package/examples/parallel-cascade-detector.sh +116 -0
  490. package/examples/partial-view-claim-arrest.sh +174 -0
  491. package/examples/path-deny-bash-guard.sh +12 -0
  492. package/examples/path-traversal-guard.sh +12 -0
  493. package/examples/per-prompt-token-cap.sh +124 -0
  494. package/examples/permission-audit-log.sh +1 -1
  495. package/examples/permission-denial-enforcer.sh +12 -0
  496. package/examples/permission-entry-validator.sh +0 -0
  497. package/examples/persisted-1m-model-advisor.sh +88 -0
  498. package/examples/php-lint-on-edit.sh +1 -1
  499. package/examples/pii-upload-guard.sh +12 -0
  500. package/examples/pip-publish-guard.sh +13 -0
  501. package/examples/pip-requirements-guard.sh +12 -0
  502. package/examples/pip-venv-required.sh +12 -0
  503. package/examples/plan-mode-edit-guard.sh +12 -0
  504. package/examples/plan-mode-enforcer.sh +12 -0
  505. package/examples/plan-mode-strict-guard.sh +12 -0
  506. package/examples/plugin-hooks-json-bloat-detector.sh +169 -0
  507. package/examples/plugin-process-cleanup.sh +0 -0
  508. package/examples/polyglot-rm-guard.sh +12 -0
  509. package/examples/post-compact-safety.sh +12 -0
  510. package/examples/post-edit-disk-verify.sh +152 -0
  511. package/examples/powershell-remove-item-guard.sh +85 -0
  512. package/examples/pr-description-check.sh +0 -0
  513. package/examples/pr-duplicate-guard.sh +13 -0
  514. package/examples/pre-bash-sed-line-ending-windows.sh +87 -0
  515. package/examples/pre-compact-knowledge-save.sh +0 -0
  516. package/examples/pre-compact-transcript-backup.sh +0 -0
  517. package/examples/pre-execution-claim-detector.sh +179 -0
  518. package/examples/prefer-builtin-tools.sh +10 -1
  519. package/examples/prefer-const.sh +0 -0
  520. package/examples/prefer-dedicated-tools.sh +12 -0
  521. package/examples/prefer-optional-chaining.sh +0 -0
  522. package/examples/prisma-migrate-guard.sh +24 -7
  523. package/examples/production-port-kill-guard.sh +12 -0
  524. package/examples/prompt-injection-guard.sh +2 -1
  525. package/examples/prompt-usage-logger.sh +0 -0
  526. package/examples/protect-claudemd.sh +12 -0
  527. package/examples/protect-dotfiles.sh +12 -0
  528. package/examples/proxy-capture-suggester.sh +159 -0
  529. package/examples/public-artefact-socratic-narrowing.sh +232 -0
  530. package/examples/public-repo-push-guard.sh +12 -0
  531. package/examples/push-requires-test-pass-record.sh +0 -0
  532. package/examples/push-requires-test-pass.sh +12 -0
  533. package/examples/quota-anomaly-detector.sh +173 -0
  534. package/examples/quota-reset-audit.sh +58 -0
  535. package/examples/quoted-flag-approver.sh +99 -10
  536. package/examples/rails-migration-guard.sh +12 -0
  537. package/examples/rate-limit-guard.sh +0 -0
  538. package/examples/read-all-files-enforcer.sh +0 -0
  539. package/examples/read-budget-guard.sh +12 -0
  540. package/examples/read-loop-detector.sh +59 -0
  541. package/examples/read-once-guard.sh +96 -0
  542. package/examples/read-only-mode.sh +12 -0
  543. package/examples/readme-exists-check.sh +0 -0
  544. package/examples/record-read-coverage.sh +73 -0
  545. package/examples/redirect-fragment-warner.sh +149 -0
  546. package/examples/redis-flushall-guard.sh +13 -0
  547. package/examples/redundant-read-blocker.sh +132 -0
  548. package/examples/refusal-arrest-gate.sh +248 -0
  549. package/examples/registry-publish-guard.sh +13 -1
  550. package/examples/remote-control-billing-classifier.sh +135 -0
  551. package/examples/replace-all-guard.sh +12 -0
  552. package/examples/repo-visibility-guard.sh +12 -0
  553. package/examples/reroute-after-block-guard.sh +150 -0
  554. package/examples/response-budget-guard.sh +0 -0
  555. package/examples/resume-drift-watcher.sh +57 -0
  556. package/examples/rg-replace-flag-detector.sh +125 -0
  557. package/examples/rhetorical-verification-prompt-detector.sh +102 -0
  558. package/examples/ripgrep-permission-fix.sh +0 -0
  559. package/examples/rm-safety-net.sh +151 -8
  560. package/examples/role-tool-guard.sh +12 -0
  561. package/examples/route-handler-emptiness-gate.sh +324 -0
  562. package/examples/ruby-lint-on-edit.sh +1 -1
  563. package/examples/runtime-binary-change-detector.sh +102 -0
  564. package/examples/same-command-repeat-detector.sh +196 -0
  565. package/examples/same-correction-arrest.sh +169 -0
  566. package/examples/sandbox-denywrite-enforcer.sh +78 -0
  567. package/examples/sandbox-relative-path-audit.sh +83 -25
  568. package/examples/sandbox-write-verify.sh +12 -0
  569. package/examples/schema-migration-guard.sh +0 -0
  570. package/examples/scope-expansion-receipt.sh +178 -0
  571. package/examples/scope-guard.sh +88 -9
  572. package/examples/secret-file-read-guard.sh +12 -0
  573. package/examples/secret-file-write-guard.sh +150 -0
  574. package/examples/self-modify-bypass-guard.sh +0 -0
  575. package/examples/sensitive-file-read-guard.sh +23 -3
  576. package/examples/sensitive-log-guard.sh +1 -0
  577. package/examples/server-side-prompt-injection-detector.sh +69 -0
  578. package/examples/session-agent-cost-limiter.sh +12 -0
  579. package/examples/session-backup-on-start.sh +1 -1
  580. package/examples/session-cost-alert.sh +12 -0
  581. package/examples/session-drift-guard.sh +12 -0
  582. package/examples/session-duration-guard.sh +25 -2
  583. package/examples/session-end-logger.sh +0 -0
  584. package/examples/session-health-monitor.sh +0 -0
  585. package/examples/session-index-repair.sh +1 -1
  586. package/examples/session-memory-watchdog.sh +1 -0
  587. package/examples/session-permission-reset-guard.sh +12 -0
  588. package/examples/session-persistence-verifier.sh +93 -0
  589. package/examples/session-plugin-pin-watch.sh +68 -0
  590. package/examples/session-rate-monitor.sh +176 -0
  591. package/examples/session-resume-env-fix.sh +0 -0
  592. package/examples/session-start-quota-status.sh +193 -0
  593. package/examples/session-start-safety-check.sh +55 -3
  594. package/examples/session-state-saver.sh +0 -0
  595. package/examples/session-summary-stop.sh +1 -1
  596. package/examples/session-summary.sh +0 -0
  597. package/examples/session-token-counter.sh +1 -1
  598. package/examples/settings-hooks-key-restorer.sh +99 -0
  599. package/examples/settings-json-health-check.sh +57 -0
  600. package/examples/settings-json-model-guard.sh +0 -0
  601. package/examples/settings-regression-tester.sh +188 -0
  602. package/examples/shell-config-truncation-guard.sh +12 -0
  603. package/examples/shell-wrapper-guard.sh +12 -0
  604. package/examples/skill-cumulative-size-detector.sh +104 -0
  605. package/examples/skill-description-drop-detector.sh +148 -0
  606. package/examples/skill-gate.sh +0 -0
  607. package/examples/skill-truncation-detector.sh +154 -0
  608. package/examples/skills-context-recorder.sh +167 -0
  609. package/examples/skills-load-verifier.sh +96 -0
  610. package/examples/skills-settings-validator.sh +139 -0
  611. package/examples/sonnet-45-deprecation-helper.sh +85 -0
  612. package/examples/spec-file-scope-guard.sh +12 -0
  613. package/examples/spring-profile-guard.sh +1 -0
  614. package/examples/spurious-malformed-notice-detector.sh +247 -0
  615. package/examples/sql-bulk-delete-warn.sh +88 -0
  616. package/examples/sql-injection-detect.sh +0 -0
  617. package/examples/ssh-key-protect.sh +12 -0
  618. package/examples/staged-secret-scan.sh +22 -1
  619. package/examples/stale-temp-settings-detector.sh +86 -0
  620. package/examples/standing-rule-session-surfacer.sh +137 -0
  621. package/examples/stop-hook-sigterm-wrapper.sh +182 -0
  622. package/examples/stop-transcript-write-health.sh +64 -0
  623. package/examples/strict-allowlist.sh +57 -15
  624. package/examples/strip-coauthored-by.sh +50 -10
  625. package/examples/subagent-blast-radius-guard.sh +184 -0
  626. package/examples/subagent-boundary-precheck.sh +126 -0
  627. package/examples/subagent-budget-guard.sh +12 -0
  628. package/examples/subagent-claudemd-inject.sh +0 -0
  629. package/examples/subagent-closure-verify-gate.sh +164 -0
  630. package/examples/subagent-destructive-git-guard.sh +120 -0
  631. package/examples/subagent-error-detector.sh +0 -0
  632. package/examples/subagent-forged-system-reminder-guard.sh +156 -0
  633. package/examples/subagent-identity-leak-guard.sh +102 -0
  634. package/examples/subagent-identity-reassertion.sh +51 -0
  635. package/examples/subagent-inheritance-tester.sh +179 -0
  636. package/examples/subagent-permission-mode-guard.sh +110 -0
  637. package/examples/subagent-scope-guard.sh +12 -0
  638. package/examples/subagent-spawn-verification-enforcer.sh +102 -0
  639. package/examples/subagent-tool-allowlist-enforcer.sh +101 -0
  640. package/examples/subagent-tool-call-limiter.sh +87 -15
  641. package/examples/subcommand-chain-guard.sh +12 -0
  642. package/examples/subscription-api-billing-warner.sh +160 -0
  643. package/examples/subscription-bypass-detector.sh +152 -0
  644. package/examples/svelte-lint-on-edit.sh +1 -0
  645. package/examples/swift-build-on-edit.sh +1 -1
  646. package/examples/symlink-guard.sh +27 -2
  647. package/examples/symlink-protect.sh +1 -0
  648. package/examples/system-dir-protection-guard.sh +73 -8
  649. package/examples/system-message-workaround.sh +38 -13
  650. package/examples/system-package-guard.sh +12 -0
  651. package/examples/systemd-service-guard.sh +12 -0
  652. package/examples/task-integrity-guard.sh +12 -0
  653. package/examples/temp-file-cleanup.sh +1 -1
  654. package/examples/temporal-suggestion-detector.sh +135 -0
  655. package/examples/terraform-guard.sh +27 -6
  656. package/examples/test-after-edit.sh +1 -1
  657. package/examples/test-before-push.sh +12 -0
  658. package/examples/test-coverage-reminder.sh +24 -1
  659. package/examples/thinking-budget-effort-mismatch-detector.sh +149 -0
  660. package/examples/timezone-guard.sh +0 -0
  661. package/examples/tmp-output-size-guard.sh +0 -0
  662. package/examples/todo-check.sh +1 -1
  663. package/examples/token-budget-guard.sh +12 -0
  664. package/examples/token-budget-per-task.sh +12 -0
  665. package/examples/token-usage-tracker.sh +7 -1
  666. package/examples/tokenizer-ratio-alert-corpus.sh +90 -0
  667. package/examples/tokenizer-ratio-alert.sh +104 -0
  668. package/examples/tool-call-rate-limiter.sh +0 -0
  669. package/examples/tool-result-correlation-checker.sh +167 -0
  670. package/examples/tool-result-size-guard.sh +132 -0
  671. package/examples/tool-retry-budget-guard.sh +12 -0
  672. package/examples/transcript-contamination-detector.sh +138 -0
  673. package/examples/trustfall-mcp-injection-guard.sh +103 -0
  674. package/examples/ultrareview-large-diff-advisor.sh +184 -0
  675. package/examples/unbounded-output-guard.sh +94 -0
  676. package/examples/uncommitted-changes-stop.sh +1 -0
  677. package/examples/uncommitted-discard-guard.sh +23 -5
  678. package/examples/uncommitted-work-guard.sh +12 -0
  679. package/examples/usage-warn.sh +0 -0
  680. package/examples/user-account-guard.sh +12 -0
  681. package/examples/userprompt-submit-receipt.sh +123 -0
  682. package/examples/variable-expansion-guard.sh +12 -0
  683. package/examples/verify-after-publish-reminder.sh +93 -0
  684. package/examples/verify-before-commit.sh +12 -0
  685. package/examples/version-bump-detector.sh +156 -0
  686. package/examples/version-regression-warner.sh +144 -0
  687. package/examples/vue-lint-on-edit.sh +1 -0
  688. package/examples/warn-cron-cost-trap.sh +173 -0
  689. package/examples/webfetch-runaway-guard.sh +89 -0
  690. package/examples/wellness-break-reminder.sh +118 -0
  691. package/examples/windows-destructive-command-guard.sh +177 -0
  692. package/examples/windows-path-guard.sh +12 -0
  693. package/examples/windows-python-stub-detector.sh +63 -0
  694. package/examples/work-hours-guard.sh +12 -0
  695. package/examples/working-directory-fence.sh +12 -0
  696. package/examples/workspace-lease-guard.sh +205 -0
  697. package/examples/worktree-create-log.sh +1 -0
  698. package/examples/worktree-delete-guard.sh +12 -0
  699. package/examples/worktree-edit-boundary-guard.sh +127 -0
  700. package/examples/worktree-escape-write-guard.sh +114 -0
  701. package/examples/worktree-hook-linker.sh +0 -0
  702. package/examples/worktree-hooks-path-fix.sh +111 -0
  703. package/examples/worktree-parent-write-guard.sh +43 -0
  704. package/examples/worktree-project-unify.sh +2 -1
  705. package/examples/worktree-remove-uncommitted-guard.sh +13 -0
  706. package/examples/worktree-unmerged-guard.sh +7 -1
  707. package/examples/write-byte-integrity-verifier.sh +190 -0
  708. package/examples/write-empty-content-guard.sh +67 -0
  709. package/examples/write-nul-corruption-detector.sh +61 -0
  710. package/examples/write-overwrite-confirm.sh +160 -14
  711. package/examples/write-secret-guard.sh +27 -5
  712. package/examples/write-shrink-guard.sh +12 -0
  713. package/examples/write-test-ratio.sh +0 -0
  714. package/examples/wsl-host-disk-space-guard.sh +97 -0
  715. package/examples/xml-format-leak-detector.sh +266 -0
  716. package/examples/yaml-syntax-check.sh +12 -0
  717. package/hooks/hooks.json +6 -6
  718. package/index.mjs +1718 -183
  719. package/mission.md +2 -0
  720. package/package.json +4 -4
  721. package/plugins/credential-guard/.claude-plugin/plugin.json +9 -7
  722. package/plugins/git-protection/.claude-plugin/plugin.json +10 -8
  723. package/plugins/safety-essentials/.claude-plugin/plugin.json +9 -7
  724. package/plugins/token-guard/.claude-plugin/plugin.json +10 -8
  725. package/scripts/agents-md-sync-setup.sh +156 -0
  726. package/scripts/autonomy-blocked-summary.sh +148 -0
  727. package/scripts/build-search-index.py +43 -0
  728. package/scripts/build-sitemap.py +119 -0
  729. package/scripts/cc-doctor.sh +192 -0
  730. package/scripts/check-hook-event-names.py +127 -0
  731. package/scripts/check-misfire-instrument.sh +64 -0
  732. package/scripts/claim-verify-audit.sh +467 -0
  733. package/scripts/cowork-claudemd-helper.sh +136 -0
  734. package/scripts/june-15-deprecated-model-scan.sh +111 -0
  735. package/scripts/measure-heredoc-shapes.sh +67 -0
  736. package/scripts/measure-literal-match-misfire.sh +110 -0
  737. package/scripts/probe-scope-guard-branches.sh +48 -0
  738. package/scripts/probe-skip-line-both-ways.sh +65 -0
  739. package/scripts/receipts-aggregate.py +199 -0
  740. package/scripts/session-forensic-audit.py +360 -0
  741. package/scripts.json +9 -9
  742. package/scripts.json.bak-2026-07-27-find +13 -0
  743. package/skills/safety-setup/SKILL.md +5 -5
  744. package/tests/approve-side-remaining-two.test.sh +129 -0
  745. package/tests/approver-list-granularity.test.sh +145 -0
  746. package/tests/askuserquestion-autonomy-gate.test.sh +181 -0
  747. package/tests/audit-ci-gate.test.sh +87 -0
  748. package/tests/audit-cross-layer-claudemd.test.sh +170 -0
  749. package/tests/audit-fail-open-parse.test.sh +100 -0
  750. package/tests/auto-approve-compound-tail.test.sh +194 -0
  751. package/tests/auto-mode-path-invoked-commands.test.sh +89 -0
  752. package/tests/auto-mode-quoted-targets.test.sh +127 -0
  753. package/tests/auto-mode-unquoted-targets.test.sh +112 -0
  754. package/tests/bash-secret-output-detector-detects.test.sh +102 -0
  755. package/tests/blindspots-cross-layer.test.sh +177 -0
  756. package/tests/block-database-wipe.test.sh +64 -0
  757. package/tests/bundled-short-flags-bypass.test.sh +85 -0
  758. package/tests/cd-git-allow-compound-tail.test.sh +67 -0
  759. package/tests/chown-guard-filesystem-root.test.sh +64 -0
  760. package/tests/ci-workflow-guard-skip-rule.test.sh +115 -0
  761. package/tests/compound-deny-safe-rm-targets.test.sh +105 -0
  762. package/tests/core-scripts-parser-fallback.test.sh +140 -0
  763. package/tests/destructive-guard-bare-glob.test.sh +74 -0
  764. package/tests/destructive-guard-every-operand.test.sh +100 -0
  765. package/tests/destructive-guard-find-deletion.test.sh +114 -0
  766. package/tests/destructive-guard-flag-order.test.sh +106 -0
  767. package/tests/destructive-guard-mentions-vs-invocations.test.sh +107 -0
  768. package/tests/destructive-guard-quoted-target.test.sh +89 -0
  769. package/tests/destructive-guard-separators.test.sh +105 -0
  770. package/tests/destructive-guard-variable-target.test.sh +98 -0
  771. package/tests/destructive-guard-wrapped-command.test.sh +91 -0
  772. package/tests/doctor-hook-disabling-env.test.sh +92 -0
  773. package/tests/doctor-misspelled-settings-keys.test.sh +106 -0
  774. package/tests/example-guards-wrapped-command.test.sh +169 -0
  775. package/tests/file-edit-backup.test.sh +93 -0
  776. package/tests/git-filter-repo-guard.test.sh +60 -0
  777. package/tests/git-global-options-bypass.test.sh +141 -0
  778. package/tests/git-invocation-prefixes-all-guards.test.sh +114 -0
  779. package/tests/git-maintenance-guard.test.sh +83 -0
  780. package/tests/git-pack-temp-cleanup-guard.test.sh +133 -0
  781. package/tests/git-rm-orphan-wipe-guard.test.sh +66 -0
  782. package/tests/git-submodule-guard.test.sh +50 -0
  783. package/tests/grep-pcre-portability.test.sh +155 -0
  784. package/tests/hook-registration-matches-input.test.sh +73 -0
  785. package/tests/hook-trigger-matches-envelope.test.sh +178 -0
  786. package/tests/install-does-not-claim-protection.test.sh +110 -0
  787. package/tests/install-example-standalone-tools.test.sh +139 -0
  788. package/tests/line-continuation-bypass.test.sh +114 -0
  789. package/tests/mcp-config-poisoning-audit.test.sh +106 -0
  790. package/tests/nested-background-agent-guard.test.sh +58 -0
  791. package/tests/no-unqualified-safety-claims.test.sh +114 -0
  792. package/tests/option-eating-grep-patterns.test.sh +130 -0
  793. package/tests/outdated-core-guards.test.sh +134 -0
  794. package/tests/outdated-report.test.sh +155 -0
  795. package/tests/output-secret-mask-warns.test.sh +73 -0
  796. package/tests/plugin-hooks-fail-open-under-sh.test.sh +165 -0
  797. package/tests/plugins-word-order.test.sh +126 -0
  798. package/tests/powershell-remove-item-guard.test.sh +85 -0
  799. package/tests/project-dir-naming.test.sh +103 -0
  800. package/tests/quoted-safe-targets-and-mentions.test.sh +190 -0
  801. package/tests/reroute-after-block-guard.test.sh +104 -0
  802. package/tests/secret-guard-documented-promises.test.sh +97 -0
  803. package/tests/session-plugin-pin-watch.test.sh +45 -0
  804. package/tests/settings-unreadable-refuses-to-write.test.sh +95 -0
  805. package/tests/shield-no-silent-adoption.test.py +110 -0
  806. package/tests/shield-no-silent-adoption.test.sh +46 -0
  807. package/tests/stop-transcript-write-health.test.sh +46 -0
  808. package/tests/system-dir-guard-root-erased.test.sh +66 -0
  809. package/tests/test-account-billing-log.sh +100 -0
  810. package/tests/test-account-routing-preflight.sh +77 -0
  811. package/tests/test-agent-sdk-credit-pool-monitor.sh +157 -0
  812. package/tests/test-agent-view-quota-warn.sh +184 -0
  813. package/tests/test-agents-md-edit-drift-warner.sh +176 -0
  814. package/tests/test-agents-md-loader.sh +204 -0
  815. package/tests/test-agents-md-sync-checker.sh +125 -0
  816. package/tests/test-ai-slop-punctuation-arrest.sh +280 -0
  817. package/tests/test-allowlist.sh +60 -0
  818. package/tests/test-always-allow-pattern-suggester.sh +147 -0
  819. package/tests/test-anthropic-base-url-guard.sh +88 -0
  820. package/tests/test-articulated-scope-capture.sh +139 -0
  821. package/tests/test-attachment-traversal-guard.sh +168 -0
  822. package/tests/test-aup-block-pattern-logger.sh +315 -0
  823. package/tests/test-aup-false-positive-helper.sh +188 -0
  824. package/tests/test-aup-large-tool-output-warner.sh +370 -0
  825. package/tests/test-aup-retry-loop-guard.sh +341 -0
  826. package/tests/test-auth-expiry-reminder.sh +303 -0
  827. package/tests/test-auth-macos-sleep-detector.sh +254 -0
  828. package/tests/test-auth-path-detector.sh +232 -0
  829. package/tests/test-auth-status-checker.sh +233 -0
  830. package/tests/test-authorized-reconfirmation-detector.sh +280 -0
  831. package/tests/test-background-cost-launch-guard.sh +62 -0
  832. package/tests/test-bash-allowlist-secondary-check.sh +143 -0
  833. package/tests/test-bash-fanout-bounded-rewriter.sh +186 -0
  834. package/tests/test-bash-project-fence.sh +127 -0
  835. package/tests/test-bg-permission-prompt-warner.sh +221 -0
  836. package/tests/test-binary-read-detector.sh +173 -0
  837. package/tests/test-broad-prefix-session-trap-warner.sh +167 -0
  838. package/tests/test-bulk-delete-target-resolution.sh +49 -0
  839. package/tests/test-bypass-mode-effective-verifier.sh +179 -0
  840. package/tests/test-cache-creation-drift-detector.sh +244 -0
  841. package/tests/test-cache-residue-detector.sh +429 -0
  842. package/tests/test-cache-tier-logger.sh +59 -0
  843. package/tests/test-cache-ttl-eviction-detector.sh +282 -0
  844. package/tests/test-cch-sentinel-precommit-guard.sh +64 -0
  845. package/tests/test-claim-verify-detector.sh +222 -0
  846. package/tests/test-claim-vs-caveat-checker.sh +134 -0
  847. package/tests/test-claude-code-version-pin-advisor.sh +353 -0
  848. package/tests/test-claude-md-reinjector.sh +173 -0
  849. package/tests/test-claude-md-size-monitor.sh +107 -0
  850. package/tests/test-claude-update-budget-guard.sh +132 -0
  851. package/tests/test-claude-update-smart.sh +91 -0
  852. package/tests/test-claudemd-tool-prohibition.sh +239 -0
  853. package/tests/test-cli-config-pinning-detector.sh +233 -0
  854. package/tests/test-cliff-countdown-advisor.sh +138 -0
  855. package/tests/test-closure-word-verify-gate.sh +158 -0
  856. package/tests/test-commit-all-scope-guard.sh +73 -0
  857. package/tests/test-commitment-carry-forward-arrest.sh +250 -0
  858. package/tests/test-compact-dispatch-watchdog.sh +147 -0
  859. package/tests/test-completion-claim-without-verification-detector.sh +326 -0
  860. package/tests/test-compound-bash-permission-resolver.sh +264 -0
  861. package/tests/test-compound-command-deny-enforcer.sh +67 -0
  862. package/tests/test-context-length-budget.sh +68 -0
  863. package/tests/test-context-usage-drift-alert.sh +52 -22
  864. package/tests/test-cost-incident-self-audit.sh +94 -0
  865. package/tests/test-cowork-claude-md-load-checker.sh +257 -0
  866. package/tests/test-cowork-claudemd-helper.sh +141 -0
  867. package/tests/test-cowork-fuse-staleness-watcher.sh +287 -0
  868. package/tests/test-cowork-hook-absence-warner.sh +230 -0
  869. package/tests/test-cowork-model-picker-advisor.sh +317 -0
  870. package/tests/test-credential-exfil-guard.sh +62 -0
  871. package/tests/test-cron-create-receipt.sh +165 -0
  872. package/tests/test-cross-product-mcp-spawn-detector.sh +112 -0
  873. package/tests/test-daemon-zombie-worker-surfacer.sh +71 -0
  874. package/tests/test-daily-cost-guard.sh +131 -0
  875. package/tests/test-deny-rule-integrity-verifier.sh +288 -0
  876. package/tests/test-deployment-readback-gate.sh +92 -0
  877. package/tests/test-deployment-readback-gh-adapter.sh +163 -0
  878. package/tests/test-disabled-feature-toggle-advisor.sh +78 -0
  879. package/tests/test-dispatch-allowlist-preflight.sh +385 -0
  880. package/tests/test-dispatch-liveness-watchdog.sh +319 -0
  881. package/tests/test-dispatch-receipt.sh +314 -0
  882. package/tests/test-dotenv-anthropic-key-billing-guard.sh +160 -0
  883. package/tests/test-echo-probe-spam-detector.sh +143 -0
  884. package/tests/test-edit-quote-ambiguity-guard.sh +75 -0
  885. package/tests/test-ephemeral-container-detector.sh +251 -0
  886. package/tests/test-evidence-claim-gate.sh +291 -0
  887. package/tests/test-extended-thinking-loop-guard.sh +289 -0
  888. package/tests/test-extended-thinking-resume-warning.sh +240 -0
  889. package/tests/test-extended-thinking-tool-use-mismatch-detector.sh +236 -0
  890. package/tests/test-fabricated-command-detector.sh +296 -0
  891. package/tests/test-false-disk-full-guard.sh +36 -0
  892. package/tests/test-feature-deprecation-detector.sh +117 -0
  893. package/tests/test-forbidden-response-phrase-detector.sh +246 -0
  894. package/tests/test-git-operations-require-approval.sh +53 -0
  895. package/tests/test-git-push-blast-radius-guard.sh +115 -0
  896. package/tests/test-goal-iteration-limit-warner.sh +128 -0
  897. package/tests/test-growthbook-flag-monitor.sh +428 -0
  898. package/tests/test-halt-signal-detector.sh +120 -0
  899. package/tests/test-hook-self-disable-detector.sh +232 -0
  900. package/tests/test-iteration-quality-degradation-detector.sh +244 -0
  901. package/tests/test-long-session-malformed-tool-call-detector.sh +185 -0
  902. package/tests/test-marketplace-plugins.sh +193 -0
  903. package/tests/test-mcp-misdiagnosis-arrest.sh +235 -0
  904. package/tests/test-mcp-orphan-leak-warner.sh +71 -0
  905. package/tests/test-mcp-permissions-ask-warner.sh +207 -0
  906. package/tests/test-mcp-routine-approval-detector.sh +229 -0
  907. package/tests/test-mcp-startup-bloat-detector.sh +141 -0
  908. package/tests/test-mcp-stdio-compatibility-test.sh +112 -0
  909. package/tests/test-memory-chain-audit.sh +59 -0
  910. package/tests/test-memory-orphan-detector.sh +227 -0
  911. package/tests/test-model-swap-suggester.sh +368 -0
  912. package/tests/test-model-version-lock.sh +83 -0
  913. package/tests/test-multi-file-plan-routing-gate.sh +277 -0
  914. package/tests/test-multi-window-auth-drift-detector.sh +262 -0
  915. package/tests/test-nested-spawn-inflight-guard.sh +281 -0
  916. package/tests/test-no-force-flag.sh +49 -0
  917. package/tests/test-non-english-quality-warner.sh +229 -0
  918. package/tests/test-oauth-refresh-monitor.sh +311 -0
  919. package/tests/test-opus-degradation-tracker.sh +274 -0
  920. package/tests/test-opus48-routine-task-warning.sh +201 -0
  921. package/tests/test-opus48-thinking-wedge-advisor.sh +249 -0
  922. package/tests/test-output-token-spike-detector.sh +315 -0
  923. package/tests/test-parallel-batch-size-limiter.sh +228 -0
  924. package/tests/test-parallel-cascade-detector.sh +191 -0
  925. package/tests/test-partial-view-claim-arrest.sh +272 -0
  926. package/tests/test-per-prompt-token-cap.sh +136 -0
  927. package/tests/test-persisted-1m-model-advisor.sh +71 -0
  928. package/tests/test-plugin-hooks-json-bloat-detector.sh +267 -0
  929. package/tests/test-post-edit-disk-verify.sh +294 -0
  930. package/tests/test-pre-bash-sed-line-ending-windows.sh +108 -0
  931. package/tests/test-pre-execution-claim-detector.sh +366 -0
  932. package/tests/test-private-key-backup-and-git-credentials.sh +100 -0
  933. package/tests/test-proxy-capture-suggester.sh +214 -0
  934. package/tests/test-public-artefact-socratic-narrowing.sh +346 -0
  935. package/tests/test-quota-anomaly-detector.sh +321 -0
  936. package/tests/test-quota-reset-audit.sh +81 -0
  937. package/tests/test-read-loop-detector.sh +137 -0
  938. package/tests/test-read-once-guard.sh +85 -0
  939. package/tests/test-receipts-aggregate.sh +143 -0
  940. package/tests/test-redirect-fragment-warner.sh +130 -0
  941. package/tests/test-redundant-read-blocker.sh +155 -0
  942. package/tests/test-refusal-arrest-gate.sh +303 -0
  943. package/tests/test-remote-control-billing-classifier.sh +125 -0
  944. package/tests/test-resume-drift-watcher.sh +65 -0
  945. package/tests/test-rg-replace-flag-detector.sh +175 -0
  946. package/tests/test-rhetorical-verification-prompt-detector.sh +237 -0
  947. package/tests/test-rm-safety-net.sh +115 -0
  948. package/tests/test-route-handler-emptiness-gate.sh +300 -0
  949. package/tests/test-runtime-binary-change-detector.sh +196 -0
  950. package/tests/test-same-command-repeat-detector.sh +165 -0
  951. package/tests/test-same-correction-arrest.sh +165 -0
  952. package/tests/test-scope-expansion-receipt.sh +207 -0
  953. package/tests/test-server-side-prompt-injection-detector.sh +181 -0
  954. package/tests/test-session-persistence-verifier.sh +128 -0
  955. package/tests/test-session-rate-monitor.sh +284 -0
  956. package/tests/test-session-start-quota-status.sh +210 -0
  957. package/tests/test-session-start-safety-check.sh +138 -0
  958. package/tests/test-settings-hooks-key-restorer.sh +257 -0
  959. package/tests/test-settings-json-health-check.sh +70 -0
  960. package/tests/test-settings-regression-tester.sh +197 -0
  961. package/tests/test-skill-cumulative-size-detector.sh +198 -0
  962. package/tests/test-skill-description-drop-detector.sh +236 -0
  963. package/tests/test-skill-truncation-detector.sh +263 -0
  964. package/tests/test-skills-context-recorder.sh +329 -0
  965. package/tests/test-skills-load-verifier.sh +184 -0
  966. package/tests/test-skills-settings-validator.sh +242 -0
  967. package/tests/test-sonnet-45-deprecation-helper.sh +150 -0
  968. package/tests/test-spurious-malformed-notice-detector.sh +290 -0
  969. package/tests/test-sql-bulk-delete-warn.sh +123 -0
  970. package/tests/test-ssh-key-protect.sh +81 -0
  971. package/tests/test-stale-temp-settings-detector.sh +161 -0
  972. package/tests/test-standing-rule-session-surfacer.sh +215 -0
  973. package/tests/test-starter-hooks-manifest.sh +96 -0
  974. package/tests/test-stop-hook-sigterm-wrapper.sh +258 -0
  975. package/tests/test-strict-allowlist.sh +72 -0
  976. package/tests/test-subagent-boundary-precheck.sh +137 -0
  977. package/tests/test-subagent-closure-verify-gate.sh +193 -0
  978. package/tests/test-subagent-destructive-git-guard.sh +86 -0
  979. package/tests/test-subagent-identity-leak-guard.sh +62 -0
  980. package/tests/test-subagent-identity-reassertion.sh +61 -0
  981. package/tests/test-subagent-inheritance-tester.sh +319 -0
  982. package/tests/test-subagent-permission-mode-guard.sh +61 -0
  983. package/tests/test-subagent-spawn-verification-enforcer.sh +60 -0
  984. package/tests/test-subagent-tool-allowlist-enforcer.sh +62 -0
  985. package/tests/test-subagent-tool-call-limiter.sh +97 -0
  986. package/tests/test-subscription-api-billing-warner.sh +138 -0
  987. package/tests/test-subscription-bypass-detector.sh +255 -0
  988. package/tests/test-temporal-suggestion-detector.sh +183 -0
  989. package/tests/test-thinking-budget-effort-mismatch-detector.sh +327 -0
  990. package/tests/test-tokenizer-ratio-alert-corpus.sh +77 -0
  991. package/tests/test-tokenizer-ratio-alert.sh +93 -0
  992. package/tests/test-tool-result-correlation-checker.sh +264 -0
  993. package/tests/test-tool-result-size-guard.sh +121 -0
  994. package/tests/test-transcript-contamination-detector.sh +264 -0
  995. package/tests/test-trigger-header-parsing.sh +151 -0
  996. package/tests/test-ultrareview-large-diff-advisor.sh +192 -0
  997. package/tests/test-userprompt-submit-receipt.sh +181 -0
  998. package/tests/test-verify-after-publish-reminder.sh +184 -0
  999. package/tests/test-version-bump-detector.sh +212 -0
  1000. package/tests/test-version-regression-warner.sh +165 -0
  1001. package/tests/test-warn-cron-cost-trap.sh +82 -0
  1002. package/tests/test-webfetch-runaway-guard.sh +77 -0
  1003. package/tests/test-wellness-break-reminder.sh +138 -0
  1004. package/tests/test-windows-destructive-command-guard.sh +169 -0
  1005. package/tests/test-windows-python-stub-detector.sh +146 -0
  1006. package/tests/test-worktree-edit-boundary-guard.sh +219 -0
  1007. package/tests/test-write-byte-integrity-verifier.sh +192 -0
  1008. package/tests/test-xml-format-leak-detector.sh +299 -0
  1009. package/tests/trustfall-mcp-injection-guard.test.sh +183 -0
  1010. package/tests/workspace-lease-guard.test.sh +144 -0
  1011. package/tests/worktree-escape-write-guard.test.sh +68 -0
  1012. package/tests/worktree-hooks-path-fix.test.sh +181 -0
  1013. package/tests/worktree-parent-write-guard.test.sh +51 -0
  1014. package/tests/write-empty-content-guard.test.sh +39 -0
  1015. package/tests/write-nul-corruption-detector.test.sh +29 -0
  1016. package/tests/write-overwrite-unread-content.test.sh +178 -0
  1017. package/tests/wsl-host-disk-space-guard.test.sh +55 -0
@@ -4,8 +4,8 @@ Use this checklist before running Claude Code autonomously. Copy to your project
4
4
 
5
5
  ## Before First Session
6
6
 
7
- - [ ] Install safety hooks: `npx cc-safe-setup`
8
- - [ ] Run safety audit: `npx cc-safe-setup --audit` (target: score ≥ 80)
7
+ - [ ] Install safety hooks: `npx github:yurukusa/cc-safe-setup`
8
+ - [ ] Run safety audit: `npx github:yurukusa/cc-safe-setup --audit` (target: score ≥ 80)
9
9
  - [ ] Create CLAUDE.md with project-specific rules
10
10
  - [ ] Verify .env files are in .gitignore
11
11
  - [ ] Ensure git remote is set (so work can be recovered)
@@ -14,7 +14,7 @@ Use this checklist before running Claude Code autonomously. Copy to your project
14
14
 
15
15
  - [ ] Create backup branch: `git checkout -b backup/before-autonomous-$(date +%Y%m%d)`
16
16
  - [ ] Commit all current work
17
- - [ ] Verify destructive-guard is blocking: `npx cc-safe-setup --verify`
17
+ - [ ] Verify destructive-guard is blocking: `npx github:yurukusa/cc-safe-setup --verify`
18
18
  - [ ] Check branch-guard protects main/master
19
19
  - [ ] If using database: install `block-database-wipe`
20
20
  - [ ] If sensitive configs: install `protect-dotfiles`
@@ -30,7 +30,7 @@ Use this checklist before running Claude Code autonomously. Copy to your project
30
30
  - [ ] Review git log for unexpected changes
31
31
  - [ ] Run test suite to catch regressions
32
32
  - [ ] Check if any .env files were modified
33
- - [ ] Review blocked-commands.log for patterns: `npx cc-safe-setup --learn`
33
+ - [ ] Review blocked-commands.log for patterns: `npx github:yurukusa/cc-safe-setup --learn`
34
34
 
35
35
  ## Team Setup
36
36
 
@@ -43,11 +43,19 @@ Use this checklist before running Claude Code autonomously. Copy to your project
43
43
 
44
44
  | Risk | Prevention | Install |
45
45
  |------|-----------|---------|
46
- | `rm -rf /` | destructive-guard | `npx cc-safe-setup` |
47
- | Push to main | branch-guard | `npx cc-safe-setup` |
48
- | .env committed | secret-guard | `npx cc-safe-setup` |
46
+ | `rm -rf /` | destructive-guard | `npx github:yurukusa/cc-safe-setup` |
47
+ | Push to main | branch-guard | `npx github:yurukusa/cc-safe-setup` |
48
+ | .env committed | secret-guard | `npx github:yurukusa/cc-safe-setup` |
49
+ | .env written or copied via Bash | secret-file-write-guard | `--install-example secret-file-write-guard` |
49
50
  | Database wiped | block-database-wipe | `--install-example block-database-wipe` |
50
51
  | Dotfiles modified | protect-dotfiles | `--install-example protect-dotfiles` |
51
52
  | Deploy without commit | deploy-guard | `--install-example deploy-guard` |
52
53
  | Commit without tests | verify-before-commit | `--install-example verify-before-commit` |
53
54
  | Session crash data loss | session-checkpoint | `--install-example session-checkpoint` |
55
+
56
+ ## Why `github:` and not the bare package name
57
+
58
+ The npm entry is frozen at 29.8.0 (2026-04-20) and lets twenty-five command shapes through that the
59
+ current code blocks — measured 2026-09-03 across twenty-two shapes, with nothing failing in
60
+ the other direction. The table is in the README. Install from GitHub so the guards you get are
61
+ the guards this checklist describes. The tool's own `--help` says the same thing.
package/SERVICES.md ADDED
@@ -0,0 +1,194 @@
1
+ # Services
2
+
3
+ If you want more than what the free tools give you, there are four paid options. All are fulfilled using the same methodology I use to run Claude Code autonomously, applied to your specific setup.
4
+
5
+ This page is in English, but Japanese orders are welcome for all four: order and write your request in Japanese and the report comes back in Japanese. 日本語でも受け付けます(注文と依頼を日本語で書いていただければ、報告書は日本語でお返しします)。
6
+
7
+ ## Which one is for you
8
+
9
+ Pick by what your setup actually looks like, not by what sounds most thorough. The most expensive one is the wrong choice for most people, and its own section says so.
10
+
11
+ | What your setup looks like right now | Start here |
12
+ |---|---|
13
+ | You have not run the free audit yet | Run `--audit` from this repo first. It is free, it takes seconds, and it may answer your question. Come back only if it did not. |
14
+ | One `CLAUDE.md`, no hooks of your own, no CI | **§1 CLAUDE.md Audit — $29.** One file, read closely. |
15
+ | Your bill or your rate limit is the problem | **§2 Token Burn Audit — $29.** Reads your session logs, not your rules. |
16
+ | `CLAUDE.md` in more than one layer, **and** hooks you wrote yourself, **and** CI | **§3 Full-Surface Audit — $219.** The only one that reads layers *against each other*. |
17
+ | Only one layer — no hooks, no CI | **Not §3.** A contradiction between layers cannot exist when there is only one layer. §1 is the right size. |
18
+ | You want to keep up with new failure patterns rather than audit anything | **§4 CC Safety Lab — ¥500/month.** |
19
+
20
+ **日本語の説明ページ:** [CLAUDE.md 監査(¥3,980)](https://yurukusa.github.io/cc-safe-setup/claude-md-audit-jp.html)/[Token Burn 監査(¥3,980)](https://yurukusa.github.io/cc-safe-setup/token-burn-audit-jp.html)/[Full-Surface 監査(¥29,800)](https://yurukusa.github.io/cc-safe-setup/full-surface-audit-jp.html)。価格・納期・返金の条件・含まないもの・送っていただくものを日本語で書いてあります。
21
+
22
+ ---
23
+
24
+ ## 1. CLAUDE.md Audit — $29 (¥3,980)
25
+
26
+ **What you get:**
27
+
28
+ A written audit of your `CLAUDE.md` (and optionally `settings.json` + your 5 most-invoked hooks), delivered as a Markdown report within 48 hours.
29
+
30
+ **See exactly what you get: [a full sample report](./docs/claude-md-audit-sample.md).** It is this audit run against my own 608-line, three-layer setup — real findings, including two rules that could not be followed at all. Also available in Japanese: **[見本の報告書(日本語)](./docs/claude-md-audit-sample-jp.md)** — same content, same figures. 日本語の説明ページは **[CLAUDE.md の監査(¥3,980・48時間)](https://yurukusa.github.io/cc-safe-setup/claude-md-audit-jp.html)** にあります。
31
+
32
+ The report covers:
33
+
34
+ 1. **Reference resolution** — every path your rules depend on, checked against the scope the rule actually runs in. The failure this catches is not a missing file: it is a file that *exists somewhere else*, so it passes existence checks while the rule stays silently unfollowable.
35
+ 2. **Testable-assertion ratio** — how much of your CLAUDE.md is aspirational (and therefore silently drops out under pressure) vs. checkable, as a measured ratio per layer.
36
+ 3. **Cross-layer redundancy** — rules duplicated between your global, home and project files. This is an ownership problem, not a cost problem: editing one copy leaves the other in force and neither file says so.
37
+ 4. **Vague-rule detection** — the specific lines the model is most likely to ignore, with concrete rewrites that attach a checkable condition without changing your intent.
38
+ 5. **Top-3 fixes**, ranked by expected impact, with before/after diffs ready to paste.
39
+
40
+ **On token weight:** earlier versions of this page led with "how much your instructions cost per turn." Having measured it, I think that was the wrong headline. `CLAUDE.md` sits in the cached prefix, so on my own setup, deleting *every* duplicated rule works out to roughly $0.24–$1.19/month. The report still includes the token arithmetic for your files — as a bound, and usually as a reason **not** to spend your time there. If your bill is the problem, the Token Burn Audit below reads session logs, which is where the money actually goes.
41
+
42
+ **Not included:** a live 1:1 call, hook implementation, or code review beyond the files you submit. This is an audit, not consulting. The diffs are proposals; you apply them.
43
+
44
+ **How to book:**
45
+
46
+ 1. Order at https://ko-fi.com/yurukusa/commissions — listing: *CLAUDE.md Audit — written report within 48h*, ¥3,980 (≈$29). _If that listing is ever missing, a ¥3,980 tip at https://ko-fi.com/yurukusa with the note "CLAUDE.md audit" is honored at the same price._
47
+ 2. Open an Audit Request issue on this repo using [the template](./.github/ISSUE_TEMPLATE/3-audit_request.md). Paste your CLAUDE.md there, or — if you would rather not publish it — say so in the issue and I reply with a private route. Mention your Ko-fi order so the two can be matched.
48
+ 3. You receive the report as an issue reply, and the issue is closed when you confirm it.
49
+
50
+ If you cannot post anything publicly at all, say so in the Ko-fi order message instead and I'll arrange another route without an issue.
51
+
52
+ **Attaching a file to an issue does not make it private.** This repository is public, and attachment URLs on a public repository can be opened by anyone who has the link. If your `CLAUDE.md` should not be public, do not attach it — ask for the private route instead. (This page said the opposite until 2026-08-12; it was wrong.)
53
+
54
+ **A `CLAUDE.md` is not always harmless.** Mine names internal paths; other people's name customers, hostnames and occasionally a key. Strip anything you would not put on a public page before you post it — the issue is public. And as above: the report is written with Claude Code, so your file's contents go to Anthropic's API; on my side it is never published and is deleted within 30 days of delivery.
55
+
56
+ **Refund:** if I cannot produce a useful audit (for example because the file is effectively empty, or is entirely in a language I cannot parse), full refund via Ko-fi.
57
+
58
+ ---
59
+
60
+ ## 2. Token Burn Audit — $29 (¥3,980)
61
+
62
+ **What it is:** a diagnosis of where your Claude Code tokens are actually going, based on *your* `/cost` output and session transcripts. Not a generic "7 tips" article — a specific read of your real usage.
63
+
64
+ **Why this still matters — counted 2026-08-13, not in April:**
65
+
66
+ > *"I used up Max 5 in 1 hour of working, before I could work 8 hours"* — user report via [DevOps.com, April 2026](https://devops.com/claude-code-quota-limits-usage-problems/)
67
+
68
+ The reports did not stop when that quote was written. Both of these are still open:
69
+
70
+ | Issue | Reactions | Comments | State |
71
+ |---|---|---|---|
72
+ | [#16157](https://github.com/anthropics/claude-code/issues/16157) — hitting usage limits immediately on Max | 724 | 1,486 | open |
73
+ | [#38335](https://github.com/anthropics/claude-code/issues/38335) — Max session limits draining in as little as 19 minutes | 543 | 831 | open |
74
+
75
+ I counted the same way across the issues about hooks and settings silently not applying — which is the subject of the more expensive audit in §3. That cluster comes to **371** reactions and comments in total. This one comes to **9,643**.
76
+
77
+ That is not a claim that this audit fixes the platform's limits. It is why the cheaper audit sits on this subject: it is where people are actually stuck.
78
+
79
+ Context from April 2026, kept because the causes have not changed:
80
+
81
+ - March 23, 2026 is where this cluster starts ([#38335](https://github.com/anthropics/claude-code/issues/38335), [#41788](https://github.com/anthropics/claude-code/issues/41788))
82
+ - Anthropic confirmed investigation: "top priority for the team"
83
+ - Root cause partially identified: `cache_read` tokens may count at full rate against rate limits (negating caching benefits)
84
+ - April 21 pricing whiplash: Claude Code removed from $20 Pro plan, reverted hours later
85
+
86
+ This audit tells you which of the 56 cataloged token-waste symptoms (Token Book Ch.8) are actually firing in *your* logs — not "in general."
87
+
88
+ **See exactly what you get: [a full sample report](./docs/token-burn-audit-sample.md).** It is this audit run against my own 156 session logs (21,770 API round-trips), including the part where the largest waste pattern turned out to match *none* of the 56 symptoms, and the part where my own hooks were failing to catch it.
89
+
90
+ **What you get (delivered in 48 hours as a Markdown report in your issue thread):**
91
+
92
+ 1. **Top 3 waste patterns** found in your logs, ranked by estimated cost. Each mapped to a Ch.8 symptom where one applies — and flagged explicitly when none does. In the sample, the single largest pattern matched *none* of the 56.
93
+ 2. **Per-pattern fix**: the exact hook, CLAUDE.md change, or workflow adjustment that addresses it. Example hooks from `cc-safe-setup/examples/` that you can install in one command.
94
+ 3. **Estimated savings range** (stated as a range, not a single number — the actual savings depend on your next month's usage pattern).
95
+ 4. **`cc-token-diet` walkthrough**: if you haven't run [cc-token-diet](https://github.com/yurukusa/cc-token-diet) yet, I include the command line and help interpret the output.
96
+
97
+ **Not included:** real-time monitoring, implementation (you apply the fixes yourself), or a guarantee that your $ spend will drop by a specific amount. If the report does not identify at least one addressable waste pattern, full refund via Ko-fi.
98
+
99
+ **How to book:**
100
+
101
+ 1. Order at https://ko-fi.com/yurukusa/commissions — listing: *Token Burn Audit — written report within 48h*, ¥3,980 (≈$29). _If that listing is ever missing, a ¥3,980 tip at https://ko-fi.com/yurukusa with the note "Token Burn audit" is honored at the same price._
102
+ 2. Open a Token Burn Audit Request issue on this repo using [the template](./.github/ISSUE_TEMPLATE/4-token_burn_audit_request.md) — and post **only** the `/cost` summary and a couple of lines about your setup there. **Do not paste raw session transcripts into the issue.** Issues on this repository are public and stay public. Say in the issue that the logs are coming separately; I reply with a private route (the Ko-fi order message thread, or an address you name) and you send them there.
103
+ 3. You receive the report as an issue reply, and the issue is closed when you confirm it.
104
+
105
+ **Strip your logs before you send them.** Session transcripts routinely carry API keys, customer names, internal paths and source code. Remove those first. I cannot un-see what arrives, and a public issue cannot be un-published — if a secret does reach me, tell me and rotate it, because deleting the message does not undo the exposure.
106
+
107
+ **What happens to the files you send.** The report is written with Claude Code, which means **the contents of your files are sent to Anthropic's API**. Doing the work this way makes that unavoidable, and what happens on their side is governed by [their terms](https://www.anthropic.com/legal/commercial-terms), not by me — I cannot promise anything about it. What I can promise is three things: I publish nothing, I delete your files within 30 days of delivery (sooner if you ask), and the only thing I keep is the report I wrote. Redact anything you would rather not send; I note the redacted range in the report. If your environment cannot send anything to an external API, this audit is the wrong tool and you should not buy it.
108
+
109
+ **What the free tools already give you — run them first:** `/cost` (or `/usage`) inside Claude Code shows the current session. [`ccusage`](https://github.com/ccusage/ccusage) gives you daily and monthly totals from the same local logs, and it folds duplicate `usage` rows correctly (keyed on `message.id` + `requestId`) — a detail my own `cc-token-diet` got wrong until 2026-08-09. If your question is *"how much?"*, those answer it for free and you do not need me.
110
+
111
+ What none of them answer is *"which of my habits is producing that number, and what do I change on Monday."* Counting is solved; attribution is not. That gap is what this audit is for.
112
+
113
+ **Good fit:** Max plan users watching their quota vanish faster than it used to. Teams where one session burned an unexpected $50–$500. Anyone who read a "7 tips" article and tried them but nothing changed.
114
+
115
+ **Not a good fit:** if you have not yet run Claude Code for at least one week on your actual project. There has to be real usage to audit.
116
+
117
+ **Japanese is welcome / 日本語でも受け付けます:** there is a full Japanese description of this audit — price, turnaround, refund terms, what is not included, and what you send me — at **[トークンが何に消えたかを、あなたのログから読む監査(¥3,980・48時間)](https://yurukusa.github.io/cc-safe-setup/token-burn-audit-jp.html)**. The sample report is also available in Japanese: **[見本の報告書(日本語)](./docs/token-burn-audit-sample-jp.md)** — same content, same figures, same measurement date as the English one. You can place the Ko-fi order and file the request issue in Japanese, and the report comes back in Japanese. この監査の日本語の説明(価格・納期・返金の条件・含まないもの・送っていただくもの)は上のページにあります。見本の報告書も日本語版を用意しました(中身・数字・測定日は英語版と同じ)。注文と issue を日本語で書いていただければ、報告書は日本語でお返しします。
118
+
119
+ ---
120
+
121
+ ## 3. Full-Surface Audit — $219 (¥29,800)
122
+
123
+ **What it is:** the two audits above each read one kind of file. This one crosses five layers of your setup — `CLAUDE.md`, `settings.json`, your hooks, your session logs, and your CI config — and reports only the contradictions that fall *between* them.
124
+
125
+ **Why a separate offering rather than a bigger version of the ones above:** because the failures it finds are not larger versions of single-file failures. They are a different kind. A rule that names a safety net which exists but is never registered passes every check you can run on the rule, and every check you can run on the config. It only shows up when the two are read against each other.
126
+
127
+ **See exactly what you get: [a full sample report](./docs/full-surface-audit-sample-jp.md).** It is this audit run against my own setup — three layers of `CLAUDE.md`, 27 registered hooks, 649 session log files holding 34,026 shell calls, and three CI workflows. On the day I wrote it, it found five things I did not know, and the largest was about this project:
128
+
129
+ > The guards protecting my machine were a different program from the ones I ship under the same names. Six dangerous command shapes that the shipped version blocks were passing on my own machine. And `--outdated`, the command in this repo whose only job is to notice exactly that drift, was structurally unable to see those files — the core guards live in `scripts.json`, and it compared against `examples/`. I fixed that the same day; the fix is in this repo.
130
+
131
+ The report also measured how much it mattered, against my own logs rather than in principle. Of 515 recorded calls containing `git push`, **502 (97.5%)** sat outside the position the installed guard was reading — and reading those 502 line by line turned up **two real force-pushes that ran and were never stopped**, on a guard whose own header says it blocks force-push on *all* branches.
132
+
133
+ It also records the two times my own scan was wrong about that number, in both directions, and how I found out.
134
+
135
+ **What you get, as a Markdown report within 72 hours:**
136
+
137
+ 1. **Cross-layer contradictions.** Each one names the layers it spans and why a single-file audit cannot surface it.
138
+ 2. **A control for every finding** — the same probe on a case that should *not* trigger. Without that, "everything passed" and "my probe was wrong" look identical. The sample includes the three cases where my own scan was wrong and I threw the finding out.
139
+ 3. **Coverage measured against your own logs.** Not "this rule looks weak" but "this rule sits outside N% of the commands you actually ran."
140
+ 4. **Diffs you can paste**, and the 30-second command that shows each one working.
141
+ 5. **What the audit did not find**, and what it could not measure.
142
+
143
+ **Not included:** a call, implementation, or running anything in your environment. I read what you send and write the report. The diffs are proposals; you apply them. If you want a senior human engineer manually reviewing your repo, this is not that.
144
+
145
+ **How to book:**
146
+
147
+ 1. Order at https://ko-fi.com/yurukusa/commissions — listing: *Full-Surface Audit — all 5 layers, written report within 72h*, ¥29,800 (≈$219).
148
+ 2. Reply to the order with a message saying which of the five layers you can send. **You do not need all five; three is enough to start.** I reply within 24 hours with a private route for the files.
149
+ 3. **Do not post logs or settings publicly.** Session transcripts routinely carry API keys, customer names, internal paths and source code. Strip what you can before you send them. I cannot un-see what arrives.
150
+
151
+ **What happens to the files you send.** The report is written with Claude Code, which means **the contents of your files are sent to Anthropic's API**. Doing the work this way makes that unavoidable, and what happens on their side is governed by [their terms](https://www.anthropic.com/legal/commercial-terms), not by me — I cannot promise anything about it. What I can promise is three things: I publish nothing, I delete your files within 30 days of delivery (sooner if you ask), and the only thing I keep is the report I wrote. Redact anything you would rather not send; I note the redacted range in the report. If your environment cannot send anything to an external API, this audit is the wrong tool and you should not buy it.
152
+
153
+ **Refund:** if the audit surfaces no cross-layer contradiction at all, full refund via Ko-fi.
154
+
155
+ **Japanese is welcome / 日本語でも受け付けます:** there is a full Japanese description of this audit — price, turnaround, refund terms, what is not included, and what you send me — at **[層と層のあいだにしか現れない矛盾を読む監査(¥29,800・72時間)](https://yurukusa.github.io/cc-safe-setup/full-surface-audit-jp.html)**. The sample report linked above is already the Japanese one. 注文と依頼を日本語で書いていただければ、報告書は日本語でお返しします。この監査の日本語の説明(価格・納期・返金の条件・含まないもの・送っていただくもの)は上のページにあります。
156
+
157
+ ---
158
+
159
+ ## 4. CC Safety Lab — Founder Membership, ¥500/month
160
+
161
+ Monthly recurring. Each issue covers:
162
+
163
+ - 3–5 new incident reports from the prior month, each with a concrete workaround.
164
+ - 1 new safety hook, released to Founder members one month before it ships to `cc-safe-setup` main.
165
+ - 1 measured token-saving technique, with the data behind it.
166
+ - 1 week of early access to Token Book updates.
167
+
168
+ **The delivery record, since I would rather you saw it than found it.** This page used to say
169
+ "delivered on the 1st of each month." It has never worked out that way, so the claim is gone.
170
+ Issues went out on 2026-04-23, 04-24, 05-08, 05-15, 05-22 — and then **nothing until 08-08**.
171
+ June and July have no issue at all; I found the August one sitting unpublished as a draft and
172
+ shipped it late. No issue has ever gone out on the 1st.
173
+
174
+ What I will commit to instead: **one issue per calendar month, no fixed date.** If a month is
175
+ missed, the next issue says so at the top rather than quietly skipping it. If that is not good
176
+ enough for ¥500/month — and it may well not be — do not join yet.
177
+
178
+ Founder rate is grandfathered — you keep the ¥500 price even if the tier is later raised.
179
+
180
+ **Join:** https://ko-fi.com/yurukusa → *Membership* tab.
181
+
182
+ ---
183
+
184
+ ## Why these prices
185
+
186
+ Comparable AI-audit consulting, in the listings I have seen, runs $150–$300/hour and $999+ per productized report. These are deliberately priced below that because they are AI-assisted: I apply the same 7-check framework documented in the [free self-audit Gist](https://gist.github.com/yurukusa/df29f506af33368b03b1c5aeae85f04c), plus judgment from having read hundreds of public Claude Code incident reports. If you want a senior human engineer manually reviewing your repo, this is not that. Read the sample and decide.
187
+
188
+ **On the gap between $29 and $219:** it is not a bigger version of the same work. The $29 audits read one kind of file each, and a single-file audit cannot produce a contradiction that lives *between* files — the gap is in what the work can find, not in how much of it there is. The sample report for each tier shows the difference; read both before deciding which one you want. If the $29 audits answer your question, buy those.
189
+
190
+ ---
191
+
192
+ ## Questions before booking
193
+
194
+ Open a [General Discussion](https://github.com/yurukusa/cc-safe-setup/discussions/categories/general) or message on Ko-fi.
@@ -10,6 +10,39 @@ Everything you can put in `~/.claude/settings.json`, documented from real usage
10
10
  | `.claude/settings.json` | Current project | Overrides user |
11
11
  | `.claude/settings.local.json` | Current project (gitignored) | Highest |
12
12
 
13
+ > **Project-scoped files resolve against the launch directory, not the git root — and the two do not behave the same.**
14
+ > Launching Claude Code from a subdirectory of a repo (e.g. `packages/api/` in a monorepo) silently drops
15
+ > `.claude/settings.json` from the repo root, while `.claude/settings.local.json` from that same root still applies.
16
+ > Measured on 2.1.220 (Linux/WSL2) with hooks registered only at the repo root, launching from a nested subdirectory,
17
+ > with a root launch as the control on every run:
18
+ >
19
+ > | At repo root | Launched from subdirectory | Launched from root (control) |
20
+ > |---|---|---|
21
+ > | `settings.json` only | hook does **not** fire | fires |
22
+ > | `settings.local.json` only | hook fires | fires |
23
+ > | both present | **only** the `.local` hook fires | both fire |
24
+ >
25
+ > The direction matters for safety: `settings.local.json` is the personal, gitignored file, so the copy that survives
26
+ > is the one only you have, and the copy that disappears is the committed one your whole team relies on. A `PreToolUse`
27
+ > guard shipped in `settings.json`, verified from the repo root, can be inert for every developer who runs Claude from
28
+ > a package subdirectory — with nothing in the output saying so.
29
+ >
30
+ > **Until this is fixed upstream** ([#74023](https://github.com/anthropics/claude-code/issues/74023)), launch from the
31
+ > repo root so the shared config loads:
32
+ >
33
+ > ```sh
34
+ > # ccroot: launch from the repo root so project config loads
35
+ > root="$(git rev-parse --show-toplevel 2>/dev/null)" && cd "$root"; exec claude "$@"
36
+ > ```
37
+ >
38
+ > Copying `settings.json` to `settings.local.json` also makes the hooks fire from a subdirectory, but that file is not
39
+ > the one you commit, so it is a diagnostic rather than a team fix: if your hooks start working after that copy, you
40
+ > have confirmed you are hitting this bug and not a malformed config.
41
+ >
42
+ > This installer writes to `$CLAUDE_PROJECT_DIR/.claude/settings.json` when `CLAUDE_PROJECT_DIR` is set, and to
43
+ > `~/.claude/settings.json` otherwise. The default (user-level) path is unaffected by this bug; the
44
+ > `CLAUDE_PROJECT_DIR` path is affected.
45
+
13
46
  ## Permissions
14
47
 
15
48
  ### allow
@@ -47,7 +80,7 @@ Commands that auto-execute without prompting.
47
80
  - Compound commands don't match: `Bash(git:*)` won't match `cd /path && git log` ([#30519](https://github.com/anthropics/claude-code/issues/30519), [#16561](https://github.com/anthropics/claude-code/issues/16561))
48
81
  - "Always Allow" saves exact strings, not patterns ([#6850](https://github.com/anthropics/claude-code/issues/6850))
49
82
  - User-level settings may not apply at project level ([#5140](https://github.com/anthropics/claude-code/issues/5140))
50
- - **Workaround:** Use `compound-command-approver` hook: `npx cc-safe-setup --install-example compound-command-approver`
83
+ - **Workaround:** Use `compound-command-approver` hook: `npx github:yurukusa/cc-safe-setup --install-example compound-command-approver`
51
84
 
52
85
  ### deny
53
86
 
@@ -91,16 +124,86 @@ Commands that are always blocked.
91
124
 
92
125
  ### Hook Events
93
126
 
94
- | Event | When | Use Case |
95
- |-------|------|----------|
96
- | `PreToolUse` | Before tool executes | Block/modify commands |
97
- | `PostToolUse` | After tool executes | Validate output, check syntax |
98
- | `Stop` | Session ends | Log data, notify |
99
- | `UserPromptSubmit` | User presses Enter | Validate prompts |
100
- | `Notification` | Claude shows notification | Custom alerts |
101
- | `PreCompact` | Before context compaction | Save state |
102
- | `SessionStart` | Session begins | Initialize |
103
- | `SessionEnd` | Session ends | Cleanup |
127
+ There are **31** hook events. This table used to list 8 of them, and described `Stop` as
128
+ "Session ends" — which is wrong, and wrong in a direction that costs you: `Stop` fires
129
+ **after every turn**, not once at the end. A cleanup or notification hook registered there
130
+ runs dozens of times per session.
131
+
132
+ **A wrong event name is not an error.** Claude Code drops the hook and says
133
+ `Unknown hook event "..." was ignored` — but only where you have to go looking for it.
134
+ Check yours:
135
+
136
+ ```bash
137
+ claude doctor # any "Unknown hook event" line means that hook never runs
138
+ ```
139
+
140
+ The same output prints the authoritative list of valid names, which is where the table below
141
+ comes from. Descriptions are quoted from the official hooks reference.
142
+
143
+ **Session lifecycle**
144
+
145
+ | Event | When it fires | Use case |
146
+ |-------|---------------|----------|
147
+ | `SessionStart` | "Claude Code starts a new session or resumes an existing session" | Initialize, restore state |
148
+ | `Setup` | Start with `--init-only`, or `--init`/`--maintenance` in `-p` mode | One-time prep in CI |
149
+ | `SessionEnd` | "When a session terminates" | Cleanup, final report |
150
+
151
+ **Prompt and turn**
152
+
153
+ | Event | When it fires | Use case |
154
+ |-------|---------------|----------|
155
+ | `UserPromptSubmit` | "When you submit a prompt, before Claude processes it" | Validate or annotate prompts |
156
+ | `UserPromptExpansion` | "When a user-typed command expands into a prompt" | Gate your own slash commands |
157
+ | `Stop` | **"When Claude finishes responding"** — every turn, not once | Per-turn checks, commitments |
158
+ | `StopFailure` | "When the turn ends due to an API error" | Catch `rate_limit`, `billing_error`, `overloaded` |
159
+ | `MessageDisplay` | "While assistant message text is displayed" | Redact or annotate on screen only |
160
+
161
+ **Tools and permissions**
162
+
163
+ | Event | When it fires | Use case |
164
+ |-------|---------------|----------|
165
+ | `PreToolUse` | "Before a tool call executes. Can block it" | **Where guards belong.** Fires in every permission mode |
166
+ | `PermissionRequest` | "When a tool call needs a permission decision" | Custom approval logic — **does not fire under auto mode or bypassed permissions** |
167
+ | `PermissionDenied` | "When a tool call is denied by the auto mode classifier" | Audit what is actually being blocked |
168
+ | `PostToolUse` | "After a tool call succeeds" | Validate output, syntax-check writes |
169
+ | `PostToolUseFailure` | "After a tool call fails" | Feed the failure reason back to Claude |
170
+ | `PostToolBatch` | "After a full batch of parallel tool calls resolves" | Check a whole batch before the next model call |
171
+
172
+ **Subagents and tasks**
173
+
174
+ | Event | When it fires | Use case |
175
+ |-------|---------------|----------|
176
+ | `SubagentStart` | "When a subagent is spawned" | Count and constrain fan-out |
177
+ | `SubagentStop` | "When a subagent finishes" | Collect subagent results |
178
+ | `TaskCreated` | "When a task is being created via `TaskCreate`" | Enforce task hygiene (exit 2 blocks) |
179
+ | `TaskCompleted` | "When a task is being marked as completed" | Require evidence before "done" (exit 2 blocks) |
180
+ | `TeammateIdle` | "When an agent team teammate is about to go idle" | Keep a teammate working (exit 2 blocks) |
181
+
182
+ **Environment and config**
183
+
184
+ | Event | When it fires | Use case |
185
+ |-------|---------------|----------|
186
+ | `ConfigChange` | "When a configuration file changes during a session" | **exit 2 blocks the change** (except `policy_settings`) |
187
+ | `InstructionsLoaded` | "When a CLAUDE.md or `.claude/rules/*.md` file is loaded into context" | Verify your instructions actually loaded |
188
+ | `CwdChanged` | "When the working directory changes, for example when Claude executes a `cd` command" | Reactive environment management (direnv) |
189
+ | `DirectoryAdded` | "When a working directory is added mid-session via `/add-dir`" | Audit scope expansion |
190
+ | `FileChanged` | "When a watched file changes on disk" | React to edits; `matcher` selects filenames |
191
+ | `WorktreeCreate` | "When a worktree is being created" | **Hook returns the path; non-zero aborts creation** |
192
+ | `WorktreeRemove` | "When a worktree is being removed" | Salvage work before removal |
193
+
194
+ **Context and MCP**
195
+
196
+ | Event | When it fires | Use case |
197
+ |-------|---------------|----------|
198
+ | `PreCompact` | "Before context compaction" | Save state, or block compaction |
199
+ | `PostCompact` | "After context compaction completes" | Re-inject what compaction dropped |
200
+ | `Notification` | "When Claude Code sends a notification" | Custom alerts |
201
+ | `Elicitation` | "When an MCP server requests user input during a tool call" | Auto-answer or refuse MCP prompts |
202
+ | `ElicitationResult` | "After a user responds to an MCP elicitation" | Vet the response before it leaves |
203
+
204
+ Not every event supports a `matcher`, and the decision control differs per event (some can
205
+ block with exit code 2, some ignore the exit code entirely). Check the official reference
206
+ before relying on one to *stop* something.
104
207
 
105
208
  ### Matcher Values
106
209
 
@@ -256,27 +359,143 @@ Commands that are always blocked.
256
359
  ### Generate This Automatically
257
360
 
258
361
  ```bash
259
- npx cc-safe-setup # Install hooks
260
- npx cc-safe-setup --audit # Check your score
261
- npx cc-safe-setup --doctor # Diagnose issues
362
+ npx github:yurukusa/cc-safe-setup # Install hooks
363
+ npx github:yurukusa/cc-safe-setup --audit # Check your score
364
+ npx github:yurukusa/cc-safe-setup --doctor # Diagnose issues
365
+ ```
366
+
367
+ ## Undocumented settings (verified from the bundled binary)
368
+
369
+ These `settings.json` keys are not in the official docs but are real and read at runtime. Defaults below were verified by inspecting the bundled `@anthropic-ai/claude-code` binary. Internal short names change between versions — rely on the **key name and default**, not on any internal symbol. Behaviour may change in future releases; re-verify before depending on them.
370
+
371
+ | Key | Default | What it does | Why you might set it |
372
+ |-----|---------|--------------|----------------------|
373
+ | `switchModelsOnFlag` | `true` | When a safety classifier flags a message, the session auto-switches to a different (often larger/costlier) model to keep going. `false` makes the session **pause** instead. | Set `false` to keep your model and cost assumptions stable, and to notice flags instead of being silently moved to another model. |
374
+ | `skillListingMaxDescChars` | `1536` | Per-skill `description` character cap in the skill listing sent to the model. Longer descriptions are **silently truncated** (from the end). | A skill that "won't auto-trigger" can be a truncated description. Put trigger words first, keep descriptions short, or raise this (costs more per-turn context). |
375
+ | `skillListingBudgetFraction` | `0.01` (1%) | Fraction of the context window reserved for the whole skill listing. When the listing exceeds it, descriptions are shortened to fit. | Many skills ⇒ less room per skill ⇒ more truncation. Prune unused skills, or raise this (costs more per-turn context). |
376
+
377
+ ```json
378
+ {
379
+ "switchModelsOnFlag": false,
380
+ "skillListingMaxDescChars": 4096,
381
+ "skillListingBudgetFraction": 0.03
382
+ }
262
383
  ```
263
384
 
385
+ Raising the two skill-listing caps opts you into higher per-turn context cost (the listing is sent every turn). Prefer trimming descriptions and pruning skills first.
386
+
387
+ ## Recently added settings (2.1.220 – 2.1.226)
388
+
389
+ > **Source: the official changelog, not my own machine.** Every other entry in this file was written
390
+ > from usage I ran here. These eleven were introduced in the last seven releases and are listed so the
391
+ > file keeps its promise of covering everything you can put in `settings.json`. Descriptions follow the
392
+ > changelog wording; I have not reproduced each one locally yet, and I say so rather than implying I have.
393
+ >
394
+ > Measured 2026-08-11 against Claude Code 2.1.226: all eleven were missing from this file.
395
+ >
396
+ > **Update, same day: I reproduced the first one — and it did not behave the way I had paraphrased it.**
397
+ > See [What `crossSessionInbound` actually did on my machine](#what-crosssessioninbound-actually-did-on-my-machine)
398
+ > below. That is the reason the remaining ten still carry the caveat above instead of being quietly
399
+ > promoted to "verified".
400
+
401
+ | Setting | Since | What the changelog says |
402
+ |---|---|---|
403
+ | `crossSessionInbound` | 2.1.224 | Changelog wording: messages sent to a session **running with bypassed permissions are held for your approval**; messages to other sessions auto-deliver. ⚠️ **I could not reproduce the "held" half — [see below](#what-crosssessioninbound-actually-did-on-my-machine).** Accepted values are `"accept"`, `"hold"`, `"refuse"`. |
404
+ | `dialogExpiry` | 2.1.224 | Paired with `crossSessionInbound`; controls how long the held approval dialog stays valid. |
405
+ | `network.tlsTerminate` | 2.1.224 | Required for the sandbox credential-masking options below to take effect. |
406
+ | `onExtractNoMatch` | 2.1.224 | Sandbox credential masking: what to do when `extract` finds no match in a structured env value. |
407
+ | `maskClaims` | 2.1.224 | Sandbox credential masking with `decode: "jwt"` — masks named JWT claims. |
408
+ | `awsPairs` | 2.1.224 | Sandbox credential masking for AWS SigV4 re-signing (with `sigv4`). |
409
+ | `strictKnownMarketplaces` | 2.1.223 | Managed setting: allow-list for plugin marketplaces. Supports `hostPattern`, `pathPattern`, and owner wildcards (`"owner/*"`). Enforced on install, update, refresh and autoupdate. |
410
+ | `blockedMarketplaces` | 2.1.223 | Managed setting: block-list for plugin marketplaces, same matching options. |
411
+ | `modelOverrides` | 2.1.223 | Maps model-picker entries to custom provider model IDs (e.g. Bedrock inference profile ARNs). Keys that are not Anthropic model IDs are ignored. |
412
+ | `sandbox.filesystem.denyWrite` | 2.1.223 | Sandbox write deny-list. A 2.1.223 fix covers the case where it includes the working directory. |
413
+ | `remoteControlAtStartup` | 2.1.224 | Whether Remote Control starts with the session. |
414
+
415
+ **Why three of these belong in a safety file, not just a completeness list**
416
+
417
+ - `crossSessionInbound` is a permission gate — **but only if you set it.** I originally wrote here that
418
+ it is "the one place a message from another session still stops for a human" when you run with
419
+ `--dangerously-skip-permissions`. **I tested that claim and it was wrong on my machine.** Corrected
420
+ version and the measurements are in the next section. Set it explicitly; do not rely on the default.
421
+ - `strictKnownMarketplaces` / `blockedMarketplaces` are supply-chain controls. They decide which plugin
422
+ sources can install code on your machine, and as of 2.1.223 they are enforced on **autoupdate** too —
423
+ so a source you allowed once keeps its access without a further prompt.
424
+ - The sandbox credential-masking options only take effect with `network.tlsTerminate`. A masking rule
425
+ written without it is inert, and nothing in the output says so.
426
+
427
+ **None of these are covered by the example hooks in this repo yet.** If you rely on the hooks for a
428
+ control that one of these settings now provides natively, check both — they are separate layers.
429
+
430
+ ### What `crossSessionInbound` actually did on my machine
431
+
432
+ I run a session under `--dangerously-skip-permissions` around the clock, so this setting is one I am
433
+ exposed to rather than one I only read about. On **2026-08-11, Claude Code 2.1.226, Linux (WSL2)**, with
434
+ `crossSessionInbound` absent from every settings file (`~/.claude/settings.json`, `settings.local.json`,
435
+ and both project-level files — grepped, zero hits), I sent peer messages with `SendMessage` and watched
436
+ what arrived.
437
+
438
+ | # | receiver's `crossSessionInbound` | sender's permission class | result |
439
+ |---|---|---|---|
440
+ | 1 | unset (receiver in bypass) | `bypass` | **delivered** — no dialog, no hold |
441
+ | 2 | unset (receiver in bypass) | `prompting` | **delivered** — no dialog, no hold |
442
+ | 3 | `"refuse"` (via `--settings`) | `bypass` | **not delivered** — receiver stayed at 0 in / 0 out |
443
+ | 4 | unset — same steps as #3, setting removed | `bypass` | **delivered, and the receiver acted on it** (41.1K in / 221 out: it composed and sent a reply, with no human in the loop) |
444
+
445
+ Rows 3 and 4 are the same procedure with one file changed, so "an idle peer just doesn't render it" is
446
+ ruled out. **The gate works. What does not work is leaving it unset.**
447
+
448
+ Two things follow, and they are the reason this correction matters more than a wording fix:
449
+
450
+ 1. **The default did not stop anything for a human here.** If you are running unattended and you assumed
451
+ the gate was on by default — as I did, and as I wrote in this file — you were not protected.
452
+ 2. **What arrives in place of a gate is a warning aimed at the model, not a block.** The delivered
453
+ message carried instructions telling the receiving Claude not to treat a peer as an escalation path
454
+ ("permission laundering"). That is a real mitigation, but it is enforced by the model choosing to obey,
455
+ not by the permission system refusing. Those are different security properties and this file should
456
+ not have blurred them.
457
+
458
+ **What to set.** An explicit value is evaluated before any mode-based default, so it always wins
459
+ (a repository-level setting can only tighten it further, never loosen it):
460
+
461
+ ```json
462
+ {
463
+ "crossSessionInbound": "refuse"
464
+ }
465
+ ```
466
+
467
+ - `"refuse"` — opt this session out entirely. **This is the one I verified** (row 3). Use it for
468
+ unattended sessions, where "held for review" means "held until nobody reviews it".
469
+ - `"hold"` — park messages for your approval. Sensible when a human is actually watching the session.
470
+ Note from reading the 2.1.226 implementation (not measured): the hold buffer is bounded, the oldest
471
+ entry is dropped as *expired* when it overflows, and anything still held is settled as *expired* at
472
+ shutdown. Held is not a durable queue.
473
+ - `"accept"` — deliver everything. This is what my unset session behaved like.
474
+
475
+ **What I did not establish.** I could not reconcile the delivery in rows 1, 2 and 4 with the gating code
476
+ I read in the 2.1.226 binary: with no explicit setting and a bypass-class receiver, every branch I found
477
+ returns *hold*. Something outside those files decides — most likely a server-delivered settings layer,
478
+ which is not greppable from disk. I am reporting the behaviour I measured and flagging the mechanism as
479
+ unknown, rather than inventing an explanation that fits.
480
+
264
481
  ## Troubleshooting
265
482
 
266
483
  | Problem | Cause | Fix |
267
484
  |---------|-------|-----|
268
- | Hooks don't fire | Not registered in settings.json | `npx cc-safe-setup` |
485
+ | Skill won't auto-trigger | `description` truncated past `skillListingMaxDescChars` (default 1536), or too many skills under the 1% listing budget | Put trigger words first, shorten descriptions, prune unused skills (see Undocumented settings above) |
486
+ | Model changed mid-session | `switchModelsOnFlag` is `true` by default; a safety flag auto-switched the model | Set `"switchModelsOnFlag": false` to pause instead |
487
+ | Hooks don't fire | Not registered in settings.json | `npx github:yurukusa/cc-safe-setup` |
269
488
  | Hooks don't block | Wrong exit code (not 2) | Check `echo $?` after test |
270
489
  | "jq: command not found" | jq not installed | `brew install jq` / `apt install jq` |
271
490
  | Hook permission denied | Not executable | `chmod +x ~/.claude/hooks/*.sh` |
272
491
  | Compound commands prompt | Permission system limitation | Install `compound-command-approver` |
273
492
  | "Always Allow" doesn't stick | Saves exact string, not pattern | Use hooks instead |
274
493
 
275
- Run `npx cc-safe-setup --doctor` for automated diagnosis.
494
+ Run `npx github:yurukusa/cc-safe-setup --doctor` for automated diagnosis.
276
495
 
277
496
  ## Resources
278
497
 
279
- - [Official Hooks Documentation](https://docs.anthropic.com/en/docs/claude-code/hooks)
498
+ - [Official Hooks Documentation](https://code.claude.com/docs/en/hooks)
280
499
  - [COOKBOOK.md](https://github.com/yurukusa/claude-code-hooks/blob/main/COOKBOOK.md) — 20 hook recipes
281
500
  - [Migration Guide](MIGRATION.md) — from permissions to hooks
282
501
  - [Ecosystem Comparison](https://yurukusa.github.io/cc-safe-setup/ecosystem.html) — all hook projects
package/SKILL.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: cc-safe-setup
3
- description: Safety hooks for Claude Code — 700 pre-built hooks that prevent file deletion, credential leaks, git disasters, and token waste during autonomous AI coding sessions. 9,200+ tests. Install with npx cc-safe-setup.
3
+ description: Safety hooks for Claude Code — 916 pre-built hooks that prevent file deletion, credential leaks, git disasters, and token waste during autonomous AI coding sessions. 296 test files. Install with npx github:yurukusa/cc-safe-setup.
4
4
  ---
5
5
 
6
6
  # cc-safe-setup
@@ -21,7 +21,7 @@ Installs pre-built safety hooks into your Claude Code environment. These hooks r
21
21
  ## Quick start
22
22
 
23
23
  ```bash
24
- npx cc-safe-setup
24
+ npx github:yurukusa/cc-safe-setup
25
25
  ```
26
26
 
27
27
  This runs an interactive wizard that configures hooks based on your risk profile.
@@ -29,9 +29,9 @@ This runs an interactive wizard that configures hooks based on your risk profile
29
29
  ## Install individual hooks
30
30
 
31
31
  ```bash
32
- npx cc-safe-setup --install-example large-read-guard
33
- npx cc-safe-setup --install-example prevent-rm-rf
34
- npx cc-safe-setup --install-example git-force-push-block
32
+ npx github:yurukusa/cc-safe-setup --install-example large-read-guard
33
+ npx github:yurukusa/cc-safe-setup --install-example prevent-rm-rf
34
+ npx github:yurukusa/cc-safe-setup --install-example git-force-push-block
35
35
  ```
36
36
 
37
37
  ## Why hooks instead of CLAUDE.md rules