DEV Community

Cover image for Why most AI writing tools mangle your code
Fei Jihua
Fei Jihua

Posted on

Why most AI writing tools mangle your code

You paste in a blog post with a git rebase -i walkthrough, one config snippet, and a benchmark table. What comes back is a "thread" that reads like a growth marketer found your draft: the command turned into "streamline your workflow", the snippet vanished, and there's a number you never wrote — apparently your setup is now "10x faster".

The shape of it, roughly every time:

in:   git rebase -i origin/main
      docker run -p 8080:80 target/release/api
      p95: 840ms → 210ms

out:  Streamline your CI workflow!
      Your setup is now 10x faster.  (thread 1/3)
Enter fullscreen mode Exit fullscreen mode

If you write technical content, you've lived some version of this. After one or two of these, most of us quietly go back to writing everything by hand, and the tool gets filed under "demo only".

The problem isn't that these tools write badly. They're bad at not rewriting.

Three reasons it happens

1. The objective is "engaging", not "faithful"

Nearly every repurposing tool is built on the same instruction: "turn this into an engaging social post." That objective comes from the marketing playbook — hook first, punchy, scannable. Code blocks are the enemy of scannable. Flags are the enemy of punchy. So the model does exactly what it was asked to do: it optimizes for engagement and pays for it with your technical content.

Nobody told it "the code is the point", so it treats the code as filler.

2. Compression is the model's default instinct

Ask an LLM to "simplify" anything and it compresses — that is what it is good at. In a technical post, the highest-density tokens are the code, the flags, the version numbers, and those are exactly what a summarizer eats first. docker run -p 8080:80 becomes "run the container". Technically fine. Completely useless to the reader who came for the command.

3. Nothing anchors the output to the source

Worse than a deleted snippet is an invented one. Left unconstrained, the model fills gaps with plausible-sounding facts: benchmarks you never ran, quotes you never gave, versions that don't exist. A wrong flag in a tutorial is worse than no tutorial — someone pastes it into prod at 2am and blames you.

Why this hurts technical content specifically

A marketing post that is 80% faithful is still publishable. A technical post that is 80% faithful is dangerous, because readers don't skim your post for vibes — they copy-paste from it. One mangle and the tool is dead to you.

What I did about it — and what it does not fix

I hit this often enough to build ReThread. The honest framing: I can't change how the model behaves. What I can do is put constraints around it, plus one check that is a mitigation, not a guarantee.

1. The source is fenced and marked untouchable. Every request wraps your input:

SOURCE CONTENT (rewrite this, do not add new claims):
"""
<your post>
"""
Enter fullscreen mode Exit fullscreen mode

The model isn't invited to improve your post. It's told to rewrite this and add nothing to it.

2. The rules are constraints, not suggestions: preserve code, commands and domain terms; never invent facts, stats or quotes; no emoji spam, no clickbait.

3. Every platform spec repeats the accuracy rule. "Keep it under 280 characters" and "keep the code" pull in opposite directions, so the model has to hear both at once, per platform.

4. A preservation check that retries once. Before generating, the code extracts the source's code assets (fenced blocks plus inline code). After generating, it measures how many survived — matched case- and whitespace-insensitively, so a re-wrapped code block still counts but a renamed variable does not. If the source had 2+ assets and fewer than half survived, it regenerates once at low temperature with an explicit "you dropped code, keep it verbatim" instruction, then keeps whichever attempt scored higher.

That last one is the part I'd flag to anyone building the same thing: it only sees code blocks and inline code. It does not see version numbers, benchmark figures, or what was inside a table. On my own test posts it kept every asset — that is a handful of samples, not a benchmark.

Where it still breaks

So you don't find out the hard way:

  • Long posts get truncated. Input is capped at 20,000 characters.
  • TikTok scripts drop code on purpose. A 60-second talking-head script can't read a yaml block out loud. It names the command or flag verbally instead ("the --force flag I cover in the post"). If you need verbatim code, use the X / LinkedIn / article formats.
  • The model is Llama 3.3 70B on Cloudflare Workers AI. Not the strongest model available. It keeps the demo free and fast; a frontier model would hold up better on long, dense posts. Read the output before you publish it.
  • Numbers and tables are not checked by the preservation pass.
  • It writes English. A post in another language comes back translated into English. I tested this with Chinese: the facts, the commands and the numbers survived, the language did not. Treat it as English-only for now.
  • It produces text only. No scheduling, no auto-posting, no images. You still paste the result into each platform yourself.
  • Free is 10 runs a day with an email — no card, no password. Without an email you still get a per-network allowance (30 platform calls a day, so roughly 15 two-platform runs), but it is shared by everyone behind the same IP and nothing is saved to your history.

Use it if / don't use it if

Reasonable fit: you already wrote the long post and need it reformatted for 2–4 platforms; you will read the output before posting it (you should, always).

Bad fit: you want it to write the post for you; you need guaranteed fidelity on dense numeric content; you want publishing automation; you write in a language other than English.

The bar for technical AI tools

If you're building for developers, here is the uncomfortable part: we don't grade on a curve. Nobody wants a tool that is "mostly right". We want one trustworthy enough that we stop re-reading every line. That is a much higher bar than "sounds engaging", and it is a prompting and evaluation problem as much as a model-size problem.

So, honest question for the comments: what is the worst AI-mangling you've run into? Stripped code blocks, invented benchmarks, "simplified" commands that no longer run?

ReThread is at https://feijihua.top — 10 free runs a day after entering an email, Pro is $19/month for unlimited runs and brand-voice matching (you paste a few of your own posts). It is a one-person project, so the honest status is: the parts above work, and the list of what it does not do is the rest of this post.

Top comments (0)