I build macOS utilities and I've been using Claude Code and Codex as primary coding partners since early 2025. One thing I noticed quickly: a significant fraction of my time wasn't spent writing or reviewing code — it was spent telling the AI which file I was talking about.
Every session I'd need to say things like "look at src/components/Button.tsx" or "the error is in lib/auth/session.ts" or "update the config at packages/api/src/config.ts". These file references are how you anchor an AI to the specific part of the codebase you care about. Without them you get vague, unfocused responses. With them, the AI goes exactly where you want.
The problem: getting those paths is surprisingly friction-heavy on macOS.
For AI prompts, use git-relative paths (src/components/Button.tsx) rather than absolute paths. The native macOS method to get any path takes 4 steps (hold Option, right-click, find the item, click). Pathly reduces this to 2: right-click, choose "Copy Git Path".
Why File Paths Matter So Much in AI Prompts
When you're working with an AI coding assistant, file paths serve a few distinct purposes:
- Context anchoring: "Look at
src/hooks/useAuth.ts" tells Claude exactly which file to focus on before you describe the problem. - Avoiding ambiguity: Projects often have multiple files with similar names.
Button.tsxmight exist in three different subdirectories. The path resolves the ambiguity instantly. - Actionable output: When Claude suggests edits, you want it to say "in
src/components/Modal.tsx, change line 47" not "in the modal file, somewhere near the top". - Review and diff context: When you paste a path in the same format that appears in git diffs, the AI recognizes the file's role in the change you're describing.
In a typical two-hour coding session with an AI, I reference between 15 and 30 individual files. Each one requires getting the path onto the clipboard. That's where the friction accumulates.
The 4-Step Native Tax (and Why It Adds Up)
macOS doesn't show a "Copy Path" option in Finder's default right-click menu. The built-in method is:
Find the file in Finder
Hold the Option (⌥) key
Right-click the file while holding Option
Click "Copy [filename] as Pathname"
Four deliberate steps. And the output is an absolute path: /Users/zura/code/sophinauta/pathly/src/components/Button.tsx. Functional, but not ideal for AI prompts — more on that below.
Do this 20 times in a session and you've spent a meaningful block of time on pure mechanical overhead. The cognitive interruption is actually the bigger cost: each time you switch from "thinking about the code" to "finding and option-clicking a file," you break flow.
Which Path Format Works Best in AI Prompts?
Not all paths are equally useful when talking to an AI. Here's what I've found works best:
Relative paths — best for most conversations
A relative path like src/components/Button.tsx is the cleanest option for most AI conversations. It matches what you see in your editor's file tree, what appears in error messages, and what the AI naturally uses when it refers to files in its responses.
The absolute path version — /Users/zura/code/sophinauta/pathly/src/components/Button.tsx — works too, but it's longer, contains your personal username, and adds noise. The AI doesn't need to know your home directory to help you with the file.
Git-relative paths — best for PR and review context
When you're working on a change and want to describe it clearly, git-relative paths are the gold standard. These are paths from the repository root: packages/api/src/handlers/auth.ts.
This is the exact format that appears in git diffs, PR descriptions, and code review comments. If you say "the bug is in packages/api/src/handlers/auth.ts", Claude recognizes it as a file path pattern consistent with how engineers discuss code changes — and responds accordingly.
Filenames — when the file is uniquely named
Sometimes just the filename is enough: "update tailwind.config.js". For configuration files, entrypoints, and other files that only exist once in a project, the filename alone gives the AI enough to work with. Pathly's "Copy Filename" makes this trivial.
Absolute paths — avoid unless necessary
Use the full absolute path only when you're running a specific terminal command where the absolute path is required, or when telling the AI to read a file outside your project (e.g., a config file in /etc/ or a dependency in /usr/local/).
I'm building Pathly while using Pathly — which gives me a tight feedback loop. A typical session looks like this: I'm in Finder reviewing what I just built. I right-click js/i18n.js, copy the git path, switch to Claude Code, and say "look at js/i18n.js — the Spanish translations are falling back to English for the pricing section." Claude opens the file, finds the issue, and suggests a fix. I right-click the next file, copy, paste, repeat. I do this 4–6 times before writing a single line of code myself. Without fast path copying, each of these transitions would have an extra two steps baked in.
Practical Examples: Path Patterns for AI Prompts
Here are the prompt patterns I use most often. The path format is everything.
Getting Git-Relative Paths Fast
The git-relative path is the most useful format for AI coding prompts, but it's also the hardest to get from macOS natively. You'd have to:
- Open Terminal in the project directory
- Run
git ls-files --full-name [filename] - Copy the output
Or use a two-step manual calculation: copy the absolute path, copy the repo root path, subtract one from the other. Neither is fast enough to do 20 times in a session without it becoming its own workflow problem.
Pathly's "Copy Git Path" solves this with two steps: right-click the file in Finder, click "Copy Git Path". Pathly finds the nearest .git directory up the folder tree and computes the relative path automatically. The result is exactly src/components/Button.tsx — ready to paste.
Comparing Path Copy Methods for AI Workflows
Quick Tips for AI-Optimized Path Sharing
- Batch your file references: Before starting a Claude session, copy all the file paths you'll need and paste them into a scratch note. Reference them from there rather than switching windows mid-conversation.
- Match the format the AI uses: If Claude refers to a file as
src/utils/helpers.tsin its response, use that same path when asking follow-up questions. Consistency keeps the context tight. - Use directory paths to scope questions: "Look at everything in
src/api/and find any functions that make unauthenticated requests" is a valid and useful prompt. Pathly's "Copy Directory" makes this easy. - Prefer paths over line numbers: "In
src/components/Modal.tsxnear the useEffect" is more stable than "on line 47" — the AI may have a different version of the file in context.
If you're spending any significant time in AI-assisted coding sessions, the two-step path copy workflow is one of the highest-return-on-investment workflow optimizations you can make. It's one of the reasons I built Pathly in the first place.