Skip to content

[Windows] Observer Haiku agent cannot read temp files and never writes instinct files #842

@AlvaroRojas

Description

@AlvaroRojas

Environment

  • OS: Windows 11 Pro (Git Bash / MSYS2)
  • ECC version: 1.9.0
  • Claude Code: latest
  • ECC_OBSERVER_ALLOW_WINDOWS=true

Bug Description

The observer loop runs successfully on Windows (observations accumulate, Haiku agent spawns), but zero instinct files are ever created due to two issues in observer-loop.sh.

Bug A: Temp files created in /tmp are inaccessible to the spawned Haiku session

observer-loop.sh lines 58 and 63 create temp files via:

analysis_file="$(mktemp "${TMPDIR:-/tmp}/ecc-observer-analysis.XXXXXX.jsonl")"
prompt_file="$(mktemp "${TMPDIR:-/tmp}/ecc-observer-prompt.XXXXXX")"

The spawned claude --print session cannot read these paths. On Windows/Git Bash, /tmp maps to a Windows temp directory that the child Claude session treats as outside its allowed scope. The Haiku agent outputs:

"I cannot access the file at /tmp/ecc-observer-analysis.XXXXXX.jsonl because security restrictions limit my file operations to the project directory"

This happens ~50% of analysis cycles. The other ~50% the agent can read the file (nondeterministic).

Suggested fix: Use $PROJECT_DIR for temp files instead of $TMPDIR//tmp:

analysis_file="${PROJECT_DIR}/ecc-observer-analysis-$$.jsonl"
prompt_file="${PROJECT_DIR}/ecc-observer-prompt-$$.txt"

Bug B: Haiku agent asks for permission instead of writing instinct files

When the Haiku agent can read the analysis file, it identifies patterns correctly but then outputs:

"Would you like me to save these as instinct files in your project's instinct directory? This will help future sessions automatically apply these patterns."

Instead of calling the Write tool, it asks for confirmation — which nobody can answer in --print mode. This happens 100% of the time when reading succeeds.

Suggested fix: Add explicit instructions to the prompt (around line 65):

IMPORTANT: You MUST write files directly using the Write tool. Do NOT ask for permission or confirmation. Do NOT output summaries or ask the user anything. Just read the observations, identify patterns, and write the instinct files.

Observer Log Evidence

From ~/.claude/homunculus/projects/<hash>/observer.log on a single session (2026-03-23):

Time Result
9:15 PM ❌ "can't access the temp file"
9:27 PM ⚠️ Read succeeded, found 5 patterns, asked for permission, wrote nothing
9:33 PM ❌ "unable to access the file"
9:40 PM ❌ "cannot access the file"
9:46 PM ⚠️ Read succeeded, found 5 patterns, asked for permission, wrote nothing
9:55 PM ❌ "can't access the log file"

12+ analysis cycles today, 0 instinct files created.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions