<?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: Aslam Muhammad</title>
    <description>The latest articles on DEV Community by Aslam Muhammad (@aslammhdms).</description>
    <link>https://dev.to/aslammhdms</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%2F3868946%2F282126a3-d05c-4f69-aeee-2a2e42e48da8.png</url>
      <title>DEV Community: Aslam Muhammad</title>
      <link>https://dev.to/aslammhdms</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aslammhdms"/>
    <language>en</language>
    <item>
      <title>I Cut My Claude Code Token Usage by 65% With a Simple File Structure Change</title>
      <dc:creator>Aslam Muhammad</dc:creator>
      <pubDate>Thu, 09 Apr 2026 05:19:17 +0000</pubDate>
      <link>https://dev.to/aslammhdms/i-cut-my-claude-code-token-usage-by-65-with-a-simple-file-structure-change-1hmk</link>
      <guid>https://dev.to/aslammhdms/i-cut-my-claude-code-token-usage-by-65-with-a-simple-file-structure-change-1hmk</guid>
      <description>&lt;p&gt;If you use Claude Code regularly, you've probably noticed that your &lt;code&gt;CLAUDE.md&lt;/code&gt; file grows over time. You add rules, context, conventions, examples — and before long it's 400 lines of markdown that loads into every single session whether you need it or not.&lt;/p&gt;

&lt;p&gt;That's the problem. Claude Code reads your entire &lt;code&gt;CLAUDE.md&lt;/code&gt; at the start of every conversation. A typical project file runs around 13,000 tokens. You're burning that budget before writing a single line of code.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Fix: A Lean Index, Not a Monolith
&lt;/h2&gt;

&lt;p&gt;The insight is straightforward: Claude doesn't need all your rules in every session. It needs the right rules for what you're working on right now.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;leanclaude&lt;/strong&gt; is a Claude Code project template built around this idea. Instead of one large &lt;code&gt;CLAUDE.md&lt;/code&gt;, you get:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A lean &lt;code&gt;CLAUDE.md&lt;/code&gt; index (~200 tokens) that names the rules but doesn't load them&lt;/li&gt;
&lt;li&gt;Focused rule files under &lt;code&gt;.claude/rules/&lt;/code&gt; that Claude pulls in as needed&lt;/li&gt;
&lt;li&gt;A memory system for persisting session discoveries across conversations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Claude Code reads the index, understands what rules exist and what they cover, and loads specific files only when relevant to the current task. The result is dramatically lower baseline token consumption.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Token Math
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Approach&lt;/th&gt;
&lt;th&gt;Tokens/session&lt;/th&gt;
&lt;th&gt;Sessions/day&lt;/th&gt;
&lt;th&gt;Daily total&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Monolithic CLAUDE.md&lt;/td&gt;
&lt;td&gt;~13,000&lt;/td&gt;
&lt;td&gt;20&lt;/td&gt;
&lt;td&gt;~260,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;leanclaude&lt;/td&gt;
&lt;td&gt;~4,500&lt;/td&gt;
&lt;td&gt;20&lt;/td&gt;
&lt;td&gt;~90,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Savings&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;~8,500&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;~170,000/day&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;That's roughly 65% less context overhead — tokens that stay available for actual work.&lt;/p&gt;




&lt;h2&gt;
  
  
  What the Structure Looks Like
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.claude/
  rules/
    git-workflow.md
    commit-format.md
    debugging-investigation.md
    escalation-protocol.md
    security-basics.md
    code-review-checklist.md
    examples/
      node/
      dotnet/
      python/
  agents/
    code-reviewer.md
    debugger.md
    refactor-specialist.md
    security-auditor.md
  commands/
    review.md
    debug.md
    pre-pr.md
    add-rule.md
  memory/
CLAUDE.md        # lean index only
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;CLAUDE.md&lt;/code&gt; at the root is just a table of contents. Each rule file is self-contained and focused on one concern.&lt;/p&gt;




&lt;h2&gt;
  
  
  What's Included
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;10 universal rule files&lt;/strong&gt; covering the patterns that matter on almost every project: git workflow, commit format, debugging discipline, escalation protocol, long-term architecture thinking, security basics (OWASP Top 10), code review checklist, pre-PR checks, validation after changes, and rules for managing rules.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Framework examples&lt;/strong&gt; for Node.js, Python, and .NET. Use what fits your stack, delete the rest.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4 specialized agents&lt;/strong&gt; you invoke by name:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;code-reviewer&lt;/code&gt; — structured review before opening a PR&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;debugger&lt;/code&gt; — systematic root cause investigation (3-strike rule, debug report format)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;refactor-specialist&lt;/code&gt; — architecture-safe refactoring&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;security-auditor&lt;/code&gt; — OWASP-based security review&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4 slash commands&lt;/strong&gt; — &lt;code&gt;/review&lt;/code&gt;, &lt;code&gt;/debug&lt;/code&gt;, &lt;code&gt;/pre-pr&lt;/code&gt;, &lt;code&gt;/add-rule&lt;/code&gt; — each backed by an agent with a defined workflow.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A memory system&lt;/strong&gt; with typed templates for storing session discoveries, user preferences, and project context that persists across conversations.&lt;/p&gt;




&lt;h2&gt;
  
  
  How to Get Started
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Use as a GitHub template&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Go to &lt;a href="https://github.com/aslammhdms/leanclaude" rel="noopener noreferrer"&gt;github.com/aslammhdms/leanclaude&lt;/a&gt;, click "Use this template", and create your repo.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Update CLAUDE.md with your project's specifics&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Fill in entry point, build command, and key file locations. The template has placeholder comments showing exactly what to replace.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Delete framework examples you don't need&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you're on Node.js, remove &lt;code&gt;examples/dotnet/&lt;/code&gt; and &lt;code&gt;examples/python/&lt;/code&gt;. Fewer files means less noise.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Open Claude Code and start working&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That's it. Claude reads the lean index and references rule files selectively based on the task.&lt;/p&gt;




&lt;h2&gt;
  
  
  Get It
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/aslammhdms/leanclaude" rel="noopener noreferrer"&gt;github.com/aslammhdms/leanclaude&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you try it and find something missing or broken, open an issue. PRs are welcome too.&lt;/p&gt;

</description>
      <category>claude</category>
      <category>ai</category>
      <category>productivity</category>
      <category>devtool</category>
    </item>
  </channel>
</rss>
