You ask Claude Code to fix something in page.tsx. It replies that the file does not exist. The
file is open in your editor, two inches away, with unsaved changes in it.
You are looking at a tab. It is looking for an address, and the address it tried was wrong.
The idea
Your project is a tree of folders on a disk, and every AI coding tool works on that tree and nothing else. It has no concept of "the file I have open" or "the project I mean". It has a The address of a file, written as the folders you pass through to reach it, separated by slashes. and it either resolves or it does not. Almost everything confusing about this comes from the fact that the same file has more than one correct address.
/Users/tim/projects/shop <-- the project root
|
|-- .env.local hidden (leading dot), holds secrets
|-- .gitignore hidden, lists what git ignores
|-- package.json what this project depends on
|-- src/
| |-- app/
| | |-- page.tsx <-- this file
| | \-- layout.tsx
| \-- lib/
| \-- format.ts
\-- public/
\-- logo.svg
Absolute address: /Users/tim/projects/shop/src/app/page.tsx
From the root: src/app/page.tsx
From src/lib: ../app/page.tsxHow it works
- The project root is the folder that holds
package.json(and usually.git). It is the anchor everything else is measured from. When you open a folder in VS Code or Cursor, that folder is the root the editor assumes. - An absolute path starts at the top of the disk:
/Users/tim/projects/shop/src/app/page.tsxon macOS or Linux,C:\Users\tim\projects\shop\src\app\page.tsxon Windows. It means the same thing no matter where you are. - A relative path is measured from wherever the program currently is, which is its
The folder a program treats as "here" while it runs. Commands
with relative paths are resolved from it..
src/app/page.tsxmeans "starting here"...means "one folder up". - A file whose name begins with a dot is a dotfile. Finder and
lshide these by default, and they are where the important configuration lives:.env.local,.gitignore,.claude/. If you have ever been told "add it to your env file" and could not find one, this is why.
The part after the last dot is the extension: .tsx, .ts, .json, .md, .svg. Renaming
styles.css to styles.txt does not change a byte inside the file. It changes what other programs
assume about it, which is enough to break things, because a web server picks the content type it
announces to the browser from that extension.
What to do
- Say where you are before you say what is wrong.
pwdprints your working directory. Run it in the terminal your assistant is running in, not a different one. - Give paths from the project root, not from your editor's tab bar.
src/app/page.tsxis unambiguous. "the page file" is not, and neither ispage.tsxin a project with nine of them. - Make hidden files visible.
ls -alists them in the terminal; in Finder, Command+Shift+Period toggles them. VS Code and Cursor show them in the sidebar already.
When a file is not found, check the folder before you check the code. The usual cause is that the assistant is running one directory above or below the one you have in mind.
Where it breaks
Paths are not portable. A path that works on your Mac fails on a Linux server because Linux
filenames are case sensitive and macOS usually is not. Header.tsx and header.tsx are the same
file on your machine and two different files in production, which is a common way for a deploy to
break code that ran locally.
Windows has its own version of this. Backslashes, drive letters and a different set of reserved filenames mean commands copied from a tutorial often fail on the first slash. Most people building web projects on Windows install WSL, Microsoft's built-in Linux environment, and work inside it, at which point every path in this section is correct again.