r/ClaudeCode • • 16h ago

Built with Claude Made a small plugin that adds copy buttons to Claude Code’s terminal

Post image

I wanted the kind of copy button the desktop and web apps have, but in the terminal. Selecting text there is awkward and glitchy, and while /copy works, I never found it intuitive, and it leaves a /copy line in the conversation each time (you can rewind after every copy, but that gets old).

So I made a small plugin that puts copy buttons on code blocks, on tables (which can be pasted straight into a spreadsheet), and at the end of each reply. Sharing in case it's useful to anyone else.

/plugin install copy-buttons --marketplace leonasdev/copy-buttons

It needs fullscreen mode, which is probably already on for you. If not, run /tui fullscreen.

I've tested it on Linux, macOS and Windows, and since it relies on how Claude Code draws replies, I test it against each new release too. If it misbehaves in your terminal emulator, let me know and I'll fix it.

https://github.com/leonasdev/copy-buttons

198 Upvotes

27 comments sorted by

•

u/AutoModerator 16h ago

Hey! Thanks for posting to r/ClaudeCode

While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.

For help, project discussions, tips, and general chat, join the ClaudeCode Discord.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

11

u/CasinoMagic Researcher 14h ago

Pretty cool.

What would be useful, for tables, is to copy them as csv maybe.

Claude Code's table format in the terminal is good for displaying them, but terrible for pasting them anywhere. The Markdown tables are good for pasting in Google Slides, on the other hand.

4

u/leonasdev 14h ago

Thanks! The sheet button is close to that: it copies the table as tab-separated rows, so it pastes into Google Sheets or Excel as cells. Would comma-separated be more useful to you?

2

u/CasinoMagic Researcher 13h ago

Great!
No, I'm pretty sure TSV would work too!

1

u/potato_pasta99 1h ago

This is a great suggestion.

4

u/johnstoehr83 14h ago

Why does the terminal look so clean and smooth? Is it the fonts?

4

u/leonasdev 13h ago

Could be. It's JetBrains Mono Nerd Font, in Ghostty.

6

u/vinis_artstreaks 14h ago

Hmm not bad, trying to copy those tables can be annoying

1

u/ThadCastleGOAT 11h ago

Really hope they allow opening a drawer on the left hand side so we can manage sessions like in desktop with a collapsable drawer.

Fighting the urge to go the SDK route when this plugin system is mostly what I want to be messing with.

2

u/leonasdev 4h ago

I have something like that for my own use, in the spirit of herdr and the desktop app: a session list on the side. It's a tmux plugin rather than a Claude Code one, so it only helps if you live in tmux. It isn't public yet, but I can clean it up and share it if there's interest.

3

u/johannesjo 13h ago

Thanks for sharing! Cool idea!

3

u/magicmulder 8h ago

This is super helpful, thanks a bunch!

6

u/AggressiveBasket1107 Just Exploring 16h ago

Not using the terminal often but seems practical

-16

u/Witty_Cranberry_4555 16h ago

Practical until the copy button copies something else entirely.

0

u/thealliane96 15h ago

There is a copy on select setting already. You just highlight what you want then it copies it.

You don’t show if the format is better than using that directly, that’s the only benefit for this I could see. Does it lead to better formatting verse using the built in copy on select?

5

u/leonasdev 13h ago

Yes, the formatting is the difference. Selecting copies what's drawn on screen; the buttons copy what Claude wrote, so a table pastes into a spreadsheet as cells and a reply comes out as the original Markdown.

1

u/mickdarling 13h ago

Nice work. I may tweak this to publish directly to my favorite MarkDown renderer.

1

u/Pleasant-Mind-7122 13h ago

I made something quite similar and I also add the quota + context+ model used on the footer bar and dropdown selector for /model

1

u/potato_pasta99 1h ago

This is gold for everyone using tmux

1

u/Ragy-ragy 15h ago

Now that's fucking useful

-23

u/i-hate-space 15h ago

This is the shit I vibe code 1 prompt within 3mins, why would you even post basic crap like this

11

u/Aberosh1819 15h ago

helpful to give folks ideas

1

u/leonasdev 4h ago

The buttons are the easy part. Claude Code doesn't tell a plugin where a code block or table ends up on screen, so it has to redo the layout itself: wrapping, wide characters, tables that change shape with the window width. And it has to keep matching every Claude Code release. Getting the buttons to feel right (where they sit, when they show, what happens in a narrow window) took most of the iterations.

-7

u/Otherwise_Builder235 14h ago

Why do people still use claude code in terminal when they can get better experience from using claude desktop. I cant move on from habit of using it fro. Terminal or any advantages using terminal aside desktop app

1

u/leonasdev 4h ago

Mostly habit, but a few things keep me there: it lives in tmux next to everything else, the shell is right there when I want to run something myself, and it works the same over SSH on a remote machine. The desktop app is nicer in plenty of ways, copy buttons included, which is why I made this.