cc-safe-setup 1.0.2 → 1.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.
- package/README.md +31 -0
- package/index.mjs +10 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# cc-safe-setup
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/cc-safe-setup)
|
|
4
|
+
[](https://www.npmjs.com/package/cc-safe-setup)
|
|
5
|
+
|
|
3
6
|
**One command to make Claude Code safe for autonomous operation.**
|
|
4
7
|
|
|
5
8
|
```bash
|
|
@@ -8,6 +11,34 @@ npx cc-safe-setup
|
|
|
8
11
|
|
|
9
12
|
Installs 4 production-tested safety hooks in ~10 seconds. Zero dependencies. No manual configuration.
|
|
10
13
|
|
|
14
|
+
```
|
|
15
|
+
cc-safe-setup
|
|
16
|
+
Make Claude Code safe for autonomous operation
|
|
17
|
+
|
|
18
|
+
Prevents real incidents:
|
|
19
|
+
✗ rm -rf deleting entire user directories (NTFS junction traversal)
|
|
20
|
+
✗ Untested code pushed to main at 3am
|
|
21
|
+
✗ Syntax errors cascading through 30+ files
|
|
22
|
+
✗ Sessions losing all context with no warning
|
|
23
|
+
|
|
24
|
+
Hooks to install:
|
|
25
|
+
|
|
26
|
+
● Destructive Command Blocker
|
|
27
|
+
● Branch Push Protector
|
|
28
|
+
● Post-Edit Syntax Validator
|
|
29
|
+
● Context Window Monitor
|
|
30
|
+
|
|
31
|
+
Install all 4 safety hooks? [Y/n] Y
|
|
32
|
+
|
|
33
|
+
✓ Destructive Command Blocker
|
|
34
|
+
✓ Branch Push Protector
|
|
35
|
+
✓ Post-Edit Syntax Validator
|
|
36
|
+
✓ Context Window Monitor
|
|
37
|
+
✓ settings.json updated
|
|
38
|
+
|
|
39
|
+
Done. 4 safety hooks installed.
|
|
40
|
+
```
|
|
41
|
+
|
|
11
42
|
## Why This Exists
|
|
12
43
|
|
|
13
44
|
A Claude Code user [lost their entire C:\Users directory](https://github.com/anthropics/claude-code/issues/36339) when `rm -rf` followed NTFS junctions. Another had untested code pushed to main at 3am. Syntax errors cascaded through 30+ files before anyone noticed.
|
package/index.mjs
CHANGED
|
@@ -54,6 +54,16 @@ async function main() {
|
|
|
54
54
|
console.log(c.bold + ' cc-safe-setup' + c.reset);
|
|
55
55
|
console.log(c.dim + ' Make Claude Code safe for autonomous operation' + c.reset);
|
|
56
56
|
console.log();
|
|
57
|
+
// Check jq dependency
|
|
58
|
+
try {
|
|
59
|
+
const { execSync } = await import('child_process');
|
|
60
|
+
execSync('which jq', { stdio: 'pipe' });
|
|
61
|
+
} catch(e) {
|
|
62
|
+
console.log(c.yellow + ' Warning: jq is not installed. Hooks require jq for JSON parsing.' + c.reset);
|
|
63
|
+
console.log(c.dim + ' Install: brew install jq (macOS) | apt install jq (Linux)' + c.reset);
|
|
64
|
+
console.log();
|
|
65
|
+
}
|
|
66
|
+
|
|
57
67
|
console.log(c.dim + ' Prevents real incidents:' + c.reset);
|
|
58
68
|
console.log(c.red + ' x' + c.reset + ' rm -rf deleting entire user directories (NTFS junction traversal)');
|
|
59
69
|
console.log(c.red + ' x' + c.reset + ' Untested code pushed to main at 3am');
|
package/package.json
CHANGED