Skip to content

About

Claude Code mod: keep pasted and dictated text editable instead of [Pasted text #N +X lines]

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

paste-inline

A Claude Code mod that keeps pasted and dictated text editable in the prompt. Claude Code folds every multi-line or long paste into an opaque [Pasted text #1 +30 lines] tag, so you cannot review or fix what you pasted. This hurts most with voice-dictation tools that insert through the clipboard (Wispr Flow, Typeless, BetterWispr) and snippet tools, where "paste again to expand" does not work (claude-code#23134).

paste-inline watches the prompt draft; when a new paste tag appears and the clipboard holds a text with the same line count, it replaces the tag with the text.

Install

/plugin marketplace add rafal-one/paste-inline
/plugin install paste-inline@paste-inline

Needs a Claude Code build with mods (function hooks) and a clipboard tool: pbpaste (macOS), wl-paste, xclip or xsel (Linux), powershell.exe (Windows / WSL). Over SSH there is usually no clipboard, and the tag stays.

How it works

Claude Code raises no hook for a collapsed paste, so the mod polls the draft every 250 ms. For each new [Pasted text #N +X lines] tag it reads the clipboard once and expands the tag only if the clipboard's line count matches X (one line of difference is tolerated for a trailing newline). A mismatch leaves the tag alone and is not retried. Text you typed before and after the paste is kept.

Options and commands

  • maxLines: pastes longer than this keep the tag (default 0 = expand everything).
  • clipboardCommand: a command that prints the clipboard, split on spaces (for example wl-paste --no-newline). Default: auto-detect.
  • /paste-inline on|off: toggle for the session.

Limits

  • It is a workaround: the draft is rewritten right after the paste, so the cursor ends up at the end of the draft.
  • The "paste again to expand" hint under the prompt may stay visible after an expansion.
  • Images are not handled. If the clipboard changes between your paste and the next poll (250 ms), the paste stays collapsed.
  • The mods API is early access and may change. If Claude Code ships a setting for this, use it and uninstall the mod.

Development

claude plugin validate .
claude plugin test .       # 6 unit tests

Live check (2026-10-19, tmux, Claude Code 2.1.303): typed fix this: , bracketed-pasted 30 lines, typed please. The draft showed fix this: line 0 ... line 29 please expanded, not re-collapsed.

Support

If it saves you time, you can support development: PayPal.

MIT licensed.

About

Claude Code mod: keep pasted and dictated text editable instead of [Pasted text #N +X lines]

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages