Clickable (OSC 8) hyperlinks for file paths in terminal output
Feature request: clickable file paths in Claude Code terminal output
Problem
Claude Code already prints file references constantly: Read/Grep/Glob results, Edit/Write
confirmations, and inline file_path:line_number citations in assistant text (a convention the
tool itself is instructed to use, precisely so the user can navigate to source). All of it is
plain text. To actually open one, the user selects it, copies it, switches to their editor, and
pastes it in a Go-to-file dialog. Every other piece of a modern terminal workflow (ripgrep with--hyperlink-format, bat, eza, GitHub CLI, ESLint in some configs) has already solved this
with OSC 8 hyperlinks, so the gap is specific to Claude Code's own output.
Suggested feature
Wrap local file-path output in OSC 8 hyperlink escape sequences so terminals that already support
it (Windows Terminal, iTerm2, WezTerm, kitty, gnome-terminal, VS Code's integrated terminal) render
the path as a real link: ctrl+click (cmd+click on macOS) opens it directly, ideally at the cited
line.
- Target:
file://<absolute-path>, orvscode://file/<absolute-path>:<line>when Claude Code
detects it is running inside the VS Code / Cursor integrated terminal ($TERM_PROGRAM or
equivalent), so the click lands in the editor already in front of the user instead of the OS's
generic file handler.
- Where to apply it: Read tool file headers, Grep/Glob result lists, Edit/Write success messages,
and any inline file_path:line_number reference in assistant prose.
- Terminals without OSC 8 support just see the plain path, unchanged — the feature is additive,
not a behavior change, so there's no regression risk for anyone not on a supporting terminal.
Why this is a broad win, not a personal itch
file_path:line_number is a citation format Claude Code already mandates for exactly this
navigation purpose. Wiring up the escape codes is a small, self-contained change that closes a
loop the tool already half-built, and it benefits essentially every terminal user, not an edge
case.
Scope note
This is about Claude Code's own stdout, not the terminal emulator — no action needed from
Windows Terminal / iTerm2 / etc., they already implement OSC 8 rendering.