<?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: Stef Antonio Virgil</title>
    <description>The latest articles on DEV Community by Stef Antonio Virgil (@stef_antoniovirgil_5958d).</description>
    <link>https://dev.to/stef_antoniovirgil_5958d</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%2F3652464%2F65249785-b564-4f41-9459-d986666d96cd.png</url>
      <title>DEV Community: Stef Antonio Virgil</title>
      <link>https://dev.to/stef_antoniovirgil_5958d</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/stef_antoniovirgil_5958d"/>
    <language>en</language>
    <item>
      <title>The Wipe &amp; Inject Pattern: Full Context for Implementation After Long Planning Sessions</title>
      <dc:creator>Stef Antonio Virgil</dc:creator>
      <pubDate>Wed, 10 Dec 2025 23:30:45 +0000</pubDate>
      <link>https://dev.to/stef_antoniovirgil_5958d/the-wipe-inject-pattern-full-context-for-implementation-after-long-planning-sessions-2gji</link>
      <guid>https://dev.to/stef_antoniovirgil_5958d/the-wipe-inject-pattern-full-context-for-implementation-after-long-planning-sessions-2gji</guid>
      <description>&lt;p&gt;If you use Claude Code (or any agentic tool) for serious development, you have hit "The Wall."&lt;/p&gt;

&lt;p&gt;The Scenario:&lt;/p&gt;

&lt;p&gt;Phase 1 (Planning): You spend 45 minutes debating the architecture. You ask Claude to read 20 files, check dependencies, and plan the auth system.&lt;/p&gt;

&lt;p&gt;Cost: ~150k tokens.&lt;br&gt;
Result: A perfect plan.&lt;/p&gt;

&lt;p&gt;Phase 2 (Implementation): You say: "Great, write the code."&lt;/p&gt;

&lt;p&gt;The Crash: Claude responds: "I need to compact my memory to proceed."&lt;/p&gt;

&lt;p&gt;The Workaround Everyone Uses:&lt;/p&gt;

&lt;blockquote&gt;
&lt;ol&gt;
&lt;li&gt;"OK, save the plan to a .md file first"&lt;/li&gt;
&lt;li&gt;Claude compacts (loses context)&lt;/li&gt;
&lt;li&gt;"Now read the .md file you just created"&lt;/li&gt;
&lt;li&gt;Claude re-explores files mentioned in the plan&lt;/li&gt;
&lt;li&gt;"Update the .md with your progress as you go"&lt;/li&gt;
&lt;li&gt;Repeat steps 2-5 every time context fills up&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;

&lt;p&gt;The Problem: When the agent "compacts" context, it summarizes the WHAT ("We are building auth") but loses the WHY ("We chose cookies over headers because of XSS concerns"). The implementation phase starts with a "low-resolution" brain. The agent forgets constraints, re-asks questions, and writes buggy code.&lt;/p&gt;

&lt;p&gt;The Solution: The "Wipe &amp;amp; Inject" Pattern&lt;br&gt;
We faced this daily while building &lt;a href="https://grov.dev" rel="noopener noreferrer"&gt;Grov&lt;/a&gt;. To fix it, we built an orchestration flow called Planning CLEAR.&lt;/p&gt;

&lt;p&gt;It changes the lifecycle of a session from a "Run-on Sentence" to a "Chapter Book."&lt;/p&gt;

&lt;p&gt;How it works (The Logic)&lt;br&gt;
Instead of letting the context window fill up with chatty "back and forth," we use a local proxy to enforce a hard reset between Planning and Coding.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Detect Completion: We use a small model (Claude Haiku) to monitor the session. When it detects the task_type has switched from "Planning" to "Implementation," it triggers the CLEAR event.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Extract the Signal: Before wiping the memory, we extract two specific data points into a JSON structure:&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Key Decisions: What did we agree on? (e.g., "Use Zod for validation").&lt;/p&gt;

&lt;p&gt;Reasoning Trace: Why did we agree on it? (e.g., "Because Joi doesn't support type inference").&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The "Wipe" (Reset): We empty the messages[] array completely.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Old Context Usage: 150,000 tokens.&lt;/p&gt;

&lt;p&gt;New Context Usage: 0 tokens.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The "Inject" We inject the structured Summary directly into the system_prompt of the new session.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The Result&lt;br&gt;
When you start typing code, you aren't fighting for the last 50k tokens of space. You have a fresh ~195k context window, but the agent still has "Full Recall" of the architectural constraints.&lt;/p&gt;

&lt;p&gt;Bonus: The "Heartbeat" (Solving the 5-minute timeout)&lt;br&gt;
Even with a fresh context window, there is another "invisible tax": Cache Expiry. Anthropic's prompt cache expires after 5 minutes of inactivity.&lt;/p&gt;

&lt;p&gt;If you take a 10-minute break to grab coffee, your "Warm Cache" dies. The next prompt costs you full price (read tokens) and takes longer to process.&lt;/p&gt;

