Skip to content

alepee/claude-grab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

31 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Grab 🫳

grab banner

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.

Requirements

  • 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.
  • python3 on PATH. Linux also needs wl-copy (Wayland) or xclip (X11).

Install

  1. Install the plugin (marketplace or --plugin-dir).
  2. Run /grab:setup once. It registers the grab: URI scheme (an applet in ~/Applications on macOS, a .desktop entry on Linux) and runs a clipboard self-test.
  3. 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.

How it works

  • 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 to pbcopy / 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.

Security

The handler decodes and copies β€” it never executes anything and never touches the filesystem.

Known limitations

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.

About

Click-to-copy πŸ“‹ links in Claude Code output via a custom grab: URI scheme

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors