The Deska blog

Claude Code Cannot Find Your Files

Solve issues when Claude Code cannot find your files. Learn about indexing, permissions, and how Deska provides a visual workspace for AI agents.

· 10 min read

When working with command line AI agents, encountering a situation where Claude Code cannot find your files is a common roadblock that halts productivity. This issue typically stems from environment configuration, directory scoping, or permission restrictions that prevent the agent from mapping your project structure correctly. Understanding how these agents interact with your local file system is essential for maintaining a fluid development workflow.

Why Claude Code Cannot Find Your Files

The most frequent reason for this error is a mismatch between the current working directory of the terminal and the path the agent expects. AI agents rely on a context window that is populated by scanning your local environment. If the agent is initialized in a subdirectory, it may lack the visibility to see parent files or adjacent modules.

Another factor involves .gitignore or similar ignore files. Many AI tools respect these configurations to avoid leaking sensitive data or bloat from node_modules. If your target files are accidentally ignored, the agent will act as if they do not exist. You should verify your environment variables and ensure the terminal session has explicit read access to the project root.

Common Troubleshooting Steps

If you are facing persistent issues with file discovery, follow these steps to isolate the problem.

  • Check the current directory by running pwd in the terminal where the agent is active.
  • Verify that the files are not listed in a .claudeignore or .gitignore file.
  • Restart the agent session to refresh the file index, as some agents cache the directory structure at startup.
  • Use absolute paths when asking the agent to edit a specific file to rule out relative path resolution errors.
  • Ensure the terminal emulator has the necessary OS level permissions to access the folders in question.

The Role of Context Management

Context management is how an agent keeps track of what it knows about your code. When Claude Code cannot find your files, the context window might be full or the indexing process might have failed. Large projects with thousands of files often require a more sophisticated approach than a simple recursive scan. Some tools use vector embeddings to locate relevant files, while others rely on a flat list of filenames. If the indexing step fails, the agent loses its map of your repository.

Comparing Integrated Environments and CLI Tools

Standard CLI tools for AI coding differ in approach compared to integrated environments. A standalone CLI relies entirely on the shell environment. This is lightweight and powerful for quick edits. However, it lacks a visual representation of what the agent is currently seeing.

Integrated environments like Deska provide a different perspective. Deska is a free desktop app for Mac, Windows, and Linux that uses an infinite canvas to organize your work. Instead of a single terminal, you can place multiple panels including terminals, a code editor based on Monaco, and a browser. By running agents like Claude Code or Codex CLI side by side, you can visually confirm which files are open and which terminal session is active. This visibility helps prevent the confusion that leads to file discovery errors.

Improving Reliability with Deska

When using Deska, the local-first architecture ensures that your code, files, and sessions stay on your machine. This is crucial for security and performance. The workspace allows you to run coding agents in dedicated terminal panels. If one agent loses track of a file, you can use the Ask Deska assistant to run a command or open a specific panel to verify the file location.

The canvas approach allows you to see the agent's output in one panel while keeping the file explorer or a note panel open in another. This spatial organization makes it easier to spot when an agent is looking in the wrong directory. Furthermore, the mobile app allows you to monitor these long running agent tasks from your phone through a secure relay, ensuring that you can catch a file error even when you are away from your desk.

Advanced File Access Patterns

Advanced users often face issues when dealing with symbolic links or networked drives. Most AI agents are configured to avoid following symlinks to prevent infinite loops. If your project relies heavily on linked directories, the agent might report that it cannot find those files. In these cases, you may need to explicitly point the agent to the source directory or adjust the tool configuration to allow symlink traversal.

Troubleshooting FactorStandard CLIDeska Workspace
File VisibilityTerminal output onlyVisual canvas panels
Context ControlCommand argumentsDedicated agent threads
Directory ScopingManual cd commandsVisual panels management
MobilityRemote SSH onlyIntegrated mobile relay

Frequently Asked Questions

Why does Claude Code say a file does not exist when I can see it?

This usually happens because the agent's file index is out of sync with your disk. If you recently moved or created the file, the agent may not have rescanned the directory. Try restarting the session or explicitly mentioning the full path to the file to force a re-index.

How do I grant Claude Code permission to my folders?

Permissions are managed by your operating system and the terminal emulator you use. Ensure your terminal has Full Disk Access in your system settings. If you are using Deska, ensure the application has permissions to read the directories where your projects are stored.

Can I use Claude Code on multiple directories at once?

Most CLI agents are scoped to a single root directory. To work across multiple projects, you can open multiple terminal panels in a workspace and run separate agent instances. This allows each instance to have a clear scope without mixing file contexts.

Getting Started with a Better Workspace

If you want a more organized way to work with AI agents, you can download the Deska desktop app. It provides the tools needed to manage multiple agents and files without the friction of a single terminal window. The workspace itself is free, and you can use your own API keys for a lifetime tier or choose managed inference. Visit the download page to install the app on your preferred operating system and begin building in a more visual, local-first environment.

💡 Ideas+🐛 BugsSuggest a feature or report a bug