&lt;p&gt;The Fix: We added a --extended-cache flag to Grov. It runs a background heartbeat that sends a minimal token (literally just a .) to the API every 4 minutes if you are idle.&lt;/p&gt;

&lt;p&gt;Cost: ~$0.002 per keep-alive request (roughly every 4 minutes when idle).&lt;br&gt;
Value: Keeps the session "Hot" indefinitely.&lt;/p&gt;

&lt;p&gt;Try it out (Open Source)&lt;/p&gt;

&lt;p&gt;We built these workflows into Grov, our open-source proxy for Claude Code.&lt;br&gt;
If you are tired of running out of tokens or losing context mid-implementation, give it a shot.&lt;/p&gt;

&lt;p&gt;Repo: github.com/TonyStef/Grov&lt;br&gt;
Install: npm install -g grov&lt;/p&gt;

&lt;p&gt;Let me know if this pattern helps your workflow!&lt;/p&gt;

</description>
      <category>ai</category>
      <category>typescript</category>
      <category>llm</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Collective AI Memory for Engineering Teams (Open Source)</title>
      <dc:creator>Stef Antonio Virgil</dc:creator>
      <pubDate>Mon, 08 Dec 2025 21:01:31 +0000</pubDate>
      <link>https://dev.to/stef_antoniovirgil_5958d/collective-ai-memory-for-engineering-teams-open-source-2jlg</link>
      <guid>https://dev.to/stef_antoniovirgil_5958d/collective-ai-memory-for-engineering-teams-open-source-2jlg</guid>
      <description>&lt;p&gt;I've been using Claude Code heavily for a long period of time now. It’s incredible, but I noticed two massive hidden costs that were eating my budget (and my patience).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. The Context Tax&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Every time I started a new session, I had to watch the agent re-explore my codebase. It would read the same auth.ts file it read yesterday, re-analyze the same dependencies, and burn thousands of input tokens just to get back to "baseline."&lt;/p&gt;

&lt;p&gt;It felt like hiring a senior engineer who gets amnesia every morning.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. "Context Drift"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This was the bigger problem. My co-founder would establish an architectural pattern in Session A (e.g., "Always use the Service pattern for database calls"). Two days later, in Session B, my agent would ignore that constraint and write direct SQL queries.&lt;/p&gt;

&lt;p&gt;The agent didn't know what my team decided yesterday. This led to regression bugs and "Drift," where the agent slowly deviates from the project's goals.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Solution&lt;/strong&gt;: &lt;strong&gt;Grov&lt;/strong&gt; &lt;strong&gt;(Team Memory)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I built Grov to give agents a persistent, shared brain.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;It acts as a local proxy that sits between your terminal and the LLM. It captures reasoning traces (&lt;strong&gt;why a change was made&lt;/strong&gt;) and syncs them to the cloud.&lt;/p&gt;

&lt;p&gt;If developer A explains the Auth system to their agent, developer B's agent automatically knows about it 10 minutes later.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How we built "Anti-Drift"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We didn't just want a vector database dump. We needed active protection against hallucination. We implemented a real-time drift detection system inside the proxy.&lt;/p&gt;

&lt;p&gt;Here is the logic flow:&lt;br&gt;
Intercept: The proxy captures every proposed action from Claude (edit, write, bash). &lt;/p&gt;

&lt;p&gt;Score: We use a fast, cheap model (Claude 4.5 Haiku) to score the action on a scale of 1-10.&lt;/p&gt;

&lt;p&gt;Verify: Haiku checks the action against:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The Original Goal&lt;br&gt;
The Current User Instruction (Takes priority!)&lt;br&gt;
Established Project Constraints&lt;br&gt;
Logical Coherence (Current vs. Historical Reasoning)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Correct: If the score indicates "Drift" (deviation from the goal or constraints), Grov &lt;em&gt;intercepts&lt;/em&gt; the request &lt;em&gt;and injects a correction&lt;/em&gt; &lt;strong&gt;before&lt;/strong&gt; &lt;em&gt;Claude commits the code.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This effectively gives the agent a "Reviewer" that sits on its shoulder and says, "Hey, remember we decided to use the Service pattern? Don't write that SQL query."&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Open Source&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I built this because my co-founder and I were tired of repeating ourselves to our AI.&lt;/p&gt;

&lt;p&gt;It is fully Open Source (Apache 2.0).&lt;/p&gt;

&lt;p&gt;Data: Reasoning traces are captured locally. &lt;em&gt;Team Sync is opt-in&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Repo&lt;/strong&gt;: github.com/TonyStef/Grov &lt;strong&gt;NPM&lt;/strong&gt;: npm install -g grov&lt;br&gt;
&lt;em&gt;(Star the repo to follow updates!)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;We are currently in v0.5 Public Beta. If you are running an engineering team and want to test the "Shared Memory" implementation, I'd &lt;strong&gt;love your feedback&lt;/strong&gt; on the product so far. &lt;/p&gt;

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