cc-safe-setup 30.0.5 → 30.0.7
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.
- package/README.md +10 -4
- package/SAFETY_CHECKLIST.md +8 -6
- package/action.yml +3 -3
- package/index.mjs +15 -5
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ npx github:yurukusa/cc-safe-setup
|
|
|
9
9
|
|
|
10
10
|
The command is interactive: it shows what each hook does and lets you choose which to install into your `~/.claude/settings.json` (or a project-local `.claude/settings.json`). Nothing is installed without your confirmation. MIT licensed.
|
|
11
11
|
|
|
12
|
-
>
|
|
12
|
+
> **`npx cc-safe-setup` is current again.** The npm release sat at 29.8.0 (2026-04-20) for five months because publishing was blocked on a credential; **30.0.5 was published on 2026-09-24** and `latest` points at it. Either install command now gives you the same guards. If you installed from npm before that date you have 29.8.0, which lets twenty-five command shapes through that the current code blocks — the measurement, and how to check what you have, are in [The npm release was behind this repository](#the-npm-release-was-behind-this-repository) below.
|
|
13
13
|
|
|
14
14
|
Reading this in order, rather than by section: **[The Claude Code Safety Field Manual](https://leanpub.com/claude-code-safety-field-manual)** is this repository's documentation laid out as a path — the pre-flight checklist, what each guard actually refuses, how to make one fire on purpose so you can watch it work, and what to read in the log afterwards. The minimum price is zero.
|
|
15
15
|
|
|
@@ -28,7 +28,7 @@ links such as a gist or GitHub itself, or with no referrer recorded at all.)
|
|
|
28
28
|
| The hook runs, but never on the commands you care about | Your pattern is anchored where your commands are not | [A hook can be installed, current, registered — and still never see you](#a-hook-can-be-installed-current-registered--and-still-never-see-you) |
|
|
29
29
|
| You are not sure the hook does anything | You have not fired it on purpose yet | [Proving a hook fires](#proving-a-hook-fires) |
|
|
30
30
|
| The hooks are installed but feel out of date | Installed copies are snapshots and do not update themselves | [Your installed hooks do not update themselves](#your-installed-hooks-do-not-update-themselves) |
|
|
31
|
-
| `npx cc-safe-setup` behaves unlike this page | npm
|
|
31
|
+
| `npx cc-safe-setup` behaves unlike this page | You installed before 2026-09-24, when npm was still serving 29.8.0 | [The npm release was behind this repository](#the-npm-release-was-behind-this-repository) |
|
|
32
32
|
|
|
33
33
|
## Install as a Claude Code plugin
|
|
34
34
|
|
|
@@ -71,9 +71,15 @@ These are the exit codes, not the intent. Read them before trusting the row abov
|
|
|
71
71
|
Hooks stop a tool call before it runs. They are not a permission boundary — pair them with
|
|
72
72
|
`permissions.deny` and keep secrets outside the repository.
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
<a id="the-npm-release-is-behind-this-repository"></a>
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
## The npm release was behind this repository
|
|
77
|
+
|
|
78
|
+
This is kept as a record, because the gap lasted five months and anyone who installed from npm in that window still has the old guards.
|
|
79
|
+
|
|
80
|
+
From 2026-04-20 to 2026-09-24, `npx cc-safe-setup` installed **29.8.0** while this repository moved on: the publishing credential had expired and the account's only second factor is a hardware key, so nothing automated could replace it. That is fixed — publishing now runs through npm trusted publishing (OIDC), and **30.0.5 went out on 2026-09-24**. `npx cc-safe-setup` and `npx github:yurukusa/cc-safe-setup` now install the same code.
|
|
81
|
+
|
|
82
|
+
If you installed before 2026-09-24, run `npx cc-safe-setup --outdated` to see which of your hooks differ from the current ones. The table below is what the difference was.
|
|
77
83
|
|
|
78
84
|
The gap is not cosmetic. I fired twenty-two command shapes at both versions on 2026-09-03, feeding each guard the same JSON on stdin and running it with `bash` — the shell the installer names when it registers the hook. The guards shipped in 29.8.0 allow **nine** of those shapes that 30.0.4 refuses. Nothing went the other way: there is no shape 29.8.0 blocks and 30.0.4 lets through, and two harmless controls (`rm -rf node_modules`, `git push origin feature`) are allowed by both. Only `exit 2` counts as blocked here; `exit 1`, `exit 127` and a crash all let the command run.
|
|
79
85
|
|
package/SAFETY_CHECKLIST.md
CHANGED
|
@@ -53,9 +53,11 @@ Use this checklist before running Claude Code autonomously. Copy to your project
|
|
|
53
53
|
| Commit without tests | verify-before-commit | `--install-example verify-before-commit` |
|
|
54
54
|
| Session crash data loss | session-checkpoint | `--install-example session-checkpoint` |
|
|
55
55
|
|
|
56
|
-
##
|
|
57
|
-
|
|
58
|
-
The npm entry
|
|
59
|
-
current code blocks — measured 2026-09-03 across twenty-two shapes,
|
|
60
|
-
the other direction. The table is in the README.
|
|
61
|
-
|
|
56
|
+
## `github:` and the bare package name now install the same thing
|
|
57
|
+
|
|
58
|
+
The npm entry was frozen at 29.8.0 (2026-04-20) for five months and let twenty-five command
|
|
59
|
+
shapes through that the current code blocks — measured 2026-09-03 across twenty-two shapes,
|
|
60
|
+
with nothing failing in the other direction. The table is in the README. **30.0.5 was published
|
|
61
|
+
on 2026-09-24**, so either install command now gives you the guards this checklist describes.
|
|
62
|
+
If you installed before that date, run `npx cc-safe-setup --outdated` before you trust what you
|
|
63
|
+
have.
|
package/action.yml
CHANGED
|
@@ -29,9 +29,9 @@ runs:
|
|
|
29
29
|
shell: bash
|
|
30
30
|
run: |
|
|
31
31
|
echo "::group::Claude Code Safety Audit"
|
|
32
|
-
# Run the repository, not the npm entry.
|
|
33
|
-
# 29.8.0
|
|
34
|
-
#
|
|
32
|
+
# Run the repository, not the npm entry. npm caught up on 2026-09-24 (30.0.5
|
|
33
|
+
# after five months on 29.8.0), but the repository is still the newest code by
|
|
34
|
+
# definition: it needs no publish step, so this action cannot fall behind it.
|
|
35
35
|
npx -y github:yurukusa/cc-safe-setup --audit --json 2>/dev/null > /tmp/audit-json.txt || true
|
|
36
36
|
npx -y github:yurukusa/cc-safe-setup --audit 2>&1 | tee /tmp/audit-output.txt
|
|
37
37
|
echo "::endgroup::"
|
package/index.mjs
CHANGED
|
@@ -219,8 +219,8 @@ if (HELP) {
|
|
|
219
219
|
npx github:yurukusa/cc-safe-setup Install 8 safety hooks (30 sec)
|
|
220
220
|
npx github:yurukusa/cc-safe-setup --shield Maximum safety — one command
|
|
221
221
|
npx github:yurukusa/cc-safe-setup --doctor Diagnose hook problems
|
|
222
|
-
(the
|
|
223
|
-
|
|
222
|
+
(npx cc-safe-setup now installs the same code; npm sat at 29.8.0 / 2026-04-20
|
|
223
|
+
for five months, so run --outdated if you installed before 2026-09-24)
|
|
224
224
|
|
|
225
225
|
Protect:
|
|
226
226
|
--protect .env Block edits to a specific file
|
|
@@ -277,9 +277,10 @@ if (HELP) {
|
|
|
277
277
|
Find hooks: npx cc-hook-registry search <keyword>
|
|
278
278
|
Test hooks: npx cc-hook-test <hook.sh>
|
|
279
279
|
|
|
280
|
+
Field Manual: https://leanpub.com/claude-code-safety-field-manual (this repo as a book, free)
|
|
280
281
|
Token Checkup: https://yurukusa.github.io/cc-safe-setup/token-checkup.html
|
|
281
282
|
Token Book: https://yurukusa.github.io/cc-safe-setup/token-book.html
|
|
282
|
-
Safety Guide: https://zenn.dev/yurukusa/books/6076c23b1cb18b
|
|
283
|
+
Safety Guide: https://zenn.dev/yurukusa/books/6076c23b1cb18b (Japanese)
|
|
283
284
|
|
|
284
285
|
Hitting nested sub-agent dispatch (Task tool absent from sub-agent contexts)?
|
|
285
286
|
See: https://gist.github.com/yurukusa/cf477f03f03d9f93c184f1fb7d894f96
|
|
@@ -1930,9 +1931,17 @@ async function audit() {
|
|
|
1930
1931
|
// not a book link: the 100 real incidents validate the abstract risks just
|
|
1931
1932
|
// shown and cost nothing, so the deeper path stays free-education-first.
|
|
1932
1933
|
console.log(c.dim + ' • 100 real incidents these guards prevent: https://yurukusa.github.io/cc-safe-setup/incidents.html' + c.reset);
|
|
1933
|
-
console.log(c.dim + ' • Incident-prevention guide (Ch.3 free): https://zenn.dev/yurukusa/books/6076c23b1cb18b' + c.reset);
|
|
1934
1934
|
}
|
|
1935
|
+
// 2026-09-25: this list had no English destination at all — an English-speaking
|
|
1936
|
+
// user was sent to a Japanese book as the only "go deeper" option. The field
|
|
1937
|
+
// manual is this repository's own documentation, in English, minimum price zero.
|
|
1938
|
+
// The Japanese guide moves to the end and says so, so a reader can tell before
|
|
1939
|
+
// clicking which language they are about to land in.
|
|
1940
|
+
console.log(c.dim + ' • Everything here as a book (English, free): https://leanpub.com/claude-code-safety-field-manual' + c.reset);
|
|
1935
1941
|
console.log(c.dim + ' • Cut token cost (Ch.1 free): https://yurukusa.github.io/cc-safe-setup/token-book.html' + c.reset);
|
|
1942
|
+
if (score < 80) {
|
|
1943
|
+
console.log(c.dim + ' • Incident-prevention guide (Japanese, Ch.3 free): https://zenn.dev/yurukusa/books/6076c23b1cb18b' + c.reset);
|
|
1944
|
+
}
|
|
1936
1945
|
}
|
|
1937
1946
|
|
|
1938
1947
|
console.log();
|
|
@@ -3220,8 +3229,9 @@ async function team() {
|
|
|
3220
3229
|
// steps first (value-first, not a sales pitch). The deeper paid guides have free
|
|
3221
3230
|
// chapters, so they read as "go deeper if this helped" rather than an upsell.
|
|
3222
3231
|
console.log(c.bold + ' Go deeper (all free to start):' + c.reset);
|
|
3232
|
+
console.log(c.dim + ' • Everything here as a book (English, free): https://leanpub.com/claude-code-safety-field-manual' + c.reset);
|
|
3223
3233
|
console.log(c.dim + ' • Cut token cost (Ch.1 free): https://yurukusa.github.io/cc-safe-setup/token-book.html' + c.reset);
|
|
3224
|
-
console.log(c.dim + ' • Incident-prevention guide (Ch.3 free): https://zenn.dev/yurukusa/books/6076c23b1cb18b' + c.reset);
|
|
3234
|
+
console.log(c.dim + ' • Incident-prevention guide (Japanese, Ch.3 free): https://zenn.dev/yurukusa/books/6076c23b1cb18b' + c.reset);
|
|
3225
3235
|
console.log();
|
|
3226
3236
|
}
|
|
3227
3237
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cc-safe-setup",
|
|
3
|
-
"version": "30.0.
|
|
3
|
+
"version": "30.0.7",
|
|
4
4
|
"description": "Safety hooks for Claude Code: PreToolUse/PostToolUse/Stop guards that block destructive or irreversible operations at the tool boundary and surface silent failures. Interactive installer, plain shell scripts, no npm dependencies (the hooks read their JSON input with jq, python3 or node).",
|
|
5
5
|
"main": "index.mjs",
|
|
6
6
|
"bin": {
|
|
@@ -47,4 +47,4 @@
|
|
|
47
47
|
"type": "github",
|
|
48
48
|
"url": "https://github.com/sponsors/yurukusa"
|
|
49
49
|
}
|
|
50
|
-
}
|
|
50
|
+
}
|