Agent creates files in CWD despite conversation context pointing to different project
Status Closed — not planned
Maintainer reply None cached
Activity 2 comments · opened Mar 13, 2026 · closed Apr 10, 2026
Bug Description
When the conversation context clearly references a different project (reading files, exploring architecture, discussing changes all in project B), Claude Code still defaults to creating new files in the current working directory (project A) instead of asking or inferring the correct location.
Steps to Reproduce
- Open Claude Code in project A (
~/GitHub/clasificador) - Have a conversation where all file reads, greps, and architecture exploration happen in project B (
~/GitHub/jogi) - Ask Claude to "create a plan at
docs/plans/aimeta.md" - Claude creates the file in project A's
docs/plans/aimeta.mdinstead of project B
Expected Behavior
Claude should either:
- Infer from conversation context that the plan belongs in project B (where all the code lives)
- Ask which project the file should be created in when there's ambiguity
Actual Behavior
Claude defaults to the current working directory without considering that 100% of the conversation's file operations targeted a different project.
Environment
- macOS
- Claude Code CLI
- Model: claude-opus-4-6
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