<?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: ran li</title>
    <description>The latest articles on DEV Community by ran li (@evanlin2026).</description>
    <link>https://dev.to/evanlin2026</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%2F3950049%2F3f8520aa-0172-407e-bb15-e621e36185bf.png</url>
      <title>DEV Community: ran li</title>
      <link>https://dev.to/evanlin2026</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/evanlin2026"/>
    <language>en</language>
    <item>
      <title>Stop Rebuilding AI Context Every Session</title>
      <dc:creator>ran li</dc:creator>
      <pubDate>Wed, 27 May 2026 14:16:12 +0000</pubDate>
      <link>https://dev.to/evanlin2026/stop-rebuilding-ai-context-every-session-3i1l</link>
      <guid>https://dev.to/evanlin2026/stop-rebuilding-ai-context-every-session-3i1l</guid>
      <description>&lt;p&gt;I built a stateful workspace system for AI coding workflows&lt;/p&gt;

&lt;p&gt;After months of heavy AI-assisted development, I kept running into the same workflow problem:&lt;/p&gt;

&lt;p&gt;Every AI session felt like a partial reset.&lt;/p&gt;

&lt;p&gt;Even with good models,&lt;br&gt;
the workflow itself was fundamentally stateless.&lt;/p&gt;

&lt;p&gt;Whenever I:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;restarted Cursor&lt;/li&gt;
&lt;li&gt;switched chats&lt;/li&gt;
&lt;li&gt;changed models&lt;/li&gt;
&lt;li&gt;reopened VS Code&lt;/li&gt;
&lt;li&gt;resumed work the next day&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;the AI would lose track of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;which files were actively evolving&lt;/li&gt;
&lt;li&gt;what feature I was implementing&lt;/li&gt;
&lt;li&gt;recent debugging progress&lt;/li&gt;
&lt;li&gt;relevant Git changes&lt;/li&gt;
&lt;li&gt;architectural direction&lt;/li&gt;
&lt;li&gt;current workspace focus&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So I kept rebuilding context manually.&lt;/p&gt;

&lt;p&gt;Over and over.&lt;/p&gt;

&lt;p&gt;⸻&lt;/p&gt;

&lt;p&gt;The Real Problem Isn’t Just Memory&lt;/p&gt;

&lt;p&gt;At first I thought this was only a memory problem.&lt;/p&gt;

&lt;p&gt;But eventually I realized:&lt;/p&gt;

&lt;p&gt;The deeper issue is missing workspace state.&lt;/p&gt;

&lt;p&gt;Most AI tools only understand isolated prompts or chat history.&lt;/p&gt;

&lt;p&gt;Real software development depends on constantly evolving state:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;active files&lt;/li&gt;
&lt;li&gt;recent edits&lt;/li&gt;
&lt;li&gt;changing priorities&lt;/li&gt;
&lt;li&gt;debugging flow&lt;/li&gt;
&lt;li&gt;Git activity&lt;/li&gt;
&lt;li&gt;unfinished implementation context&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That state changes continuously during development.&lt;/p&gt;

&lt;p&gt;And most AI systems lose it between sessions.&lt;/p&gt;

&lt;p&gt;⸻&lt;/p&gt;

&lt;p&gt;Building Contorium&lt;/p&gt;

&lt;p&gt;So I started building Contorium:&lt;br&gt;
a persistent workspace state system for AI coding.&lt;/p&gt;

&lt;p&gt;Instead of relying entirely on prompts,&lt;br&gt;
Contorium continuously tracks workspace evolution and generates structured development context.&lt;/p&gt;

&lt;p&gt;It tracks things like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;active editors&lt;/li&gt;
&lt;li&gt;recently modified files&lt;/li&gt;
&lt;li&gt;Git changes&lt;/li&gt;
&lt;li&gt;current focus&lt;/li&gt;
&lt;li&gt;workspace summaries&lt;/li&gt;
&lt;li&gt;event history&lt;/li&gt;
&lt;li&gt;compressed context memory&lt;/li&gt;
&lt;li&gt;evolving file priority&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All stored locally inside:&lt;/p&gt;

&lt;p&gt;.contora/&lt;/p&gt;

&lt;p&gt;The goal is simple:&lt;/p&gt;

&lt;p&gt;Help AI understand the current state of development.&lt;/p&gt;

&lt;p&gt;Not just remember old conversations.&lt;/p&gt;

&lt;p&gt;⸻&lt;/p&gt;

&lt;p&gt;Stateful AI Coding&lt;/p&gt;

