cc-safe-setup 12.5.0 → 12.6.0
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
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
**One command to make Claude Code safe for autonomous operation.** [日本語](docs/README.ja.md)
|
|
8
8
|
|
|
9
|
-
8 built-in + 124 examples = **
|
|
9
|
+
8 built-in + 124 examples = **135 hooks**. 42 CLI commands. 561 tests. 5 languages. [**Hub**](https://yurukusa.github.io/cc-safe-setup/hub.html) · [Wizard](https://yurukusa.github.io/cc-safe-setup/wizard.html) · [Cheat Sheet](https://yurukusa.github.io/cc-safe-setup/hooks-cheatsheet.html) · [Builder](https://yurukusa.github.io/cc-safe-setup/builder.html) · [FAQ](https://yurukusa.github.io/cc-safe-setup/faq.html) · [Examples](https://yurukusa.github.io/cc-safe-setup/by-example.html) · [Matrix](https://yurukusa.github.io/cc-safe-setup/matrix.html) · [Playground](https://yurukusa.github.io/cc-hook-registry/playground.html)
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
12
|
npx cc-safe-setup
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# ================================================================
|
|
3
|
+
# dangling-process-guard.sh — Detect background processes left running
|
|
4
|
+
# ================================================================
|
|
5
|
+
# PURPOSE:
|
|
6
|
+
# Claude starts dev servers, watchers, and long-running processes
|
|
7
|
+
# with & or nohup. These persist after the session ends, consuming
|
|
8
|
+
# resources and ports. This Stop hook lists any processes started
|
|
9
|
+
# in the current directory.
|
|
10
|
+
#
|
|
11
|
+
# TRIGGER: Stop MATCHER: ""
|
|
12
|
+
# ================================================================
|
|
13
|
+
|
|
14
|
+
# Find processes with CWD matching current directory
|
|
15
|
+
CWD=$(pwd)
|
|
16
|
+
PROCS=$(ps aux 2>/dev/null | grep -v grep | grep "$CWD" | grep -vE '(claude|node.*cc-safe)' | head -5)
|
|
17
|
+
|
|
18
|
+
if [ -n "$PROCS" ]; then
|
|
19
|
+
COUNT=$(echo "$PROCS" | wc -l)
|
|
20
|
+
echo "" >&2
|
|
21
|
+
echo "NOTE: $COUNT process(es) still running in $CWD:" >&2
|
|
22
|
+
echo "$PROCS" | awk '{print " PID " $2 ": " $11}' >&2
|
|
23
|
+
echo "Kill with: kill \$(lsof -t -i :PORT) or kill PID" >&2
|
|
24
|
+
fi
|
|
25
|
+
|
|
26
|
+
exit 0
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# git-signed-commit-guard.sh — Warn on unsigned git commits
|
|
3
|
+
# TRIGGER: PreToolUse MATCHER: "Bash"
|
|
4
|
+
COMMAND=$(cat | jq -r '.tool_input.command // empty' 2>/dev/null)
|
|
5
|
+
[ -z "$COMMAND" ] && exit 0
|
|
6
|
+
echo "$COMMAND" | grep -qE '^\s*git\s+commit' || exit 0
|
|
7
|
+
# Check if GPG signing is configured
|
|
8
|
+
SIGN=$(git config commit.gpgsign 2>/dev/null)
|
|
9
|
+
if [ "$SIGN" = "true" ] && echo "$COMMAND" | grep -q '\-\-no-gpg-sign'; then
|
|
10
|
+
echo "WARNING: Commit with --no-gpg-sign bypasses GPG signing policy." >&2
|
|
11
|
+
fi
|
|
12
|
+
exit 0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cc-safe-setup",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.6.0",
|
|
4
4
|
"description": "One command to make Claude Code safe. 59 hooks (8 built-in + 51 examples). 26 CLI commands: dashboard, create, audit, lint, diff, migrate, compare, generate-ci. 284 tests.",
|
|
5
5
|
"main": "index.mjs",
|
|
6
6
|
"bin": {
|