Agent creates files in CWD despite conversation context pointing to different project

Resolved 💬 2 comments Opened Mar 13, 2026 by luvidal 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

  1. Open Claude Code in project A (~/GitHub/clasificador)
  2. Have a conversation where all file reads, greps, and architecture exploration happen in project B (~/GitHub/jogi)
  3. Ask Claude to "create a plan at docs/plans/aimeta.md"
  4. Claude creates the file in project A's docs/plans/aimeta.md instead 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

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