fix: use env var instead of tmux check for Stop hook scoping

The tmux display-message approach had edge cases: it could succeed outside
tmux, fail on first iteration, or behave differently depending on tmux
socket state.

Replace with AGENT_LOOP_ACTIVE env var exported by loop.sh. CC sessions
spawned by the loop inherit it; interactive CC sessions don't. Simple,
no external dependencies, no race conditions.
This commit is contained in:
2026-04-02 10:42:46 -04:00
parent bab002b927
commit a1a3dfbd63
4 changed files with 7 additions and 7 deletions

View File

@@ -111,6 +111,7 @@ while [[ $# -gt 0 ]]; do
done
export ITERATION=0 MAX_ITERATIONS MODE
export AGENT_LOOP_ACTIVE=1
# --- Validate ---
if [[ ! "$MODE" =~ ^(implement|explore|fix)$ ]]; then