Skip to content
This repository was archived by the owner on Apr 11, 2026. It is now read-only.

Commit 084fbc4

Browse files
z23ccclaude
andcommitted
feat: port all hook scripts to Rust, delete shell originals
Added 4 hook subcommands to flowctl hook: - commit-gate: blocks git commit without guard pass - pre-compact: injects .flow/ state into compaction context - subagent-context: injects active tasks for worker agents - task-completed: syncs Claude task completion with .flow/ unlock Deleted 7 shell scripts from scripts/hooks/: commit-gate.sh, pre-compact.sh, subagent-context.sh, task-completed.sh, ralph-guard.sh, ralph-receipt-guard.sh, ralph-verbose-log.sh hooks.json: all entries now call bin/flowctl hook <subcommand>. Zero shell or Python scripts in hooks. Pure Rust. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 7aa1567 commit 084fbc4

9 files changed

Lines changed: 498 additions & 499 deletions

File tree

flowctl/crates/flowctl-cli/src/commands/hook.rs

Lines changed: 493 additions & 0 deletions
Large diffs are not rendered by default.

hooks/hooks.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"hooks": [
1818
{
1919
"type": "command",
20-
"command": "[ ! -d .flow ] || bash \"${DROID_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}/scripts/hooks/commit-gate.sh\"",
20+
"command": "[ ! -d .flow ] || \"${DROID_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}/bin/flowctl\" hook commit-gate",
2121
"timeout": 10
2222
}
2323
],
@@ -50,7 +50,7 @@
5050
"hooks": [
5151
{
5252
"type": "command",
53-
"command": "[ ! -d .flow ] || bash \"${DROID_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}/scripts/hooks/commit-gate.sh\"",
53+
"command": "[ ! -d .flow ] || \"${DROID_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}/bin/flowctl\" hook commit-gate",
5454
"timeout": 10
5555
}
5656
],
@@ -95,7 +95,7 @@
9595
"hooks": [
9696
{
9797
"type": "command",
98-
"command": "[ ! -f \"${CLAUDE_PLUGIN_ROOT:-${DROID_PLUGIN_ROOT}}/scripts/hooks/subagent-context.sh\" ] || bash \"${CLAUDE_PLUGIN_ROOT:-${DROID_PLUGIN_ROOT}}/scripts/hooks/subagent-context.sh\"",
98+
"command": "[ ! -d .flow ] || \"${DROID_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}/bin/flowctl\" hook subagent-context",
9999
"timeout": 5
100100
}
101101
]
@@ -107,7 +107,7 @@
107107
"hooks": [
108108
{
109109
"type": "command",
110-
"command": "[ ! -f \"${CLAUDE_PLUGIN_ROOT:-${DROID_PLUGIN_ROOT}}/scripts/hooks/pre-compact.sh\" ] || bash \"${CLAUDE_PLUGIN_ROOT:-${DROID_PLUGIN_ROOT}}/scripts/hooks/pre-compact.sh\"",
110+
"command": "[ ! -d .flow ] || \"${DROID_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}/bin/flowctl\" hook pre-compact",
111111
"timeout": 10
112112
}
113113
]
@@ -119,7 +119,7 @@
119119
"hooks": [
120120
{
121121
"type": "command",
122-
"command": "[ ! -f \"${CLAUDE_PLUGIN_ROOT:-${DROID_PLUGIN_ROOT}}/scripts/hooks/task-completed.sh\" ] || bash \"${CLAUDE_PLUGIN_ROOT:-${DROID_PLUGIN_ROOT}}/scripts/hooks/task-completed.sh\"",
122+
"command": "[ ! -d .flow ] || \"${DROID_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}/bin/flowctl\" hook task-completed",
123123
"timeout": 5
124124
}
125125
]

scripts/hooks/commit-gate.sh

Lines changed: 0 additions & 117 deletions
This file was deleted.

scripts/hooks/pre-compact.sh

Lines changed: 0 additions & 90 deletions
This file was deleted.

scripts/hooks/ralph-guard.sh

Lines changed: 0 additions & 115 deletions
This file was deleted.

0 commit comments

Comments
 (0)