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.

Quick answer

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:

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:

1

Find the file in Finder

2

Hold the Option (⌥) key

3

Right-click the file while holding Option

4

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/).

From Zura's workflow

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.

# Anchoring to a specific file
Look at src/components/PricingCard.tsx — the hover state
isn't applying the right border color on dark mode.

# Referencing two related files
In js/i18n.js there are missing keys that src/pages/about.js
expects. Can you find them?

# PR-style description with git-relative paths
I changed packages/api/handlers/auth.ts and
packages/api/middleware/ratelimit.ts — review for security issues.

# Asking Claude to create a new file at a specific path
Create src/hooks/useClipboard.ts with a React hook that
wraps navigator.clipboard.writeText.

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:

  1. Open Terminal in the project directory
  2. Run git ls-files --full-name [filename]
  3. 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

Method Steps Gets git-relative path Usable in AI prompt
Option + right-click (native) 4 No — absolute only Works but noisy
Terminal git ls-files 5+ Yes Yes, ideal
Pathly "Copy Git Path" 2 Yes Yes, ideal

Quick Tips for AI-Optimized Path Sharing

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.