claude-code - 💡(How to fix) Fix [BUG] Claude code can't change folders or doesn't remember the folders structure [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#48494Fetched 2026-04-16 06:58:39
View on GitHub
Comments
2
Participants
2
Timeline
7
Reactions
0
Timeline (top)
labeled ×3commented ×2mentioned ×1renamed ×1

Error Message

Error Messages/Logs

Code Example

example_project_folder/
- frontend_folder/
- backend_folder/

---

please fix bug foo in @frontend_folder

---

please fix bug in @backend_folder

---
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Say you have this project struccture

example_project_folder/
- frontend_folder/
- backend_folder/

you open claude in example_project_folder/

now you tell it

please fix bug foo in @frontend_folder

this will work, now if you tell it

please fix bug in @backend_folder

you can't, when you press the @ symbol, it doesn't detect backend_folder, seems like it does a cd command and stays in the most recent folder it has been to and doesn't have memory of the original project structure, it has to run an ls on example_project_folder to understand the structure

doing a /clear command fixes the issue, so you need to keep clearing the context if you want the auto detection to work

What Should Happen?

I expect everything to work as expected, for claude to have a memory of the structure of the project.

also assume you're working with a new context. clear context. if you press up arrow to get the previous prompt you cant append to it @folder, the @ sysmbol stops working again

Error Messages/Logs

Steps to Reproduce

I already did

Claude Model

Opus

Is this a regression?

No, this never worked

Last Working Version

No response

Claude Code Version

2.1.109

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

No response

extent analysis

TL;DR

The issue can be temporarily fixed by using the /clear command to reset the context, allowing Claude to re-detect the project structure.

Guidance

  • When switching between folders, use the /clear command to reset the context and allow Claude to re-detect the project structure.
  • Try using the full path to the folder instead of relying on the @ symbol, e.g., please fix bug in example_project_folder/backend_folder.
  • Verify that the issue is not specific to the Opus Claude model by trying a different model, if available.
  • If the issue persists, try restarting the Claude session or checking for any updates to the Claude Code version.

Example

No code snippet is provided as the issue is related to the interaction with the Claude Code interface.

Notes

The issue seems to be related to the context management in Claude Code, and the /clear command provides a temporary workaround. However, a more permanent fix would require changes to the Claude Code implementation.

Recommendation

Apply workaround: Using the /clear command to reset the context when switching between folders, as this provides a reliable way to ensure Claude can detect the project structure correctly.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING