<?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: ec1980</title>
    <description>The latest articles on DEV Community by ec1980 (@ec1980).</description>
    <link>https://dev.to/ec1980</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%2F3939084%2Fa914210f-142b-4ed2-b486-262b74ab29da.jpg</url>
      <title>DEV Community: ec1980</title>
      <link>https://dev.to/ec1980</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ec1980"/>
    <language>en</language>
    <item>
      <title>I Kept Hitting Claude Code's 5-Hour Limit After 2 Hours. So I Built This.</title>
      <dc:creator>ec1980</dc:creator>
      <pubDate>Tue, 19 May 2026 01:15:43 +0000</pubDate>
      <link>https://dev.to/ec1980/i-kept-hitting-claude-codes-5-hour-limit-after-2-hours-so-i-built-this-34nl</link>
      <guid>https://dev.to/ec1980/i-kept-hitting-claude-codes-5-hour-limit-after-2-hours-so-i-built-this-34nl</guid>
      <description>&lt;p&gt;If you use Claude Code heavily, you've probably hit the wall.&lt;/p&gt;

&lt;p&gt;You're deep into a session, the agent is finally understanding your codebase, and then — usage limit reached. Not after 5 hours. After 2.&lt;/p&gt;

&lt;p&gt;Aside from the limit, a major contributing factor is that every coding session re-sends the same project context over and over. Even with prompt caching, the tokens stack up fast on a large repo, and you burn through your window faster than you'd expect.&lt;/p&gt;

&lt;p&gt;So I built &lt;strong&gt;L-SDF&lt;/strong&gt; — Latent-Structured Documentation Format.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flosuupdkf2cqofie1ev6.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flosuupdkf2cqofie1ev6.gif" alt="lsdf demo" width="642" height="520"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  What Is L-SDF?
&lt;/h2&gt;

&lt;p&gt;L-SDF generates compact index files (&lt;code&gt;.lsdf&lt;/code&gt;) that give AI coding agents a structural map of your codebase — before they ever open a source file.&lt;/p&gt;

&lt;p&gt;Instead of an agent reading 110K tokens of raw source code to find its way around, it reads an 8K token index first. It only drills into source files when it actually needs implementation details.&lt;/p&gt;

&lt;p&gt;The result: &lt;strong&gt;significantly reduced input token costs&lt;/strong&gt; compared with reading source directly, even with prompt caching — which means your usage limit stretches a lot further in navigation-heavy coding sessions.&lt;/p&gt;

&lt;p&gt;It works today with &lt;strong&gt;Claude Code, Cursor, and Copilot&lt;/strong&gt; — and because it's a plain file format, it's not tied to any one tool.&lt;/p&gt;




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

&lt;p&gt;Here's what the savings look like on a typical Python repo:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Metric&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Source tokens (21 files)&lt;/td&gt;
&lt;td&gt;110,432&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;L-SDF index tokens&lt;/td&gt;
&lt;td&gt;8,241&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Compression ratio&lt;/td&gt;
&lt;td&gt;13.4×&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;And in terms of estimated &lt;strong&gt;input token&lt;/strong&gt; session cost (output and other costs not included):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Scenario&lt;/th&gt;
&lt;th&gt;Est. 50-turn session cost (input tokens only)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Source code, with caching&lt;/td&gt;
&lt;td&gt;$2.03&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;L-SDF + caching&lt;/td&gt;
&lt;td&gt;$0.55&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;~73% (~4×)&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




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

&lt;p&gt;L-SDF uses a hierarchical sigil-based topology to represent your codebase structure. Each directory gets two index files:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;INDEX.lsdf&lt;/code&gt;&lt;/strong&gt; — shows what exists (compact structural map)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;INDEX.detail.lsdf&lt;/code&gt;&lt;/strong&gt; — shows signatures, schemas, and call edges&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The agent reads &lt;code&gt;INDEX.lsdf&lt;/code&gt; first to navigate. It only opens &lt;code&gt;INDEX.detail.lsdf&lt;/code&gt; when it needs signatures or call edges, and opens source files only when it needs the implementation body. This is the key insight: &lt;strong&gt;agents don't need to read your source files to understand where things are.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here's a simple example. Given this Python file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# hello.py
&lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;sys&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Greeter&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;say_hello&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;ValueError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Name must not be empty&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;message&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Hello, &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;greet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;names&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;say_hello&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;names&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;()]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;L-SDF generates two index files:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;INDEX.lsdf&lt;/code&gt;&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@hello.py
 ~sys
 @Greeter
  !say_hello
  !greet
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;code&gt;INDEX.detail.lsdf&lt;/code&gt;&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@hello.py
 ~sys
 @Greeter
  !say_hello(name:s):s
  !greet(names:[s]):[s] &amp;gt; say_hello
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In a handful of tokens the agent knows: there's a file &lt;code&gt;hello.py&lt;/code&gt;, it imports &lt;code&gt;sys&lt;/code&gt;, contains a class &lt;code&gt;Greeter&lt;/code&gt; with two methods — their signatures, return types, and that &lt;code&gt;greet&lt;/code&gt; calls &lt;code&gt;say_hello&lt;/code&gt;. No implementation details, no noise — just the map.&lt;/p&gt;




&lt;h2&gt;
  
  
  Quick Start
&lt;/h2&gt;

&lt;p&gt;L-SDF is distributed as a global CLI tool. Install it with &lt;code&gt;pipx&lt;/code&gt; so the &lt;code&gt;lsdf&lt;/code&gt; command is available across all your projects:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Install pipx if you don't have it (Ubuntu/Debian)&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;pipx
pipx ensurepath

