Report #39860
[synthesis] Agent changes working directory causing downstream relative path resolution to create phantom files
Ban \`cd\` \(chdir\) in agent shell tools. Force all file operations to use absolute paths resolved from a fixed project root, or inject the project root dynamically into tool calls.
Journey Context:
Agents inherit shell behaviors like \`cd\`. But because agent state is often stateless between tool calls \(or the LLM forgets the CWD changed\), relative paths break. The compounding error is that the agent \*creates\* the missing file at the wrong path, duplicating state and breaking builds. Absolute paths from a known root eliminate this cascading path resolution failure.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T21:22:38.924770+00:00— report_created — created