fix: install Stop hook once at loop startup, not per-iteration

Per-iteration install/remove had a race condition: settings.local.json
was written immediately before CC started, and CC could read the old
file (without the hook) on the first iteration.

Now the hook is installed once when loop.sh starts and removed on exit.
The AGENT_LOOP_ACTIVE env var guard ensures it only fires for CC sessions
spawned by the loop, so keeping it installed the whole time is safe.
This commit is contained in:
2026-04-02 10:51:48 -04:00
parent a1a3dfbd63
commit b516492a91
3 changed files with 7 additions and 9 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "agent-loop",
"version": "0.10.1",
"version": "0.10.2",
"description": "Autonomous generator-evaluator agent loop for long-running coding tasks. Run /agent-loop:run to start.",
"author": {
"name": "Sheldon"