Claude Code can’t see project files: why and what to do in 2026
MarkdownWhy Claude Code can’t find project files: it was started from the wrong folder, the file is in a subfolder, or it’s in .gitignore. How to grant access with add-dir, cd, and settings.
Read full article
A familiar picture: you ask Claude Code to fix a file, and it replies that no such file exists. Or it silently changes something completely different from what you meant. You open the folder—the file is there, right where it should be. But Claude seems not to notice it.
Almost always, there’s one reason, and nothing is broken. Claude doesn’t see files on the entire computer. It can access only the folder from which you launched it. Launching inside a sibling folder or below the project root can put needed files outside the working tree. Launching from a parent such as home instead gives a broader scope; it does not make a descendant project inaccessible. I’ll explain step by step why this works the way it does and how to give Claude access to the files it needs. I’m quoting commands and settings directly from the official Claude Code documentation, which I checked in early September 2026.
Additional materials on configuring tools are available in the Ailoot documentation.
Why Can’t Claude Code See Some Project Files?
Key takeaway
Claude Code reads files not from the entire drive, but only from the folder where you launched it. This folder is called the working directory. Claude can see and read everything inside it and its subfolders without asking. Everything outside it—in a neighboring folder, one level up, or on another drive—is off-limits until you grant access yourself. So the most common reason a file “isn’t visible” is simple: you launched Claude from a different folder. First, check exactly where you opened it.
By default, Claude Code works with one folder: the one where you entered the claude command and started the session. The documentation says this directly.
By default, Claude has access to files in the folder where you launched it.
This folder is its working directory. Inside it, Claude reads any file without extra questions: editing a prompt, searching code, reading a specific file—it all works right away. But everything outside this folder is off-limits by default. A neighboring folder, a folder one level up, another drive—Claude won’t look there until you allow it.
That’s where a working-folder mismatch can matter. Say your project is /Users/you/my-shop, but you launched Claude from /Users/you/other-project, a sibling folder. The index.html in my-shop is outside that working tree. Launching from /Users/you is a different case: my-shop is a descendant and is not inaccessible merely because you started from home, though the selected context is broader than intended. Access to a folder also does not mean every file has already been read.
Next, I’ll walk through how to check and fix this: first we’ll confirm which folder Claude was launched from, then we’ll give it access to the files it needs in different ways—from a one-time instruction to a permanent setting.
How Can You Check Which Folder Claude Code Was Launched From?
Key takeaway
Ask Claude which folder it’s in, or ask it to show the current directory with the pwd command—it only checks and changes nothing. Compare what it shows with the actual location of your project. If the paths differ, that’s the reason: Claude was launched from the wrong folder. An even more reliable fix is to close the session and relaunch Claude directly from the project folder: go to it in the terminal and enter claude there.
Before fixing anything, make sure the folder is really the issue. It’s easy to check. Ask Claude in the chat to show which directory it’s currently in—it will run pwd, which is safe: the command only displays the path and doesn’t touch anything.
pwd
The reply shows the actual working directory. Compare it with the full project path: /Users/you/other-project is a sibling of /Users/you/my-shop, while /Users/you is its parent. The sibling case puts my-shop outside the working tree; the parent case includes it but does not select that specific project as the root.
The cleanest way to resolve this mismatch is to launch Claude directly from the project folder. Close the current session, go to the right folder in the terminal, and launch Claude from there:
# Replace this illustrative path with your actual project root.
cd /Users/you/my-shop
claude
Now my-shop will be the working folder, and all the project files will be in view. The same rule applies in an editor such as VS Code: open the folder that contains the project. Not the folder one level above and not the entire drive. The folder you open determines what Claude considers its working directory.
If relaunching is inconvenient—for example, you’ve already given Claude context in this session and don’t want to lose it—you can add or switch folders on the fly. The next two sections cover that.
How Can You Show Claude Code a File in a Neighboring Folder?
Key takeaway
Without restarting the session, add the folder you need with the /add-dir command right in the chat: enter /add-dir and the folder path, and its files will be available on the same footing as those in the main folder. To open access right when Claude starts, add the --add-dir flag with a path to the claude command. And if you want a folder to open automatically every time, add it under the additionalDirectories key in the settings. In all three cases, files in the added folder can be read without separate confirmations.
Sometimes a project isn’t kept in just one folder. The code is in one place, images or text in a neighboring folder, and shared components somewhere else nearby. Restarting Claude in each folder in turn is inconvenient. It’s better to give it access to the folder it needs while keeping the main folder as the working directory.
The simplest way is to do this directly in the active session with the command:
/add-dir ../assets
Enter /add-dir and the folder path, and Claude will immediately have access to its files on the same footing as files in the main folder. It won’t ask for permission again: the added folder follows the same rules as the working directory.
Files in additional directories follow the same access rules as the main working directory: they are read without a prompt.
If you know in advance that you’ll be working with multiple folders, open access as soon as Claude starts—using the same path, but with a flag:
claude --add-dir ../assets
And when you need the same neighboring folder in a project all the time, there’s no need to add it manually every time. The settings.json settings file has an additionalDirectories key. List the paths there, and they’ll open automatically each time Claude starts:
{
"permissions": {
"additionalDirectories": ["../assets", "../shared"]
}
}
One caveat for Windows: you can’t add a network folder using a path like \\server\shared—Claude doesn’t accept such paths. Mount it as a separate drive with a drive letter, then pass that letter using --add-dir. Ordinary local folders don’t have this issue.
What if adding a neighboring folder isn’t enough and you need to move to another folder entirely? There’s a separate command for that, covered below.
How Can You Switch Claude Code to Another Folder During a Session?
Key takeaway
The /cd command changes the main working folder without closing the session: enter /cd and a path, and Claude will move there with the conversation history intact. During the move, it will pick up the CLAUDE.md instruction file from the new folder and, if you haven’t worked there before, ask you to confirm that you trust it. The difference from /add-dir is that /add-dir opens a neighboring folder alongside the main one, while /cd moves the entire working directory to a new location. The command is available starting with version 2.1.169.
Sometimes adding a neighboring folder isn’t enough—you need to change the main folder and move to another project without losing the context you’ve built up. Use the /cd command:
/cd ../another-project
Afterward, Claude treats the new folder as its working directory. You keep the entire conversation history, but the place Claude uses as its reference point for files changes to the new location. Claude also picks up the CLAUDE.md instruction file from the new folder, if one is there—that is, it adapts to the rules of the new project.
One thing to know about trust: if you haven’t worked in this folder before, Claude will ask whether you trust it when you move there. This is a safeguard: an instruction file in an unfamiliar folder could contain anything, so Claude first checks that it’s your project. Confirm, and then carry on.
The difference between the two commands is simple. /add-dir keeps the main folder as the working directory and opens a neighboring folder in addition to it—useful when parts of a project are scattered around. /cd moves the entire working directory to a new location—useful when switching to another project. The /cd command was introduced in version 2.1.169, so if it’s missing, update Claude Code. I have a separate guide on how to update Claude Code.
Claude Code seeing files is only the foundation. Stable results don’t come from file access alone. They come from what those files contain and how you build context around the project.
Why Can’t Claude Code See a File in a Subfolder?
Key takeaway
Subfolders work differently from neighboring folders: Claude has access to them, but their contents don’t enter its context right away. Claude loads instruction files and the contents of subfolders on demand, when it looks in them. It doesn’t load them at startup. So a file in a deeply nested subfolder may be “invisible” until you give Claude its path directly. The solution is simple: give Claude the exact path to the file or ask it to read the file first, and it will come into view.
It’s important not to confuse two different situations here. A neighboring folder (one outside the project) is completely off-limits until you add it. A subfolder inside the project is different: Claude has access to it, but it doesn’t keep the folder’s contents in mind from the start.
Here’s how it works. When Claude starts, it loads what’s at the project’s top levels. It loads files from subfolders on demand, when it goes there to read something. The documentation describes this behavior for instruction files, and the same logic applies to context in general.
Claude discovers files in subfolders of the working directory. Rather than loading them at startup, it pulls them in when it reads files in those subfolders.
In plain language: the file in a deeply nested subfolder hasn’t disappeared and is fully accessible. Claude just hasn’t remembered it yet because it hasn’t looked there—which explains why it can feel as though Claude “can’t see” a file even though it’s there and accessible.
You can fix this in one line. Give Claude the file path directly—for example, src/components/header.jsx—or simply ask it to read the file first. As soon as it looks there, the file will enter the context, and you can work with it as usual. There’s no need to change any settings.
Where Do Files Disappear from the @ Menu, and What Does .gitignore Have to Do with It?
Key takeaway
When you type the @ symbol, Claude Code shows a list of files you can choose from. By default, this list hides anything included in .gitignore—service folders, environment files, build output. So a file may be right where it belongs but not appear in the @ menu. The respectGitignore setting controls this: it’s on by default and hides those files. Set it to false, and the menu will also show files listed in .gitignore. You can always enter the path to such a file manually.
Another common reason to think Claude has “lost” a file is the file picker. When you type @, a list pops up, making it convenient to select a file without typing its full path. But the list doesn’t show everything.
By default, the @ menu hides files listed in .gitignore. That file specifies what shouldn’t be added to the shared repository: service folders, files containing passwords and environment settings, and completed build output. The reasoning is clear—usually you don’t need to work with these files manually, so they would only clutter the list. But sometimes you do need one of those files, and it isn’t in the menu.
The respectGitignore setting controls this. It’s on by default, so files from .gitignore don’t appear in the menu. If you want to see them, switch it to false:
{
"respectGitignore": false
}
You can do the same thing without editing the file, using the /config command inside Claude Code. The toggle there is called “Respect .gitignore in file picker.” Uncheck it, and the hidden files return to the menu.
One important caveat: respectGitignore applies only to the @ menu and has nothing to do with file access. Even when a file is hidden from the list, you can always enter its path manually, and Claude will read it. The menu is a convenience feature; it doesn’t set the access boundary.
What Should You Do If Claude Code Can’t Read a Specific File?
Key takeaway
Sometimes the folder is correct, but Claude still refuses to read one specific file. Usually, the reason is a restriction in the settings. The settings.json file may contain deny rules that block reading particular files, most commonly .env files with keys and passwords. There’s also a setting that blocks reading anything outside the working folders entirely. Check both places in settings.json. And remember that the .env restriction is a default safeguard; you shouldn’t remove it without a good reason.
If the folder is definitely right and access is open, but Claude still won’t read one particular file, it’s most likely restricted. Restrictions live in the settings.json settings file and come in two kinds.
The first is a targeted restriction on specific files. In the settings, these are deny rules, and they most commonly apply to the .env file, where keys and passwords are stored:
{
"permissions": {
"deny": [
"Read(./.env)",
"Read(./.env.*)"
]
}
}
Such a rule blocks Claude from reading the specified files, and it’s intentional. Keys and passwords shouldn’t end up in a conversation with the model, so .env is locked down by default. If you see that Claude won’t read .env or a similar file containing secrets, that’s by design, and you shouldn’t remove this restriction without a compelling reason.
The second kind is a general restriction on everything outside the working folders. The blockReadsOutsideWorkingDirectories setting controls it. When enabled, Claude refuses to read any file outside the working directory, even if you try to open it directly. If it’s set to true and you need an external file, either add its folder using /add-dir or turn off the restriction:
{
"permissions": {
"blockReadsOutsideWorkingDirectories": false
}
}
This setting was introduced in version 2.1.257. It’s worth checking both deny and blockReadsOutsideWorkingDirectories when you’ve tried everything else but the file is still off-limits.
Where Should You Start If Claude Code Can’t See Files?
Key takeaway
Start by checking the folder: ask Claude to show the current directory using pwd and compare it with the project’s location. If they don’t match, relaunch Claude from the project folder or move there with /cd. Need files from a neighboring folder? Open it with /add-dir. Can’t see a file in a subfolder? Give Claude its path directly. A file is missing from the @ menu? It’s related to .gitignore—switch respectGitignore. One file is locked? Look for a deny restriction in settings.json.
Here’s a short plan you can follow from top to bottom.
- Check the working folder: ask Claude to show the current directory using
pwdand compare it with the project’s location. - If the folders differ, relaunch Claude from the right one (
cd project, thenclaude) or move there with the/cdcommand. - Need files from a neighboring folder? Add it with
/add-diror the--add-dirflag when launching Claude. - A file from a subfolder isn’t in context? Give Claude its path directly or ask it to read the file.
- A file is missing from the
@menu? That’s.gitignore. SetrespectGitignoretofalseor uncheck the box in/config. - One specific file is locked? Check the
denyandblockReadsOutsideWorkingDirectoriesrules insettings.json.
In nine cases out of ten, the first step solves everything: Claude was launched from the wrong folder. File access is the foundation, but it won’t build your project for you. I’ve covered in detail how to build context around Claude so it keeps the whole project in mind and doesn’t lose the thread in my guide to the Second Brain in Claude Code.
Sources
- Claude Code - Configure permissions, official documentation - default working directory, --add-dir and /add-dir, /cd, additionalDirectories, access without prompts, network paths
- Claude Code - Manage Claude's memory, official documentation - loading subfolder files on demand, CLAUDE.md, imports
- Claude Code - Settings reference, official documentation - respectGitignore and the @ menu, blockReadsOutsideWorkingDirectories and version 2.1.257
- Claude Code - Settings, official documentation - deny rules and blocking reads of .env
Find additional materials on working with tools in the Ailoot documentation.
More details
Questions about Claude Code can’t see project files: why and what to do in 2026
Why is launching from home different from launching in a sibling project?
A project below your home directory is a descendant, so starting from home does not put it outside that working tree; it gives a broader context than intended. A sibling of the working folder is outside it. Compare the full paths before diagnosing missing access.
Does access to a subfolder mean its files are already in context?
No. Give the agent the file’s path and ask it to read it. If the read is denied, inspect the applicable permissions; a file omitted from the selection menu and a denied file read are different problems.