← Back to Blog
pullmdweb-scrapingclaude-codeMarch 8, 2026 · 7 min read

PullMD Part 1: Ctrl+A and the Junk Context – Simply Explained

RAW INPUT → PARSE & FILTER → MARKDOWNAI-generated image
Editorial diagram: a tall console labeled PARSE & FILTER between a noisy Reddit-like input panel on the left and a clean markdown output panel on the right; bottom row shows the parser pipeline producing structured data.Editorial diagram: a tall console labeled PARSE & FILTER between a noisy Reddit-like input panel on the left and a clean markdown output panel on the right; bottom row shows the parser pipeline producing structured data.

I’m sitting in front of a long forum post online. Someone describes pretty much the problem I’m working on. So I do what I always do: Ctrl+A (select all), Ctrl+C (copy), into the chat with an AI chatbot.

On the phone it’s even more awkward. Select everything, copy, paste. “Share with Claude” doesn’t work on Reddit, because Reddit blocks AI services.

The result is usually fine. The way to get there is still pretty stupid.

Two Ways, Same Problem

There are actually two different situations where things go wrong. They look similar at first glance, but they’re not the same.

Sharing a link. When you give the chatbot just the link to a webpage, it first has to fight through the entire page structure: navigation, cookie banners, ads, recommendations and all the other page junk. The actual post is buried somewhere in between.

Copy-paste it yourself. And even the text you select and paste yourself often consists largely of exactly that stuff. Ctrl+A really does mean everything. Not just the post, but all the packaging around it.

In both cases, the chatbot has to process a lot of irrelevant content before it gets to what actually matters.

Think of it like a desk with limited surface area. If half of it is already taken up by advertising flyers, there’s not much room left for what you actually need. And every one of those flyers costs processing power and time, for nothing.

That costs so-called tokens. Tokens are the building blocks a language model breaks text into, a bit like syllables, but not quite. The more tokens that go to waste on junk, the fewer remain for the actual content.

Of course, none of this is a groundbreaking insight. It just started to annoy me that I kept repeating the same pointless motions. And at some point it was once too often.

The Brief Hope: Cloudflare

Cloudflare – a large company that helps keep a big part of the internet running behind the scenes – recently introduced a service: web address in, clean text out. Without navigation, without ads, without cookie banners.

I tried it right away, of course. A few Wikipedia articles, a tech blog. The result really did look good.

Technically it works by sending a small hint along when you request the page. Roughly: “Oh, by the way, I’ll take markdown too, if you have any.” Markdown is a simple text format – text with structure, but without all the bells and whistles.

The command for it looks like this:

curl "https://developers.cloudflare.com/fundamentals/reference/markdown-for-agents/" \
  -H "Accept: text/markdown"

(That’s a command-line instruction. It fetches a webpage and says: “Give me the markdown version, if you have one.”)

The catch: it only works on websites that actively support the service. It doesn’t work on Reddit. And it doesn’t work on a lot of the sites you stumble across day to day either.

A tool that fails on a large part of the sites I actually need doesn’t solve my problem. It only makes it a bit smaller in a few places.

Building It Myself, But Small at First

If there’s nothing ready-made that works reliably, I’ll build it myself. Not for half the internet right away, but for Reddit first. That’s where it bothers me most.

And there’s a pleasantly simple way in: append .json to a Reddit URL and Reddit returns the raw data of the post and its comments. Without logging in, without signing up, without any kind of approval. That’s been working for years.

On the phone, the service should be installable as a PWA (Progressive Web App – a webpage that behaves like an app on your phone). Then I could just hit “Share” in the Reddit app and send the link straight to my tool.

Like sending someone a link via WhatsApp. No selecting, no copying, no extra browser tab.

Before having any code written, I wanted to think through the concept properly. So first, some philosophising about it with Claude on claude.ai, to pin down architecture and requirements. After that, Claude Code was to start with a specification that was as complete as possible.

The Concept Chat of March 2

The chat started right away with a typo from my phone’s autocorrect. It had turned “Reddit” into “Tresor”, the German word for vault.

Claude replied to “Tresor Posts”:

Good idea, let’s think this through! I assume “Tresor” was autocorrect and you mean Reddit posts – right?

That was quite fitting. The model understood what I meant despite the mistake, because the rest of the context was unambiguous. That’s really what it always comes down to: not throwing as much text as possible at the model, but giving it the best possible context.

One of the first questions was whether there should be one way in or two:

  • The actual core is an HTTP endpoint – an address on the network that you send a request to and get a response back. Command-line tools, Claude Code or other automations can use it.
  • On top of that sits a small web interface as a PWA. It’s mainly meant for Android and takes links in through the share menu.

Both paths end up at the same core. The processing stays identical, only the way it’s used differs.

We deliberately wanted to do without the official Reddit API (the interface through which programs talk to Reddit). Access has become needlessly awkward, and for a service this small it isn’t required at all.

Instead, a two-step strategy took shape:

  1. First the .json route: append .json to the Reddit URL and fetch the raw data directly.
  2. If Reddit blocks that, a fallback: fetch the old Reddit interface (old.reddit.com) and extract the text from there.

Old Reddit is considerably easier to parse than today’s interface. Above all, it doesn’t require an automated browser running in the background, which would have made the whole project heavier straight away.

Nested Comments

Another decision from the chat that sounds minor but actually matters.

When someone in a forum replies to a comment, and someone else replies to that reply, you get a nested conversation structure. Like a tree with ever finer branches.

In text form, you can represent that with ever longer chains of angle brackets:

> > > > Reply to a reply to a reply

By the time you paste that into a chat it’s barely readable any more. The better alternative: each reply simply indents one step to the right. With normal indentation the structure stays visible, without the actual content disappearing behind a wall of > characters.

Codename and Address

The project’s first codename came out of this chat too. I built under that name for the next few weeks. Later it had to go again for trademark reasons – more on that in Part 8.

At the end, the service still needed its own address on the home network. My network follows a fixed naming scheme, so I simply asked Claude to pick a fitting name for it.

The Share Function on Android

On Android there’s a feature that lets an installed PWA register itself in the share menu. When you hit “Share” in the Reddit app, your own tool then shows up next to WhatsApp, Signal and the other apps.

The important word here is installed. It’s not enough to just open the page in the browser. The PWA has to be actually installed via “Install app” or “Add to home screen”. It also has to be reachable over an encrypted connection (HTTPS).

A small entry in the settings tells the phone what should happen when a link is shared. Share a Reddit link, the interface opens, and the link is already there. No typing, no copying.

The Specification

At the end of the chat there was a complete specification – a blueprint, essentially:

  • File structure
  • Interface description with parameters and return formats
  • PWA settings
  • A configuration file for the server environment
  • Network settings
  • Sample output with indented comments

The open questions were settled with that. Not a line of code yet. Exactly as it was meant to be.

The chat was supposed to plan the project, not start producing half-finished files along the way. The actual building was to be Claude Code’s job, with the specification as its brief.

That same evening at 21:53 it began.


Part 1 of 15 in the PullMD series.

PullMD Part 2: From Spec to Running Container →

Comments

Commenting takes an email confirmation or a GitHub login. Comments run on my own server, not on an ad provider's — details in the privacy policy.