Click-to-copy [Grab π«³] links in Claude Code.
Tired of fighting soft-wrap and the gutter to copy a command from Claude's output? grab makes Claude append a clickable [Grab π«³] link after every copyable block (commands, code snippets, draft messages). Clicking it puts the exact content in your clipboard.
Based on a hack by Guillaume Rams: OSC 8 hyperlinks + a custom grab: URI scheme handled at the OS level.
- macOS or Linux (Windows not supported).
- A terminal that makes
scheme:URIs clickable β via OSC 8 hyperlinks or plain-text URI detection (cmd+click): iTerm2, Ghostty, Kitty, WezTerm, VS Code/Cursor integrated terminal. Terminal.app and Warp are not supported: Terminal.app lacks OSC 8, and Warp neither renders OSC 8 (warpdotdev/Warp#4194, fix underway in #11885) nor detects custom URI schemes in plain text. Note: Claude Code currently prints links as plain text rather than OSC 8 (claude-code#13008), so clickability relies on the terminal's plain-text URI detection β Warp will need both fixes before grab links work there. python3on PATH. Linux also needswl-copy(Wayland) orxclip(X11).
- Install the plugin (marketplace or
--plugin-dir). - Run
/grab:setuponce. It registers thegrab:URI scheme (an applet in~/Applicationson macOS, a.desktopentry on Linux) and runs a clipboard self-test. - New sessions inject the link instruction automatically; without the handler installed you only get a one-line hint instead of dead links.
To remove everything: /grab:uninstall.
- A SessionStart hook detects the handler and instructs Claude to append
[Grab π«³](grab:<percent-encoded content>)after copyable blocks. - Clicking the link hands the URI to
grab_handler.py, which decodes the payload and pipes it topbcopy/wl-copy/xclip. - Inline only: beyond ~1500 characters no link is emitted β Claude offers to pipe long content to the clipboard tool directly instead. No temp files, ever.
The handler decodes and copies β it never executes anything and never touches the filesystem.
Honest scope: great for command lines, not for documents or code files. Terminals cap the size of URIs they accept (empirically, Ghostty stops making links clickable somewhere between ~2 KB and ~5 KB of URI), and percent-encoding inflates real-world content by 1.5β3Γ. Beyond the threshold, grab steps aside: no link, just ask Claude to pipe the content to pbcopy itself. Use it for the thing it was born for β grabbing a command without fighting soft-wrap.
- First click: iTerm2 / VS Code ask once to confirm opening an unknown URI scheme. Allow and remember.
- Inline URIs beyond the terminal's cap silently stop being clickable β hence the threshold.