[FEATURE] Smart paste: convert clipboard code to file reference chips (like Cursor)

Status Fixed / completed
Maintainer reply None cached
Activity 3 comments · opened May 28, 2026 · closed May 28, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

Pasting copied code dumps the raw text inline into the chat input. There is no visual indication of which file or line range it came from.

Desired behavior

Copy code from an editor file → paste into Claude Code chat → shows a chip/pill like src/components/Button.tsx:L12-L45 instead of raw code
Clicking the chip shows the code preview
Support pasting multiple file snippets in a single message, each rendered as its own chip
The chip should carry the file path + line range so Claude receives structured context (not just raw text)

Proposed Solution

When pasting code that was copied from a file open in the editor, Claude Code should detect the source and convert it into a file reference chip (e.g., filename.ts:L1-L65) instead of inlining the raw code into the chat input.

Alternative Solutions

_No response_

Priority

Critical - Blocking my work

Feature Category

CLI commands and flags

Use Case Example

_No response_

Additional Context

_No response_

View original on GitHub ↗

3 Comments

git-ayush-srivastava · 4 months ago

convert clipboard code to file reference chips (like Cursor)

Keeps the chat input clean and readable
Makes it clear to both the user and Claude exactly where code came from
Reduces token bloat from repeated raw code pastes
Cursor implements this and it significantly improves the "code + question" workflow

github-actions[bot] · 4 months ago

Found 1 possible duplicate issue:

  1. https://github.com/anthropics/claude-code/issues/3458

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

github-actions[bot] · 2 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.