anomalyco / anomalyco/opencode

[FEATURE]: Convert large pasted text into a virtual file attachment

Open
#40,312 3 comments 1 reaction 1 assignee View on GitHub

@Hona is already working on this.

Since Aug 3, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Feature hasn't been suggested before.
  • I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request

Feature request: Convert large pasted text into a virtual file attachment

Is your feature request related to a problem? Please describe.

When a large block of text is pasted into the prompt composer—for example logs, architecture documents, stack traces, specifications, or generated code—it is inserted directly into the message.

This makes the composer and conversation difficult to navigate. It becomes cumbersome to scroll between the pasted content and the actual instructions while reviewing or adjusting the prompt before submission.

Describe the solution you'd like

Detect sufficiently large clipboard text pastes and automatically convert them into a virtual text-file attachment instead of inserting the entire content inline.

For example, pasting a large block of text could create an attachment such as:

pasted-context-1.txt

The message composer would then remain available for the actual instruction:

Review the attached logs and identify the root cause.

The generated file should be included in the model context exactly like a manually attached text file.

A small preview, rename option, or expandable editor would be useful. A richer artifact-style side panel for viewing and editing the pasted content could be added later, but the initial implementation only needs to convert the large paste into an attached context file.

It would also be useful to provide one of the following behaviours:

  • Automatically convert pastes above a configurable character or line threshold.
  • Show a small choice such as Paste inline or Attach as file.
  • Allow the attachment to be expanded back into the composer when needed.

Describe alternatives you've considered

Currently, I manually save clipboard content to a file and then attach or reference it.

For example:

pbpaste > /tmp/context.txt

Then:

Review @/tmp/context.txt and identify the main problems.

This works, but it adds unnecessary steps and is cumbersome during frequent debugging, code-review, and architecture workflows.

Suggested acceptance criteria

  • Large plain-text clipboard pastes can be converted into a virtual text attachment.
  • The pasted content is not displayed in full inside the message composer.
  • The generated attachment is included in the model context.
  • Users can remove the attachment before sending.
  • Users can still paste the text inline when desired.
  • Normal short pastes continue to behave as they do today.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.