<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Anal Shaju</title>
    <description>The latest articles on DEV Community by Anal Shaju (@as707).</description>
    <link>https://dev.to/as707</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3589888%2F4dd4ea6b-12f4-4a21-92f3-39d19a0834e3.png</url>
      <title>DEV Community: Anal Shaju</title>
      <link>https://dev.to/as707</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/as707"/>
    <language>en</language>
    <item>
      <title>I built a CLI tool that converts messy webpages into clean markdown for AI tools</title>
      <dc:creator>Anal Shaju</dc:creator>
      <pubDate>Thu, 21 May 2026 05:19:02 +0000</pubDate>
      <link>https://dev.to/as707/i-built-a-cli-tool-that-converts-messy-webpages-into-clean-markdown-for-ai-tools-4964</link>
      <guid>https://dev.to/as707/i-built-a-cli-tool-that-converts-messy-webpages-into-clean-markdown-for-ai-tools-4964</guid>
      <description>&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;Every time I paste a webpage into Claude or ChatGPT, I waste my tokens on navigation bars, footers, ads, and junk.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;grabctx - a CLI tool that strips all the unwanted things and gives you only the main content as clean markdown.&lt;/p&gt;

&lt;h2&gt;
  
  
  How It Works
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; grabctx
grabctx https://any-article.com &lt;span class="nt"&gt;--copy&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It fetches the page, extracts the main content using Mozilla's &lt;br&gt;
Readability algorithm (same one Firefox uses for Reader View), &lt;br&gt;
converts it to markdown, and shows you the token savings.&lt;/p&gt;

&lt;h2&gt;
  
  
  Results
&lt;/h2&gt;

&lt;p&gt;Tested on a Wikipedia page:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Before: 91,461 tokens&lt;/li&gt;
&lt;li&gt;After: 19,757 tokens
&lt;/li&gt;
&lt;li&gt;Saved: 78%&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Tech Stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;TypeScript&lt;/li&gt;
&lt;li&gt;Node.js&lt;/li&gt;
&lt;li&gt;@mozilla/readability&lt;/li&gt;
&lt;li&gt;linkedom&lt;/li&gt;
&lt;li&gt;turndown&lt;/li&gt;
&lt;li&gt;commander&lt;/li&gt;
&lt;li&gt;gpt-tokenizer&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;npm: &lt;a href="https://www.npmjs.com/package/grabctx" rel="noopener noreferrer"&gt;https://www.npmjs.com/package/grabctx&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/AnalShaju/grabctx" rel="noopener noreferrer"&gt;https://github.com/AnalShaju/grabctx&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Would love feedback from the community!&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>cli</category>
      <category>opensource</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
