cc-safe-setup 4.0.1 → 4.0.3

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.
@@ -1,64 +1,26 @@
1
1
  # Example Hooks
2
2
 
3
- 25 hooks beyond the 8 built-in ones, organized by category.
4
-
5
- ## Quick Start
3
+ 38 installable hooks. Each solves a real problem from GitHub Issues or autonomous operation.
6
4
 
7
5
  ```bash
8
- # One command — copies hook, updates settings.json, makes executable
9
- npx cc-safe-setup --install-example block-database-wipe
10
-
11
- # Browse all examples with categories
12
- npx cc-safe-setup --examples
6
+ npx cc-safe-setup --install-example <name>
7
+ npx cc-safe-setup --examples # list all
13
8
  ```
14
9
 
15
- ## Safety Guards
16
-
17
- | Hook | Purpose | Issue |
18
- |------|---------|-------|
19
- | **allowlist.sh** | Block everything not explicitly approved | [#37471](https://github.com/anthropics/claude-code/issues/37471) |
20
- | **block-database-wipe.sh** | Block migrate:fresh, DROP DATABASE, Prisma reset | [#37405](https://github.com/anthropics/claude-code/issues/37405) |
21
- | **deploy-guard.sh** | Block deploy with uncommitted changes | [#37314](https://github.com/anthropics/claude-code/issues/37314) |
22
- | **env-var-check.sh** | Block hardcoded API keys in export commands | |
23
- | **git-config-guard.sh** | Block git config --global | [#37201](https://github.com/anthropics/claude-code/issues/37201) |
24
- | **network-guard.sh** | Warn on suspicious network commands | [#37420](https://github.com/anthropics/claude-code/issues/37420) |
25
- | **path-traversal-guard.sh** | Block Edit/Write with ../ path traversal | |
26
- | **protect-dotfiles.sh** | Block changes to ~/.bashrc, ~/.aws/, ~/.ssh/ | [#37478](https://github.com/anthropics/claude-code/issues/37478) |
27
- | **scope-guard.sh** | Block operations outside project directory | [#36233](https://github.com/anthropics/claude-code/issues/36233) |
28
- | **test-before-push.sh** | Block git push without tests | [#36970](https://github.com/anthropics/claude-code/issues/36970) |
29
- | **timeout-guard.sh** | Warn before long-running commands (servers, watchers) | |
30
-
31
- ## Auto-Approve
32
-
33
- | Hook | Purpose | Issue |
34
- |------|---------|-------|
35
- | **auto-approve-build.sh** | npm/yarn/cargo/go build, test, lint | |
36
- | **auto-approve-docker.sh** | docker build, compose, ps, logs | |
37
- | **auto-approve-git-read.sh** | git status/log/diff with -C flags | [#36900](https://github.com/anthropics/claude-code/issues/36900) |
38
- | **auto-approve-python.sh** | pytest, mypy, ruff, black, isort | |
39
- | **auto-approve-ssh.sh** | Safe SSH commands (uptime, whoami) | |
40
-
41
- ## Quality
10
+ ## Safety Guards (13)
11
+ allowlist, block-database-wipe, case-sensitive-guard, compound-command-approver, deploy-guard, env-var-check, git-config-guard, network-guard, path-traversal-guard, protect-dotfiles, scope-guard, test-before-push, timeout-guard
42
12
 
43
- | Hook | Purpose | Issue |
44
- |------|---------|-------|
45
- | **branch-name-check.sh** | Warn on non-conventional branch names | |
46
- | **commit-message-check.sh** | Warn on non-conventional commit messages | |
47
- | **edit-guard.sh** | Block Edit/Write to protected files | [#37210](https://github.com/anthropics/claude-code/issues/37210) |
48
- | **enforce-tests.sh** | Warn when source changes without tests | |
49
- | **large-file-guard.sh** | Warn when Write creates files >500KB | |
50
- | **todo-check.sh** | Warn when committing files with TODO/FIXME | |
51
- | **verify-before-commit.sh** | Block commit unless tests passed recently | [#37818](https://github.com/anthropics/claude-code/issues/37818) |
13
+ ## Auto-Approve (5)
14
+ auto-approve-build, auto-approve-docker, auto-approve-git-read, auto-approve-python, auto-approve-ssh
52
15
 
53
- ## Recovery
16
+ ## Quality (8)
17
+ branch-name-check, commit-message-check, commit-quality-gate, edit-guard, enforce-tests, large-file-guard, todo-check, verify-before-commit
54
18
 
55
- | Hook | Purpose | Issue |
56
- |------|---------|-------|
57
- | **auto-checkpoint.sh** | Auto-commit after edits (compaction protection) | [#34674](https://github.com/anthropics/claude-code/issues/34674) |
58
- | **auto-snapshot.sh** | Save file copies before edits | [#37386](https://github.com/anthropics/claude-code/issues/37386) |
19
+ ## Recovery (3)
20
+ auto-checkpoint, auto-snapshot, session-checkpoint
59
21
 
60
- ## UX
22
+ ## UX (9)
23
+ cost-tracker, dependency-audit, diff-size-guard, hook-debug-wrapper, loop-detector, notify-waiting, read-before-edit, session-handoff, tmp-cleanup
61
24
 
62
- | Hook | Purpose | Issue |
63
- |------|---------|-------|
64
- | **notify-waiting.sh** | Desktop notification when Claude waits | |
25
+ ## Write Your Own
26
+ See [CONTRIBUTING.md](../CONTRIBUTING.md).
package/index.mjs CHANGED
@@ -363,12 +363,18 @@ function examples() {
363
363
  },
364
364
  };
365
365
 
366
+ // Optional category filter: --examples safety, --examples ux, etc.
367
+ const filterArg = process.argv[process.argv.indexOf('--examples') + 1] || process.argv[process.argv.indexOf('-e') + 1] || '';
368
+ const filter = filterArg.toLowerCase();
369
+
366
370
  console.log();
367
- console.log(c.bold + ' cc-safe-setup --examples' + c.reset);
368
- console.log(c.dim + ' 30 hooks beyond the 8 built-in ones' + c.reset);
371
+ console.log(c.bold + ' cc-safe-setup --examples' + c.reset + (filter ? ' ' + filter : ''));
372
+ console.log(c.dim + ' 38 hooks beyond the 8 built-in ones' + c.reset);
373
+ if (filter) console.log(c.dim + ' Filter: ' + filter + c.reset);
369
374
  console.log();
370
375
 
371
376
  for (const [cat, hooks] of Object.entries(CATEGORIES)) {
377
+ if (filter && !cat.toLowerCase().includes(filter)) continue;
372
378
  console.log(' ' + c.bold + c.blue + cat + c.reset);
373
379
  for (const [file, desc] of Object.entries(hooks)) {
374
380
  console.log(' ' + c.green + '*' + c.reset + ' ' + c.bold + file + c.reset);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc-safe-setup",
3
- "version": "4.0.1",
3
+ "version": "4.0.3",
4
4
  "description": "One command to make Claude Code safe for autonomous operation. 8 built-in + 38 examples. 22 commands including dashboard, create, audit, lint, diff, benchmark. 2,500+ daily npm downloads.",
5
5
  "main": "index.mjs",
6
6
  "bin": {
@@ -35,5 +35,5 @@
35
35
  "type": "git",
36
36
  "url": "https://github.com/yurukusa/cc-safe-setup"
37
37
  },
38
- "homepage": "https://github.com/yurukusa/cc-safe-setup"
38
+ "homepage": "https://yurukusa.github.io/cc-safe-setup/"
39
39
  }