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

Commit 7aa1567

Browse files
z23ccclaude
andcommitted
chore: remove Python hook scripts, all hooks now use Rust binary
- Deleted scripts/hooks/auto-memory.py (288 lines) - Deleted scripts/hooks/ralph-guard.py (751 lines) - hooks.json: all 5 ralph-guard refs → flowctl hook ralph-guard - ralph-init SKILL.md: no longer copies Python hook files - docs/ralph.md + CODEBASE_MAP.md: updated references Python hook scripts: 0 remaining. All hooks run via bin/flowctl. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 4119104 commit 7aa1567

6 files changed

Lines changed: 17 additions & 1059 deletions

File tree

docs/CODEBASE_MAP.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ flow-code/
146146
│ │ ├── __init__.py, commands.py, prompts.py
147147
│ │ ├── adversarial.py, checkpoint.py, codex_utils.py
148148
│ ├── hooks/
149-
│ │ ├── auto-memory.py # Stop hook: Gemini transcript → .flow/memory/
150-
│ │ └── ralph-guard.py # Ralph workflow enforcer
149+
│ │ ├── flowctl hook auto-memory # Stop hook: transcript → .flow/memory/
150+
│ │ └── flowctl hook ralph-guard # Ralph workflow enforcer (Rust)
151151
│ ├── smoke_test.sh # Quick flowctl sanity test
152152
│ ├── ci_test.sh # Comprehensive CI test suite
153153
│ └── ralph_*.sh # Ralph smoke/e2e test scripts
@@ -212,17 +212,17 @@ flow-code/
212212

213213
```
214214
PreToolUse (Bash|Execute, Edit|Write)
215-
└── ralph-guard.py — blocks invalid commands during Ralph runs
215+
└── flowctl hook ralph-guard — blocks invalid commands during Ralph runs
216216
217217
PostToolUse (Bash|Execute)
218-
└── ralph-guard.py — tracks state (verdicts, receipts, done calls)
218+
└── flowctl hook ralph-guard — tracks state (verdicts, receipts, done calls)
219219
220220
Stop
221-
├── ralph-guard.py — blocks stop if receipt missing
222-
└── auto-memory.py — extracts learnings via Gemini → .flow/memory/
221+
├── flowctl hook ralph-guard — blocks stop if receipt missing
222+
└── flowctl hook auto-memory — extracts learnings via Gemini → .flow/memory/
223223
224224
SubagentStop
225-
└── ralph-guard.py — same as Stop
225+
└── flowctl hook ralph-guard — same as Stop
226226
```
227227

228228
All hooks are conditional — no-op if guard/memory files don't exist.
@@ -329,7 +329,7 @@ sequenceDiagram
329329

330330
- `flowctl.py` uses `datetime.utcnow()` (deprecated in Python 3.12+) — expect DeprecationWarning
331331
- `which flowctl` will always fail — it's bundled, not installed globally
332-
- Ralph hooks only activate when `FLOW_RALPH=1` AND `scripts/ralph/hooks/ralph-guard.py` exists
332+
- Ralph hooks only activate when `FLOW_RALPH=1` AND `bin/flowctl` exists
333333
- Auto-memory hook timeout is 45s (Gemini call) — can slow session exit
334334
- `scan-codebase.py` requires `tiktoken` — use `uv run` for auto-install or `pip install tiktoken`
335335
- Worker has `disallowedTools: Task` — cannot spawn sub-agents (prevents infinite nesting)

docs/ralph.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ Plugin hooks enforce workflow rules deterministically.
716716
```
717717
plugins/flow-code/
718718
hooks/hooks.json # Config
719-
scripts/hooks/ralph-guard.py # Logic
719+
bin/flowctl hook ralph-guard # Logic
720720
```
721721

722722
**Disable temporarily:** Unset `FLOW_RALPH`

hooks/hooks.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"hooks": [
88
{
99
"type": "command",
10-
"command": "[ ! -f scripts/ralph/hooks/ralph-guard.py ] || scripts/ralph/hooks/ralph-guard.py",
10+
"command": "\"${DROID_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}/bin/flowctl\" hook ralph-guard",
1111
"timeout": 5
1212
}
1313
]
@@ -28,7 +28,7 @@
2828
"hooks": [
2929
{
3030
"type": "command",
31-
"command": "[ ! -f scripts/ralph/hooks/ralph-guard.py ] || scripts/ralph/hooks/ralph-guard.py",
31+
"command": "\"${DROID_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}/bin/flowctl\" hook ralph-guard",
3232
"timeout": 5
3333
}
3434
]
@@ -40,7 +40,7 @@
4040
"hooks": [
4141
{
4242
"type": "command",
43-
"command": "[ ! -f scripts/ralph/hooks/ralph-guard.py ] || scripts/ralph/hooks/ralph-guard.py",
43+
"command": "\"${DROID_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}/bin/flowctl\" hook ralph-guard",
4444
"timeout": 5
4545
}
4646
]
@@ -62,7 +62,7 @@
6262
"hooks": [
6363
{
6464
"type": "command",
65-
"command": "[ ! -f scripts/ralph/hooks/ralph-guard.py ] || scripts/ralph/hooks/ralph-guard.py",
65+
"command": "\"${DROID_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}/bin/flowctl\" hook ralph-guard",
6666
"timeout": 5
6767
}
6868
]
@@ -83,7 +83,7 @@
8383
"hooks": [
8484
{
8585
"type": "command",
86-
"command": "[ ! -f scripts/ralph/hooks/ralph-guard.py ] || scripts/ralph/hooks/ralph-guard.py",
86+
"command": "\"${DROID_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}/bin/flowctl\" hook ralph-guard",
8787
"timeout": 5
8888
}
8989
]

scripts/hooks/auto-memory.py

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

0 commit comments

Comments
 (0)