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.
752 B
752 B