&lt;p&gt;One of the biggest shifts for me was realizing that AI coding workflows should probably behave more like state machines than chat sessions.&lt;/p&gt;

&lt;p&gt;The system continuously updates:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;what is actively changing&lt;/li&gt;
&lt;li&gt;what matters most&lt;/li&gt;
&lt;li&gt;where development is currently focused&lt;/li&gt;
&lt;li&gt;which files are unstable&lt;/li&gt;
&lt;li&gt;what recently evolved&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That state can survive:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;IDE restarts&lt;/li&gt;
&lt;li&gt;session changes&lt;/li&gt;
&lt;li&gt;model switches&lt;/li&gt;
&lt;li&gt;multi-day workflows&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This makes AI interactions feel far less disposable.&lt;/p&gt;

&lt;p&gt;⸻&lt;/p&gt;

&lt;p&gt;Git-aware Context Tracking&lt;/p&gt;

&lt;p&gt;Git turned out to be one of the strongest context signals.&lt;/p&gt;

&lt;p&gt;Contorium automatically tracks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;modified files&lt;/li&gt;
&lt;li&gt;staged files&lt;/li&gt;
&lt;li&gt;working tree changes&lt;/li&gt;
&lt;li&gt;recent activity&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of dumping entire repositories into prompts,&lt;br&gt;
the system prioritizes what is actively evolving.&lt;/p&gt;

&lt;p&gt;This becomes especially useful in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;monorepos&lt;/li&gt;
&lt;li&gt;long refactors&lt;/li&gt;
&lt;li&gt;large AI-assisted codebases&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;⸻&lt;/p&gt;

&lt;p&gt;Reducing Context Noise&lt;/p&gt;

&lt;p&gt;Another issue I kept seeing:&lt;/p&gt;

&lt;p&gt;Most AI workflows waste tokens on irrelevant context.&lt;/p&gt;

&lt;p&gt;So Contorium also focuses heavily on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;file ranking&lt;/li&gt;
&lt;li&gt;context compression&lt;/li&gt;
&lt;li&gt;semantic summaries&lt;/li&gt;
&lt;li&gt;noisy path filtering&lt;/li&gt;
&lt;li&gt;compact workspace exports&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The idea is not simply “more context.”&lt;/p&gt;

&lt;p&gt;It’s:&lt;br&gt;
better context prioritization.&lt;/p&gt;

&lt;p&gt;⸻&lt;/p&gt;

&lt;p&gt;Local-first Architecture&lt;/p&gt;

&lt;p&gt;I intentionally designed the system as local-first.&lt;/p&gt;

&lt;p&gt;No cloud workspace sync.&lt;br&gt;
No hidden telemetry.&lt;br&gt;
No chat scraping.&lt;/p&gt;

&lt;p&gt;Optional BYOK providers currently include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;OpenAI&lt;/li&gt;
&lt;li&gt;Claude&lt;/li&gt;
&lt;li&gt;Gemini&lt;/li&gt;
&lt;li&gt;DeepSeek&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But the workspace state itself belongs to the developer.&lt;/p&gt;

&lt;p&gt;⸻&lt;/p&gt;

&lt;p&gt;Current Stack&lt;/p&gt;

&lt;p&gt;Current stack includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;TypeScript&lt;/li&gt;
&lt;li&gt;VS Code Extension API&lt;/li&gt;
&lt;li&gt;Cursor support&lt;/li&gt;
&lt;li&gt;Claude Code / MCP support&lt;/li&gt;
&lt;li&gt;local workspace scanners&lt;/li&gt;
&lt;li&gt;structured context builders&lt;/li&gt;
&lt;li&gt;Git-aware ranking systems&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;⸻&lt;/p&gt;

&lt;p&gt;Current Direction&lt;/p&gt;

&lt;p&gt;Right now I’m exploring:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;stateful AI coding workflows&lt;/li&gt;
&lt;li&gt;persistent development sessions&lt;/li&gt;
&lt;li&gt;long-running agent systems&lt;/li&gt;
&lt;li&gt;token-efficient context generation&lt;/li&gt;
&lt;li&gt;AI-native development environments&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I increasingly think persistent workspace state will become a standard layer in future AI IDEs.&lt;/p&gt;

&lt;p&gt;Still early.&lt;br&gt;
But already extremely useful in my own workflow.&lt;/p&gt;

&lt;p&gt;Website:&lt;br&gt;
&lt;a href="https://www.contorium.dev" rel="noopener noreferrer"&gt;https://www.contorium.dev&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>cursor</category>
      <category>agents</category>
    </item>
  </channel>
</rss>
