From 31af1adcc84287a58dd5a30c7d2d1e1803aa1455 Mon Sep 17 00:00:00 2001 From: Lidang-Jiang Date: Sat, 28 Mar 2026 10:34:40 +0800 Subject: [PATCH] fix(observer): anchor CWD to PROJECT_DIR before Claude invocation Reviewers correctly identified that the relative analysis_relpath (.observer-tmp/) only resolves when CWD equals PROJECT_DIR. Without an explicit cd, non-Windows users launching the observer from a different directory would fail to read the analysis file. Co-Authored-By: Claude Opus 4.6 Signed-off-by: Lidang-Jiang --- skills/continuous-learning-v2/agents/observer-loop.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/skills/continuous-learning-v2/agents/observer-loop.sh b/skills/continuous-learning-v2/agents/observer-loop.sh index e4eb0972..a0c289b1 100755 --- a/skills/continuous-learning-v2/agents/observer-loop.sh +++ b/skills/continuous-learning-v2/agents/observer-loop.sh @@ -124,6 +124,10 @@ PROMPT max_turns=10 fi + # Ensure CWD is PROJECT_DIR so the relative analysis_relpath resolves correctly + # on all platforms, not just when the observer happens to be launched from the project root. + cd "$PROJECT_DIR" + # Prevent observe.sh from recording this automated Haiku session as observations. # Pass prompt via -p flag instead of stdin redirect for Windows compatibility (#842). ECC_SKIP_OBSERVE=1 ECC_HOOK_PROFILE=minimal claude --model haiku --max-turns "$max_turns" --print \