RTK Context CopierGather code into your clipboard in a shape that is convenient to paste into a chat with an LLM. Right-click files or folders in the Explorer, highlight a block in the editor, or grab a Git diff — the extension formats what you picked, with file paths and fenced code blocks, and puts it on the clipboard. It can also route file contents through RTK, a command-line tool that strips code down to a more compact representation before it reaches your context window. RTK reports token reductions in the region of 60–90% on typical source files; that figure is RTK's own measurement of its compression, not a benchmark of this extension. AttributionThis project is a fork of Copy to LLM by
Tomasz Kasperczyk, used under the MIT license. The copy, selection and diff functionality is his
work. What this fork adds is the RTK integration: detection of the RTK itself is a separate MIT-licensed project by the RTK authors and is not bundled with this extension — you install it yourself if you want the compression command. RequirementsThe plain copy commands work on their own. For the compressed command you need the CommandsAll commands are prefixed RTK Copier in the Command Palette.
The file and compressed commands also appear in the Explorer context menu, the selection command in the editor context menu, and the diff command in the Source Control view. Settings
Example:
Output shapeUncompressed output is a sequence of labelled, fenced blocks, one per file. Compressed output is wrapped so the model can tell it has been through RTK:
ContributingIssues and pull requests are welcome at luutuankiet/vscode-rtk-context-copier. Please report problems here rather than to the upstream project, which does not include the RTK integration. LicenseMIT — see LICENSE. Copyright is held by Tomasz Kasperczyk for the original work and by Tuan Kiet Luu for the modifications in this fork. |