&lt;span class="c"&gt;# Install lsdf-core&lt;/span&gt;
pipx &lt;span class="nb"&gt;install &lt;/span&gt;lsdf-core

&lt;span class="c"&gt;# Verify&lt;/span&gt;
lsdf &lt;span class="nt"&gt;--help&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then three commands to set it up in any repo:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Initialize L-SDF in your repo&lt;/span&gt;
lsdf init

&lt;span class="c"&gt;# Generate index files recursively&lt;/span&gt;
lsdf gen &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;--recursive&lt;/span&gt;

&lt;span class="c"&gt;# See your token savings estimate&lt;/span&gt;
lsdf stats
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Contributors:&lt;/strong&gt; If you have the repo checked out locally and want to work on the source, see the &lt;a href="https://github.com/ec1980/lsdf-core" rel="noopener noreferrer"&gt;repo README&lt;/a&gt; for editable install and test instructions.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  What lsdf init Creates
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;project.lsdf
.lsdf/
  lsdf_instructions.md
  lsdf_spec.md
.lsdfignore
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It also detects your stack and skips irrelevant paths (&lt;code&gt;__pycache__&lt;/code&gt;, &lt;code&gt;.venv&lt;/code&gt;, etc.) automatically via &lt;code&gt;.lsdfignore&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;lsdf init&lt;/code&gt; automatically appends instructions to &lt;code&gt;CLAUDE.md&lt;/code&gt; and &lt;code&gt;.cursorrules&lt;/code&gt; so your agents know to use the index files right away.&lt;/p&gt;




&lt;h2&gt;
  
  
  How It Compares to Other Approaches
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;vs. Vector embeddings (Cursor's built-in RAG)&lt;/strong&gt;&lt;br&gt;
Cursor injects context via vector embeddings — powerful but opaque. You don't control what gets sent or at what cost. L-SDF is an explicit, versionable map in your repo. You can inspect it, version it, and it behaves consistently across every agent. The tradeoff is determinism and zero runtime overhead instead of recall flexibility.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;vs. Workflow governance tools (like Haxaml)&lt;/strong&gt;&lt;br&gt;
Tools like Haxaml govern &lt;em&gt;how&lt;/em&gt; the agent works through a task (prepare, build, verify, record). L-SDF governs &lt;em&gt;what the agent reads&lt;/em&gt; — giving it a structural map so it navigates without opening files. They're complementary, not competitive. You could run both.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;vs. AGENTS.md / CLAUDE.md / .cursorrules&lt;/strong&gt;&lt;br&gt;
These are prompt files — instructions to the agent. L-SDF is the structured data underneath them. &lt;code&gt;lsdf init&lt;/code&gt; writes to these files automatically so they point agents at the index.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;vs. Graphify&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://github.com/safishamsi/graphify" rel="noopener noreferrer"&gt;Graphify&lt;/a&gt; turns your entire project — code, docs, PDFs, images, videos — into a queryable knowledge graph with an interactive HTML visualization. It's a powerful tool for onboarding, architecture exploration, and cross-repo discovery. L-SDF is more narrowly focused: two compact index files per directory, optimized for low-token coding navigation during active sessions. Graphify's output is rich and explorable; L-SDF's output is minimal by design. They're complementary — Graphify for understanding a codebase, L-SDF for navigating it efficiently while coding.&lt;/p&gt;


&lt;h2&gt;
  
  
  Index Drift
&lt;/h2&gt;

&lt;p&gt;One concern people raise: what happens when the code changes and the index goes stale?&lt;/p&gt;

&lt;p&gt;L-SDF has three layers of defense:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Auto-regeneration after structural edits.&lt;/strong&gt; The agent is instructed to run &lt;code&gt;lsdf gen &amp;lt;dir&amp;gt;&lt;/code&gt; after any structural change. You do the same when editing manually.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. &lt;code&gt;lsdf sync&lt;/code&gt; as an enforcement check.&lt;/strong&gt; Run it in CI or as a pre-commit hook:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;lsdf &lt;span class="nb"&gt;sync&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;--check&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The exit code is non-zero if any index is out of date. Wire this into your CI's required checks and stale indices stop reaching &lt;code&gt;main&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Auto-regeneration on push via &lt;code&gt;lsdf init --ci&lt;/code&gt;.&lt;/strong&gt; The strongest enforcement — regenerates the index on every push. Requires write permissions on the branch and may add some commit noise, but gives you the highest confidence that the map is always current.&lt;/p&gt;




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

&lt;p&gt;L-SDF currently supports Python repos. The format is language-agnostic and open — generators for Go, Rust, and TypeScript are on the roadmap and contributions are very welcome.&lt;/p&gt;

&lt;p&gt;The community has also asked for benchmarks across repo sizes and context thread lengths. Rather than publishing self-generated data, I'd love for early adopters to share their own numbers.&lt;/p&gt;




&lt;h2&gt;
  
  
  Try It
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;📦 PyPI: &lt;a href="https://pypi.org/project/lsdf-core/" rel="noopener noreferrer"&gt;pypi.org/project/lsdf-core&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;🔗 GitHub: &lt;a href="https://github.com/ec1980/lsdf-core" rel="noopener noreferrer"&gt;github.com/ec1980/lsdf-core&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you try it, I'd genuinely love to hear what token savings you see on your repo. Drop a comment below or open a GitHub Discussion.&lt;/p&gt;

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