DEV Community

Cover image for I Built a VS Code Extension to Paste Your Project into Free Chatbots and Apply the Diffs in One Click! 🔥

I Built a VS Code Extension to Paste Your Project into Free Chatbots and Apply the Diffs in One Click! 🔥

EffessDev on September 26, 2026

Let me show exactly how it works with an example 🛻 The extension adds a new "ReptClip" tab in the VS Code bottom panel: I am going to use this ...
Collapse
 
mansio profile image
Mikhail •

The file-order fix (*/.py main.py) landed exactly where piekwerk and I both pointed on your last post — target file right above the prompt, not buried in the middle. Good to see it shipped.

One thing on Apply Diffs specifically: the uniqueness rule (#3) is enforced by asking the model to comply, not by checking it. Nothing stops a SEARCH block from matching an unintended spot if the surrounding context wasn't unique enough — same failure shape as the ASCII-alignment bug from your PR, models reason in tokens, not exact structural position, so "unique enough" is exactly the kind of thing they get subtly wrong. A match-count check before applying (refuse on 0 or 2+ matches) would turn rule #3 from a prompt-level hope into something guaranteed.

Also worth flagging given piekwerk's docs/me/ catch on your first post: the same glob pattern that pulls files into context for Apply Diffs also pulls them into the clipboard payload that leaves the machine. A cheap grep tripwire for secret-shaped strings before copy would catch the accidental case.

Collapse
 
effessdev profile image
EffessDev •

This is the exact reason why I love your comments! Thanks for taking the time to read it so deeply 🙂

At first, no matter how many times I retried applying the diffs, it kept failing. I tried allowing any type of line ending, but it still failed on longer blocks. Once I made the matching more flexible, like allowing slightly different spacing and minor variations, it finally started applying diffs correctly.

Good point on the uniqueness issue. Let me quickly check what happens. I think I have done something to handle it.

Collapse
 
mansio profile image
Mikhail •

Makes sense on the whitespace flexibility — long blocks on Windows vs POSIX line endings are a nightmare.

One quick edge case to check when you look at it: if the matcher is now looser (flexible spacing), does it stop and throw an error if it finds 2+ fuzzy matches, or does it just take the first one? Loosening the spacing usually makes non-unique matches more likely, so an explicit match-count guard is even more useful there.

Thread Thread
 
effessdev profile image
EffessDev •

Ah found it!

Currently, in case of a non-unique match, the diff isn't applied at all, and we get an error. It never silently picks the first.

You make me realize how important it is to document these things. I should be stricter about the documentation from now on...

Collapse
 
effessdev profile image
EffessDev • • Edited

Would you mind explaining a bit more about the docs/me catch? I read it a few times, but I still couldn't understand it exactly. 🤔

Collapse
 
mansio profile image
Mikhail •

Sure! It's about the same glob pattern doing double duty.

When you type a pattern like */.md to build context, it matches every .md file in the repo — including ones that were never meant to leave your machine, like personal notes in a docs/me/ folder. Nothing in the pattern distinguishes "code I want to share" from "private notes that happen to match."

Piekwerk hit this on your first post: his generated markdown included docs/me/prompt.md and docs/me/publishing.md — personal files that got swept in because they matched the pattern, then went straight into the clipboard and out to a hosted chatbot.

The same mechanism applies to Apply Diffs — whatever glob builds your context is the same one that decides what leaves your machine. A quick client-side check before copying (flagging common secret shapes, or sensitive paths like /me/, .env, etc.) turns that blind sweep into a safe, reliable default.

Collapse
 
ivannovazzi profile image
Ivan Annovazzi •

You add page.tsx first, then AGENTS.md, but then say page.tsx appears after it. Is the output actually reversing the input order, or is that a typo? Reversed ordering would be confusing once someone has 10+ files in context

Collapse
 
effessdev profile image
EffessDev • • Edited

Ah, sorry 😅 Actually, even though I added AGENTS.md second, it was inserted before page.tsx. If you check the screenshot. That's what became confusing. It's the same order as the input order.

Collapse
 
piekwerk profile image
Piekwerk •

Thanks for the shoutout, glad the suggestions helped. Tried the new paste flow today and it's a real improvement, the context lands in one shot and the order control with main.py last is the detail I didn't know I needed.

One edge case worth a look before someone hits it: what happens on Apply Diffs when the working tree is already dirty. If a diff fails and I click Revert, I lose my own uncommitted changes too, because git checkout restores the last commit, not the state just before Apply. The fix that worked for me is treating Apply as a checkpoint, stash or commit first so Revert has a clean floor to return to, or have the extension snapshot the affected files before writing. Ran into exactly this with agent edits a while back: half my refactor was uncommitted, a diff overwrote part of it, and Revert then wiped the rest.

Also ran the Qwen trick from the screenshots, no issues on a Next.js repo. Nice build.

Collapse
 
effessdev profile image
EffessDev • • Edited

Yes the suggestions absolutely helped! Thanks for trying it out! Really means a lot! 🥲

Applying diffs throws an error and stops in case of any problems, even if it's a single block. If the working tree is dirty, the diff isn't even applied. So you don't have to revert it.

And, the extension doesn't rely on Git at all. It manually stores the contents of all the files in a diff before applying the diff. Clicking revert simply restores it. But since it's not stored permanently, you will lose it if you reopen VS Code. This was a deliberate decision to quickly get it up and running. I will be fixing it soon 🙂

The purpose of Revert is to simply revert the diff you just applied. So, I wouldn't rely on it that much. But it exists as a quick way to revert misclicks 👆 Also, it stores a hash of the last diff, so there is no problem with clicking Apply Diff again. It will show a notification that the diff was already applied!

Collapse
 
unitbuilds profile image
UnitBuilds •

Great job honestly! How about next up, create a chrome plugin, so you can use a chatbot online (like gemini) and it pipes it through? If you already have the infrastructure to apply code sets from a pasted prompt, then this is the natural evolution of it, so it becomes a seamless integration and lets you spam any browser only AI feature to the fullest!

Specifically, ai studio... If you can manage a hook into that, then it'd be rock solid!

Collapse
 
effessdev profile image
EffessDev •

Haha. I really am thinking about it. All thanks to you! For reminding me about the limited-time free access! The only problem is that I have no idea how that actually works under the hood 😅 But I'll eventually figure it out 🔥

Collapse
 
unitbuilds profile image
UnitBuilds •

The concept is simple. If you look at my MCP-Lite, it works via the AOM. So a chrome extension that lets you select the AOM node to monitor, maybe with a capture button as a starter, so it takes that node, fetches it's content, then diffs it over the last applied. That way it doesnt repeat. You already have all the framework you'd need for the applying side, that revert system can double as a diffing system. So flow would be, you prompt gemini, it answers, you click capture. Capture takes the full chat and forwards it to the vs code extension. It diffs, then applies the remainder. If you want to upgrade it, you can do the diffing in the AOM as a marker system, so it only reads on from last marker. That way it can continue, without re-capturing the full chat history. But that's optimization, the initial implementation should be quite easy to implement!

Thread Thread
 
effessdev profile image
EffessDev •

I don't know whether you would believe but it already looks really complicated 😅 Let me read it a couple more times, and search what a few of those words mean... 🏃