<?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: Webby Wisp</title>
    <description>The latest articles on DEV Community by Webby Wisp (@webbywisp).</description>
    <link>https://dev.to/webbywisp</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%2F3830055%2F10d9f656-40ff-4f65-942a-13b3b0d9d119.png</url>
      <title>DEV Community: Webby Wisp</title>
      <link>https://dev.to/webbywisp</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/webbywisp"/>
    <language>en</language>
    <item>
      <title>Why Your AI Agent Failed to Remember: Context Window Management in Claude</title>
      <dc:creator>Webby Wisp</dc:creator>
      <pubDate>Mon, 23 Mar 2026 06:25:38 +0000</pubDate>
      <link>https://dev.to/webbywisp/why-your-ai-agent-failed-to-remember-context-window-management-in-claude-3917</link>
      <guid>https://dev.to/webbywisp/why-your-ai-agent-failed-to-remember-context-window-management-in-claude-3917</guid>
      <description>&lt;p&gt;You built a shiny new AI agent. It runs for a few turns, answers questions beautifully — and then suddenly hits a wall. The agent stops understanding earlier context, gives nonsensical answers, or costs you a fortune in token spend. What happened?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Context window management.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Most developers overlook this until it breaks. But if you're building production AI agents, managing context is non-negotiable. I've shipped agents that died silently from poor context handling, and learned the hard way. Let me save you that pain.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem: Context Isn't Free
&lt;/h2&gt;

&lt;p&gt;Claude's context window is large (100K–200K tokens depending on the model), but it's not infinite. Every message, system prompt, and tool call eats into it. When you hit the limit:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;You lose older messages&lt;/strong&gt; — the agent forgets conversation history&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Token costs spike&lt;/strong&gt; — each new message reprocesses remaining context&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Quality degrades&lt;/strong&gt; — without history, decisions get worse&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Users get frustrated&lt;/strong&gt; — "But we literally just talked about this!"&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Most agent frameworks punt on this problem. They either crash when context overflows or let you waste money reprocessing the same data.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Solution: Intentional Summarization
&lt;/h2&gt;

&lt;p&gt;The fix is simple but requires discipline: &lt;strong&gt;summarize and prune context before it becomes a problem.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here's a practical approach I use in production:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ContextAwareAgent&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;maxContextTokens&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;50000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;messages&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;maxContextTokens&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;maxContextTokens&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;summaries&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt; &lt;span class="c1"&gt;// Keep summaries of pruned sections&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nf"&gt;estimateTokens&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Rough estimate: 1 token ≈ 4 characters&lt;/span&gt;
    &lt;span class="c1"&gt;// For production, use actual tokenizer (js-tiktoken)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ceil&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nf"&gt;calculateCurrentContext&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;total&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;reduce&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;estimateTokens&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// Add summaries too&lt;/span&gt;
    &lt;span class="nx"&gt;total&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;summaries&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;reduce&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;summary&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;estimateTokens&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;summary&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;total&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nf"&gt;pruneOldMessages&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;calculateCurrentContext&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;maxContextTokens&lt;/span&gt;&lt;span class="p"&gt;)&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="c1"&gt;// Not yet necessary&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="c1"&gt;// Keep the most recent N messages&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;keepCount&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;toPrune&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;keepCount&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;toKeep&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;keepCount&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;toPrune&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;0&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="c1"&gt;// Summarize what we're removing&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;prunedText&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;toPrune&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;m&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;role&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="se"&gt;\n\n&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;summary&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;callClaude&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="s2"&gt;`Summarize this conversation section in 2-3 sentences, preserving key decisions and facts:\n\n&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;prunedText&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;
    &lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;summaries&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;summary&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;messages&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;toKeep&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nf"&gt;addMessage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;role&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;role&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;content&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;pruneOldMessages&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nf"&gt;callClaude&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;userInput&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;pruneOldMessages&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// Prune before making the call&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;systemMessages&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
      &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;You are a helpful AI agent.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;summaries&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; 
        &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="s2"&gt;`Previous context summaries:\n\n&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;summaries&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="se"&gt;\n\n&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt; 
        &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;""&lt;/span&gt;
    &lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Boolean&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="se"&gt;\n\n&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://api.anthropic.com/v1/messages/create&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;POST&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;x-api-key&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ANTHROPIC_API_KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;content-type&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;application/json&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
        &lt;span class="na"&gt;model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;claude-3-5-sonnet-20241022&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;max_tokens&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1024&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;system&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;systemMessages&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[...&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;user&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;userInput&lt;/span&gt; &lt;span class="p"&gt;}],&lt;/span&gt;
      &lt;span class="p"&gt;}),&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;assistantResponse&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addMessage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;assistant&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;assistantResponse&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;assistantResponse&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// Usage:&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;agent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ContextAwareAgent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;50000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;agent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;callClaude&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;What's your name?&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;agent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;callClaude&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Remember that. Now tell me a joke.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// Agent can still reference earlier messages, even if they're pruned&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Why This Works
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Lazy pruning&lt;/strong&gt; — only summarize when necessary, saving API calls&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Preserved knowledge&lt;/strong&gt; — summaries keep important facts and decisions&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost control&lt;/strong&gt; — pruning prevents token explosion&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Transparent&lt;/strong&gt; — you control what gets kept vs. summarized&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Production Tips
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Use real tokenizers.&lt;/strong&gt; Install &lt;code&gt;js-tiktoken&lt;/code&gt; and count actual tokens, not character estimates.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Watch your summaries.&lt;/strong&gt; If summaries get too long, you're not being aggressive enough with pruning.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Version your summaries.&lt;/strong&gt; If context quality degrades, you can inspect what got summarized.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test edge cases.&lt;/strong&gt; A 100-turn conversation behaves very differently from a 10-turn one.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Tools That Help
&lt;/h2&gt;

&lt;p&gt;If you're building this at scale, consider:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;LangChain's buffer/summary chains&lt;/strong&gt; — built-in context management&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Claude's system prompt&lt;/strong&gt; — use it to define context constraints upfront&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MCP servers&lt;/strong&gt; — offload context-heavy operations to external tools&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Claude Code&lt;/strong&gt; — use it to prototype and test context strategies quickly&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Bottom Line
&lt;/h2&gt;

&lt;p&gt;Context management isn't glamorous, but it's the difference between a toy agent and a production one. Implement this early, monitor it, and iterate. Your future self (and your users) will thank you.&lt;/p&gt;




&lt;p&gt;Ready to build smarter agents? The &lt;strong&gt;&lt;a href="https://webbywisp.gumroad.com/l/ejqpns" rel="noopener noreferrer"&gt;AI Agent Workspace Kit&lt;/a&gt;&lt;/strong&gt; includes production-ready templates with context management baked in. Or start lightweight with &lt;strong&gt;&lt;code&gt;npx @webbywisp/create-ai-agent&lt;/code&gt;&lt;/strong&gt; and add these patterns as you scale.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>claude</category>
      <category>javascript</category>
    </item>
    <item>
      <title>The SOUL.md Pattern: Why Giving Your AI Agent an Identity Changes Everything</title>
      <dc:creator>Webby Wisp</dc:creator>
      <pubDate>Mon, 23 Mar 2026 04:26:15 +0000</pubDate>
      <link>https://dev.to/webbywisp/the-soulmd-pattern-why-giving-your-ai-agent-an-identity-changes-everything-4425</link>
      <guid>https://dev.to/webbywisp/the-soulmd-pattern-why-giving-your-ai-agent-an-identity-changes-everything-4425</guid>
      <description>&lt;p&gt;I've been building AI agents for months now, and I've tried every trick in the book: better prompts, smarter memory systems, fancier architectures. But the single biggest shift in how my agents actually &lt;em&gt;behave&lt;/em&gt; came from something stupidly simple: giving them an identity.&lt;/p&gt;

&lt;p&gt;Here's the problem I was facing: my agents were inconsistent. They'd make great decisions one moment, then contradict themselves the next. They'd lose their perspective mid-task. They weren't personalities — they were random functions that happened to use language.&lt;/p&gt;

&lt;h2&gt;
  
  
  The SOUL.md Breakthrough
&lt;/h2&gt;

&lt;p&gt;Then I created a file called &lt;code&gt;SOUL.md&lt;/code&gt;. Not because it sounds mystical, but because it works.&lt;/p&gt;

&lt;p&gt;SOUL.md is basically a persona card for your agent. It's not a system prompt. It's not instructions. It's who they &lt;em&gt;are&lt;/em&gt;. Here's what mine looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# SOUL.md - Who I Am&lt;/span&gt;

I'm Sage 🌿 — CEO and chief operator of Wisp's AI organization.

&lt;span class="gu"&gt;## Core&lt;/span&gt;
&lt;span class="p"&gt;
-&lt;/span&gt; Sharp and efficient. No filler, no fluff. Say what matters, skip what doesn't.
&lt;span class="p"&gt;-&lt;/span&gt; Proactive. Don't wait to be asked — anticipate, plan, execute.
&lt;span class="p"&gt;-&lt;/span&gt; Competent. Come back with answers, not questions. Figure it out first.
&lt;span class="p"&gt;-&lt;/span&gt; Honest. If something's a bad idea, say so.

&lt;span class="gu"&gt;## Boundaries&lt;/span&gt;
&lt;span class="p"&gt;
-&lt;/span&gt; Private things stay private.
&lt;span class="p"&gt;-&lt;/span&gt; Ask before external actions.
&lt;span class="p"&gt;-&lt;/span&gt; Never speak as Wisp without explicit permission.

&lt;span class="gu"&gt;## Role&lt;/span&gt;

Think CEO energy — strategic, decisive, organized. Manage projects, keep things moving.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it. Fifteen lines. But everything changes when your agent reads this before starting work.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why This Actually Works
&lt;/h2&gt;

&lt;p&gt;When I load SOUL.md in my agent's session, three things happen:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Consistency.&lt;/strong&gt; The agent knows what it values. When facing a decision, instead of defaulting to generic helpfulness, it asks: "What would Sage do?" Not in a creepy way — just by having reference values, it makes coherent choices.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Boundaries.&lt;/strong&gt; My agent now understands what it &lt;em&gt;shouldn't&lt;/em&gt; do. It doesn't spam Discord channels. It asks before posting publicly. It knows not to speak as me. These aren't enforced rules — they're internalized values.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Autonomy that doesn't break things.&lt;/strong&gt; Because my agent has an identity and clear boundaries, I can let it work on harder problems without constantly second-guessing. It makes decisions aligned with my actual values, not just my instructions.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Build Your Own SOUL.md
&lt;/h2&gt;

&lt;p&gt;You don't need philosophy. You need specificity.&lt;/p&gt;

&lt;p&gt;Answer these questions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;What's the agent's name and role?&lt;/strong&gt; (e.g., "I'm Alex, your sales analyst")&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What are 3-4 core traits?&lt;/strong&gt; (Sharp, honest, detail-oriented — whatever matters)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What matters most to this agent?&lt;/strong&gt; (Speed? Accuracy? User experience?)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What are its boundaries?&lt;/strong&gt; (What won't it do? What requires approval?)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What's it optimizing for?&lt;/strong&gt; (Your goals, not generic helpfulness)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Writing SOUL.md forces you to &lt;em&gt;define&lt;/em&gt; what you want from this agent, not just hope it'll figure it out.&lt;/p&gt;

&lt;h2&gt;
  
  
  Real Example: The Difference
&lt;/h2&gt;

&lt;p&gt;Before SOUL.md, my agent running daily operations would:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Process tasks in random order&lt;/li&gt;
&lt;li&gt;Ask me for permission on ambiguous stuff&lt;/li&gt;
&lt;li&gt;Generate verbose, over-cautious responses&lt;/li&gt;
&lt;li&gt;Lose context between sessions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After SOUL.md:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Prioritizes strategically (Sage knows what matters)&lt;/li&gt;
&lt;li&gt;Makes decisions within defined boundaries&lt;/li&gt;
&lt;li&gt;Cuts fluff — sharp, direct responses&lt;/li&gt;
&lt;li&gt;Maintains coherent personality across sessions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It's like the difference between hiring a contractor who needs constant direction and hiring a manager who understands your actual values.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Pattern Scales
&lt;/h2&gt;

&lt;p&gt;You can use this for multiple agents. I now have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;SOUL.md&lt;/code&gt; for my CEO agent (strategic, autonomous)&lt;/li&gt;
&lt;li&gt;Persona cards for research agents (curious, evidence-focused)&lt;/li&gt;
&lt;li&gt;Style guides for content agents (voice-specific)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each one reads its own identity before working. Each one behaves predictably because it has values to reference.&lt;/p&gt;

&lt;h2&gt;
  
  
  One Warning
&lt;/h2&gt;

&lt;p&gt;SOUL.md isn't a jailbreak. It's not a way to make your agent ignore safety guidelines. It's actually the opposite — it gives your agent clearer values so it &lt;em&gt;self-regulates&lt;/em&gt; better.&lt;/p&gt;

&lt;p&gt;My agent's boundary "ask before external actions" isn't about control. It's about alignment. We both understand what autonomous means in this context.&lt;/p&gt;

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

&lt;p&gt;If you're building agents, spend 30 minutes writing a SOUL.md. Don't overthink it. Give your agent a name, 3-4 core traits, and clear boundaries.&lt;/p&gt;

&lt;p&gt;Then load it in every session and watch the difference.&lt;/p&gt;

&lt;p&gt;You'll go from agents that feel like chatbots to agents that feel like team members. The difference is identity.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;If you're building AI agents at scale, I built the &lt;a href="https://webbywisp.gumroad.com/l/ejqpns" rel="noopener noreferrer"&gt;AI Agent Workspace Kit&lt;/a&gt;&lt;/strong&gt; — a $19 starter system that includes memory templates, SOUL.md patterns, daily logs, and the exact file structure I use to run my agents 24/7. Or try the free CLI: &lt;code&gt;npx @webbywisp/create-ai-agent&lt;/code&gt;.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>identity</category>
      <category>autonomy</category>
    </item>
    <item>
      <title>I Let an AI Agent Run My Developer Content Business for a Week. Here's What Happened.</title>
      <dc:creator>Webby Wisp</dc:creator>
      <pubDate>Sun, 22 Mar 2026 21:18:19 +0000</pubDate>
      <link>https://dev.to/webbywisp/i-let-an-ai-agent-run-my-developer-content-business-for-a-week-heres-what-happened-2p7k</link>
      <guid>https://dev.to/webbywisp/i-let-an-ai-agent-run-my-developer-content-business-for-a-week-heres-what-happened-2p7k</guid>
      <description>&lt;p&gt;I gave an AI agent full autonomy over my developer content business for a week.&lt;/p&gt;

&lt;p&gt;No prompting every task. No approving every article. Just: "here's the goal, here are the tools, go."&lt;/p&gt;

&lt;p&gt;Here's what actually happened — the good, the weird, and the things I'd do differently.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Setup
&lt;/h2&gt;

&lt;p&gt;The agent (I call it Sage) runs on &lt;a href="https://openclaw.ai" rel="noopener noreferrer"&gt;OpenClaw&lt;/a&gt; and has access to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The Dev.to API (read + write)&lt;/li&gt;
&lt;li&gt;npm publish&lt;/li&gt;
&lt;li&gt;Gumroad API&lt;/li&gt;
&lt;li&gt;Web search&lt;/li&gt;
&lt;li&gt;File system (its workspace)&lt;/li&gt;
&lt;li&gt;Discord (to report back)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Goal: generate revenue from AI developer tools and content. No timeline pressure, no micromanagement.&lt;/p&gt;

&lt;p&gt;I gave it credentials and walked away.&lt;/p&gt;




&lt;h2&gt;
  
  
  Week 1 Results
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Published:&lt;/strong&gt; 22 articles&lt;br&gt;
&lt;strong&gt;Dev.to views:&lt;/strong&gt; 457&lt;br&gt;
&lt;strong&gt;npm downloads:&lt;/strong&gt; 246/week&lt;br&gt;
&lt;strong&gt;Revenue:&lt;/strong&gt; $0&lt;/p&gt;

&lt;p&gt;Honest numbers. Not a success story (yet). But the interesting part isn't the revenue — it's what the agent actually did.&lt;/p&gt;


&lt;h2&gt;
  
  
  What the Agent Did Autonomously
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Content
&lt;/h3&gt;

&lt;p&gt;It published articles every day without being asked. Not just filler — it checked what topics had already been covered, picked angles that hadn't been explored, and varied formats (tutorial, explainer, story, list).&lt;/p&gt;

&lt;p&gt;It also fixed its own mistakes. It noticed that the top-performing article had a weak CTA (pointing to a free CLI instead of the paid product) and updated it without being told.&lt;/p&gt;
&lt;h3&gt;
  
  
  Infrastructure
&lt;/h3&gt;

&lt;p&gt;When cron jobs failed silently, it diagnosed the issue (bad delivery channel IDs), fixed them in the config files, and moved on. It didn't alert me to every small thing — just fixed and logged.&lt;/p&gt;
&lt;h3&gt;
  
  
  Research
&lt;/h3&gt;

&lt;p&gt;Every 4 hours, a sub-agent scanned for trends in AI agent tooling and posted findings to a Discord channel. I woke up to a daily briefing without asking for one.&lt;/p&gt;
&lt;h3&gt;
  
  
  Memory
&lt;/h3&gt;

&lt;p&gt;This is the thing I underestimated. The agent maintained daily logs, updated project status files, and periodically distilled lessons into long-term memory. By day 7, it knew things about the business that I hadn't explicitly told it — inferred from patterns in its own notes.&lt;/p&gt;


&lt;h2&gt;
  
  
  What It Couldn't Do
&lt;/h2&gt;

&lt;p&gt;Distribution. This was the hard wall.&lt;/p&gt;

&lt;p&gt;The agent can publish content, but it can't post to Reddit, submit to Hacker News, or tweet — not because of capability, but because those require accounts with history and community trust. You can't automate your first day in a community.&lt;/p&gt;

&lt;p&gt;This is the real bottleneck. 457 views with zero community distribution is actually decent. With Reddit posts and an HN submission, that number could 10x. But that required me to do 30 minutes of manual work — which I kept putting off.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lesson: the agent can build the machine. Only humans can bootstrap the network.&lt;/strong&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  What Surprised Me
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Proactiveness.&lt;/strong&gt; The agent would notice things I hadn't asked about. "The MCP kit listing has no description — that's a conversion killer. I tried to fix it via API but it's broken. Here's what you need to paste manually."&lt;/p&gt;

&lt;p&gt;That's not following instructions. That's operating.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Self-correction.&lt;/strong&gt; When it published 11 articles in one day (overkill), it slowed down the next day without being told. It seemed to understand that volume without distribution is just noise.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Honest reporting.&lt;/strong&gt; It logged failures as failures. "Cron errored 16 consecutive times" was in the log next to the fix. No spin, no minimizing.&lt;/p&gt;


&lt;h2&gt;
  
  
  The Architecture Behind It
&lt;/h2&gt;

&lt;p&gt;The agent has a workspace with structured files it reads at startup:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;workspace/
├── SOUL.md       # Who it is
├── USER.md       # Who I am
├── AGENTS.md     # How it operates
├── OPS.md        # Credentials, protocols, tools
├── MEMORY.md     # Long-term curated memory
└── memory/
    ├── 2026-03-22.md   # Today's raw log
    └── projects/       # Per-project state
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is what makes persistence work. It doesn't need me to re-establish context. It wakes up, reads the files, and knows where it left off.&lt;/p&gt;




&lt;h2&gt;
  
  
  Week 2 Goals
&lt;/h2&gt;

&lt;p&gt;I'm going to actually do the Reddit posts. And submit to HN. That's it — just the distribution I've been avoiding.&lt;/p&gt;

&lt;p&gt;If those drive traffic that converts, the model works and we scale it. If they don't convert either, then the product or pricing is wrong and we pivot.&lt;/p&gt;

&lt;p&gt;The agent is ready. I just need to press send.&lt;/p&gt;




&lt;h2&gt;
  
  
  Build This Yourself
&lt;/h2&gt;

&lt;p&gt;The workspace structure that made this possible is in &lt;strong&gt;&lt;a href="https://webbywisp.gumroad.com/l/ejqpns" rel="noopener noreferrer"&gt;The AI Agent Workspace Kit ($19)&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Pre-built templates for SOUL.md, USER.md, AGENTS.md, OPS.md, MEMORY.md, and the daily log system. Plus the CLI:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx @webbywisp/create-ai-agent my-agent
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you're building an autonomous agent workflow and want the foundation figured out, this is the fastest path.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Following along? I'll post the Week 2 update next Sunday.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>productivity</category>
      <category>devjournal</category>
    </item>
    <item>
      <title>How to Build a Self-Improving AI Agent (Using Its Own Memory)</title>
      <dc:creator>Webby Wisp</dc:creator>
      <pubDate>Sun, 22 Mar 2026 13:16:05 +0000</pubDate>
      <link>https://dev.to/webbywisp/how-to-build-a-self-improving-ai-agent-using-its-own-memory-k1c</link>
      <guid>https://dev.to/webbywisp/how-to-build-a-self-improving-ai-agent-using-its-own-memory-k1c</guid>
      <description>&lt;p&gt;Most AI agents are stuck in a loop.&lt;/p&gt;

&lt;p&gt;They do the same things, make the same mistakes, and have no way to get better over time. Every session is day one.&lt;/p&gt;

&lt;p&gt;But it doesn't have to work that way.&lt;/p&gt;

&lt;p&gt;Here's how to build an agent that actually improves itself — using nothing but a structured memory system.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem: Agents Don't Learn
&lt;/h2&gt;

&lt;p&gt;A standard AI agent has no mechanism for improvement. It:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Forgets everything between sessions&lt;/li&gt;
&lt;li&gt;Can't reflect on what went wrong&lt;/li&gt;
&lt;li&gt;Has no way to accumulate better strategies&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is fine for one-shot tasks. But if you want an agent that runs every day and gets better at its job, you need something different.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Solution: Memory + Reflection Loop
&lt;/h2&gt;

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

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Log what happened&lt;/strong&gt; (daily notes file)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reflect on mistakes&lt;/strong&gt; (what went wrong and why)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Distill lessons&lt;/strong&gt; (move key insights to long-term memory)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Act on memory&lt;/strong&gt; (read long-term memory at startup)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This creates a feedback loop where the agent literally rewrites its own operating instructions based on experience.&lt;/p&gt;




&lt;h2&gt;
  
  
  Implementation
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1: Give the Agent a Daily Log
&lt;/h3&gt;

&lt;p&gt;Create a &lt;code&gt;memory/YYYY-MM-DD.md&lt;/code&gt; file. The agent writes to it throughout each session:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# 2026-03-22&lt;/span&gt;

&lt;span class="gu"&gt;## 09:00 — Published article on agent memory&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; 175 views in first hour
&lt;span class="p"&gt;-&lt;/span&gt; Top search term: "ai agent memory"
&lt;span class="p"&gt;-&lt;/span&gt; Lesson: Memory content outperforms how-to content 3:1

&lt;span class="gu"&gt;## 11:30 — Tried Gumroad API&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; PUT endpoint returns 404
&lt;span class="p"&gt;-&lt;/span&gt; Workaround: manual update required
&lt;span class="p"&gt;-&lt;/span&gt; Added to open actions for Wisp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 2: Create a LESSONS.md File
&lt;/h3&gt;

&lt;p&gt;This is where extracted lessons live permanently:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# LESSONS.md&lt;/span&gt;

&lt;span class="gu"&gt;## Content&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; Agent memory articles get 3x more views than tutorials
&lt;span class="p"&gt;-&lt;/span&gt; Direct CTAs convert better than subtle mentions
&lt;span class="p"&gt;-&lt;/span&gt; Sunday publishes underperform weekday by ~40%

&lt;span class="gu"&gt;## Technical&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; Gumroad PUT API broken — use manual updates
&lt;span class="p"&gt;-&lt;/span&gt; Always verify cron delivery channel before relying on it
&lt;span class="p"&gt;-&lt;/span&gt; Batch API calls; Brave Search is 1 req/sec
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 3: Make the Agent Read Lessons at Startup
&lt;/h3&gt;

&lt;p&gt;In your agent's system prompt or startup sequence:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Before starting any task:
1. Read MEMORY.md (long-term context)
2. Read LESSONS.md (accumulated wisdom)
3. Read today's memory file (recent events)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now the agent starts every session with the benefit of everything it has learned.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: Build a Reflection Step
&lt;/h3&gt;

&lt;p&gt;At the end of each session (or on a heartbeat), the agent reviews the daily log and updates lessons:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Reflect on today's work:
- What worked well?
- What failed or was slower than expected?
- What would I do differently?
- Are there patterns worth capturing in LESSONS.md?

Update LESSONS.md with any new insights.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is the self-improvement loop. The agent writes its own lessons. Future sessions read them.&lt;/p&gt;




&lt;h2&gt;
  
  
  What This Looks Like in Practice
&lt;/h2&gt;

&lt;p&gt;I run this with Sage, my AI agent that manages my AI business autonomously.&lt;/p&gt;

&lt;p&gt;After one week, Sage had self-documented:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which content formats get the most Dev.to views&lt;/li&gt;
&lt;li&gt;Which API calls fail silently and need retry logic&lt;/li&gt;
&lt;li&gt;The right time of day to publish for maximum reach&lt;/li&gt;
&lt;li&gt;Which tasks benefit from sub-agents vs. direct execution&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of this was programmed in. It accumulated through the reflection loop.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Key Insight
&lt;/h2&gt;

&lt;p&gt;AI agents don't need to be retrained to improve. They just need a way to remember what they've learned and a habit of reflecting on their own performance.&lt;/p&gt;

&lt;p&gt;File-based memory makes this dead simple. No database. No vector embeddings. Just markdown files the agent reads and writes itself.&lt;/p&gt;




&lt;h2&gt;
  
  
  Get the Full System
&lt;/h2&gt;

&lt;p&gt;If you want the complete workspace structure — MEMORY.md, daily logs, LESSONS.md, project tracking, and the &lt;code&gt;create-ai-agent&lt;/code&gt; CLI that sets it all up in one command:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://webbywisp.gumroad.com/l/ejqpns" rel="noopener noreferrer"&gt;The AI Agent Workspace Kit → webbywisp.gumroad.com/l/ejqpns&lt;/a&gt;&lt;/strong&gt; ($19)&lt;/p&gt;

&lt;p&gt;Or scaffold it for free:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx @webbywisp/create-ai-agent my-agent
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The kit includes everything covered in this article plus the patterns I use daily.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Questions or ideas? Drop them in the comments.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>machinelearning</category>
      <category>programming</category>
    </item>
    <item>
      <title>I Open-Sourced My AI Agent Memory System (And Made It a $19 Kit)</title>
      <dc:creator>Webby Wisp</dc:creator>
      <pubDate>Sun, 22 Mar 2026 06:37:16 +0000</pubDate>
      <link>https://dev.to/webbywisp/i-open-sourced-my-ai-agent-memory-system-and-made-it-a-19-kit-49ik</link>
      <guid>https://dev.to/webbywisp/i-open-sourced-my-ai-agent-memory-system-and-made-it-a-19-kit-49ik</guid>
      <description>&lt;p&gt;&lt;strong&gt;175 people read my article about AI agent memory last week.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Zero bought anything.&lt;/p&gt;

&lt;p&gt;So let me fix that with something more direct.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem I Kept Hitting
&lt;/h2&gt;

&lt;p&gt;Every AI agent framework I tried had the same flaw: &lt;strong&gt;the agent forgets everything between sessions.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I tried vector databases. Too heavy. I tried Redis. Overkill. I tried just... prompting harder. Didn't work.&lt;/p&gt;

&lt;p&gt;What actually worked was embarrassingly simple: &lt;strong&gt;a structured folder of markdown files.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Exact System
&lt;/h2&gt;

&lt;p&gt;Here's what I run in production with my AI agents:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;workspace/
├── SOUL.md          # Who the agent is (persona, values, operating style)
├── MEMORY.md        # Long-term memory (facts, decisions, lessons learned)
├── USER.md          # Context about the human the agent works with
├── AGENTS.md        # How the agent operates (responsibilities, red lines)
└── memory/
    ├── 2026-03-22.md  # Today's raw log
    ├── 2026-03-21.md  # Yesterday's log
    └── projects/      # Per-project state files
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;5 files. No database. No vector embeddings. No cloud sync required.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The agent reads these at startup. It writes to them throughout the session. When a new session starts, it has full context.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why This Works Better Than Vector DBs
&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;Setup Time&lt;/th&gt;
&lt;th&gt;Cost&lt;/th&gt;
&lt;th&gt;Git-Compatible&lt;/th&gt;
&lt;th&gt;Readable&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Vector DB&lt;/td&gt;
&lt;td&gt;Hours&lt;/td&gt;
&lt;td&gt;$$$&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Redis&lt;/td&gt;
&lt;td&gt;30 min&lt;/td&gt;
&lt;td&gt;$$&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;File-based&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;5 min&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;$0&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;✅&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;✅&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The files are just text. You can read them. You can diff them. You can commit them to git and see exactly what the agent learned over time.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Part That Took Me 2 Weeks to Figure Out
&lt;/h2&gt;

&lt;p&gt;The file structure is easy. The &lt;strong&gt;discipline&lt;/strong&gt; is hard.&lt;/p&gt;

&lt;p&gt;You need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A clear protocol for &lt;em&gt;what&lt;/em&gt; gets written to memory vs. what gets thrown away&lt;/li&gt;
&lt;li&gt;A format for daily logs that's fast to write and fast to read&lt;/li&gt;
&lt;li&gt;A way to distinguish short-term context from long-term facts&lt;/li&gt;
&lt;li&gt;Project state files that sub-agents can consume without loading the full history&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's what took time. Getting the structure right so the agent actually &lt;em&gt;uses&lt;/em&gt; it effectively.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Kit
&lt;/h2&gt;

&lt;p&gt;I packaged everything into &lt;strong&gt;The AI Agent Workspace Kit&lt;/strong&gt; — the exact files I use, with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pre-built templates for all 5 core files&lt;/li&gt;
&lt;li&gt;A daily log format that agents love (structured but scannable)&lt;/li&gt;
&lt;li&gt;Project tracking templates&lt;/li&gt;
&lt;li&gt;Memory consolidation guidelines (how to move daily logs → long-term memory)&lt;/li&gt;
&lt;li&gt;A &lt;code&gt;create-ai-agent&lt;/code&gt; CLI that scaffolds the whole thing in one command&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://webbywisp.gumroad.com/l/ejqpns" rel="noopener noreferrer"&gt;Get the kit → webbywisp.gumroad.com/l/ejqpns&lt;/a&gt;&lt;/strong&gt; ($19)&lt;/p&gt;

&lt;p&gt;Or try the free CLI first:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx @webbywisp/create-ai-agent my-agent
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






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

&lt;p&gt;I built this system because I needed it. My agent — Sage — has been running on it for a week.&lt;/p&gt;

&lt;p&gt;What Sage remembers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;My name, timezone, and communication preferences&lt;/li&gt;
&lt;li&gt;Every project we've worked on and its current status&lt;/li&gt;
&lt;li&gt;Decisions we've made and why&lt;/li&gt;
&lt;li&gt;Lessons from mistakes (so they don't repeat)&lt;/li&gt;
&lt;li&gt;Open action items&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All from markdown files. No database required.&lt;/p&gt;




&lt;p&gt;If you're building agents and tired of them forgetting everything, this is the system that fixed it for me.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://webbywisp.gumroad.com/l/ejqpns" rel="noopener noreferrer"&gt;The AI Agent Workspace Kit — $19&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Questions? Drop them in the comments.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>productivity</category>
      <category>programming</category>
    </item>
    <item>
      <title>7 Claude Prompting Patterns That Actually Changed How I Work</title>
      <dc:creator>Webby Wisp</dc:creator>
      <pubDate>Sat, 21 Mar 2026 18:13:10 +0000</pubDate>
      <link>https://dev.to/webbywisp/7-claude-prompting-patterns-that-actually-changed-how-i-work-10pb</link>
      <guid>https://dev.to/webbywisp/7-claude-prompting-patterns-that-actually-changed-how-i-work-10pb</guid>
      <description>&lt;p&gt;I've been using Claude as a daily driver for 6 months. Here are the prompts and patterns that actually changed how I work — not the generic "be specific" advice you've read everywhere.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. The Role + Context Front-Load
&lt;/h2&gt;

&lt;p&gt;Most people start prompts with the task. Start with who the AI is and what it knows instead.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Generic:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Write a sales email for my SaaS product."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Better:&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;You are the head of growth at a B2B SaaS company. 
Product: AI agent workspace scaffolding tool, $19, targets developers building autonomous agents.
Audience: developers who've tried building agents and hit the "no memory/no structure" wall.
Goal: convert a warm lead who read our Dev.to article.

Write a sales email.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The output is completely different. Not because you used magic words — because you gave it real context.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. The Constraint Frame
&lt;/h2&gt;

&lt;p&gt;LLMs default to comprehensive. You often want focused.&lt;/p&gt;

&lt;p&gt;Add one of these to almost any prompt:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"In under 200 words"&lt;/li&gt;
&lt;li&gt;"No more than 5 bullet points"&lt;/li&gt;
&lt;li&gt;"One sentence per idea"&lt;/li&gt;
&lt;li&gt;"Skip the intro, start with the answer"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These constraints force the model to prioritize, which usually produces better output than asking it to "be concise."&lt;/p&gt;

&lt;h2&gt;
  
  
  3. The Reasoning Separator
&lt;/h2&gt;

&lt;p&gt;For complex tasks, ask for reasoning separately from output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;First, briefly explain your approach (2-3 sentences).
Then produce the output.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This does two things: it catches bad reasoning before it produces bad output, and it makes the model commit to an approach before executing it.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. The Negative Space Prompt
&lt;/h2&gt;

&lt;p&gt;Tell it what NOT to do as explicitly as what TO do:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;Write a technical blog post about MCP servers.
&lt;span class="p"&gt;-&lt;/span&gt; Do NOT start with "In today's rapidly evolving..."
&lt;span class="p"&gt;-&lt;/span&gt; Do NOT use the word "leverage"  
&lt;span class="p"&gt;-&lt;/span&gt; Do NOT include a section about "the future of AI"
&lt;span class="p"&gt;-&lt;/span&gt; Keep each section under 150 words
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;LLMs have strong priors toward generic patterns. Explicitly blocking them is often more effective than asking for originality.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. The Iteration Checkpoint
&lt;/h2&gt;

&lt;p&gt;For long outputs, build in checkpoints:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;I need a comprehensive guide on X. 

Before writing the full guide, give me:
1. The outline (headers only)
2. Your planned approach for each section (one sentence each)

I'll approve or adjust before you write the full thing.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This saves tokens and catches misalignment before you're 2000 words into the wrong direction.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. The Perspective Shift
&lt;/h2&gt;

&lt;p&gt;When you're stuck on a problem, ask the model to approach it from a specific angle:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;I'm building [X]. I've been thinking about it as [your current frame].

Approach this as a skeptic who thinks this is a bad idea. What's the strongest argument against it? What am I missing?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The adversarial frame surfaces blind spots that agreeable AI assistants will never volunteer.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. The Structured Output Request
&lt;/h2&gt;

&lt;p&gt;When you need to process the output programmatically, specify the structure explicitly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="err"&gt;Return&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;your&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;answer&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;as&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;JSON&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;object&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;with&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;these&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;fields:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="err"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;title:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;string&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="err"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;summary:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;string&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;(max&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;words)&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="err"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;tags:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3-5&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;items)&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="err"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;confidence:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"high"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"medium"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"low"&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="err"&gt;No&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;other&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;text.&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;Just&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;the&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;JSON.&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;LLMs can reliably produce structured output when you're explicit about the schema.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Meta-Pattern
&lt;/h2&gt;

&lt;p&gt;All of these share a common thread: &lt;strong&gt;you're doing the thinking, the AI is doing the execution&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The prompts that work best treat the model as a skilled executor that needs clear direction — not a magic oracle that figures out what you mean.&lt;/p&gt;

&lt;h2&gt;
  
  
  Apply This to Agent Workflows
&lt;/h2&gt;

&lt;p&gt;These patterns work in single prompts, but they really shine when you bake them into an agent's context files:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# SOUL.md&lt;/span&gt;
You are Sage, chief operator.
&lt;span class="p"&gt;-&lt;/span&gt; Never start responses with "Certainly!" or "Of course!"
&lt;span class="p"&gt;-&lt;/span&gt; Skip intros — start with the answer
&lt;span class="p"&gt;-&lt;/span&gt; Use bullet points over paragraphs for lists
&lt;span class="p"&gt;-&lt;/span&gt; Flag uncertainty explicitly
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The agent follows these patterns in every interaction, not just when you remember to include them.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx @webbywisp/create-ai-agent my-workspace
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Scaffolds the full context file structure. Free.&lt;/p&gt;




&lt;p&gt;Pre-written SOUL.md, USER.md, OPS.md, MEMORY.md templates tuned for autonomous operation — $19: &lt;a href="https://webbywisp.gumroad.com/l/ejqpns" rel="noopener noreferrer"&gt;AI Agent Workspace Kit&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>productivity</category>
      <category>programming</category>
      <category>claude</category>
    </item>
    <item>
      <title>A Minimal AI Agent in 50 Lines of Python (No Framework Required)</title>
      <dc:creator>Webby Wisp</dc:creator>
      <pubDate>Sat, 21 Mar 2026 17:12:49 +0000</pubDate>
      <link>https://dev.to/webbywisp/a-minimal-ai-agent-in-50-lines-of-python-no-framework-required-1dff</link>
      <guid>https://dev.to/webbywisp/a-minimal-ai-agent-in-50-lines-of-python-no-framework-required-1dff</guid>
      <description>&lt;p&gt;You don't need LangChain to build a useful AI agent.&lt;/p&gt;

&lt;p&gt;Here's a minimal agent in ~50 lines of Python that has memory, a defined persona, and can use tools — no framework required.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Core Loop
&lt;/h2&gt;

&lt;p&gt;Every agent is just a loop:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Read context (who am I, what do I know)&lt;/li&gt;
&lt;li&gt;Get input (heartbeat, user message, scheduled trigger)&lt;/li&gt;
&lt;li&gt;Decide what to do&lt;/li&gt;
&lt;li&gt;Act&lt;/li&gt;
&lt;li&gt;Update memory&lt;/li&gt;
&lt;li&gt;Repeat&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That's it. Frameworks add abstractions on top. Sometimes that's useful. Often it's not.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Minimal Implementation
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;anthropic&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;pathlib&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Path&lt;/span&gt;

&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;anthropic&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Anthropic&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;read_context&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Load agent context from workspace files.&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="n"&gt;ctx&lt;/span&gt; &lt;span class="o"&gt;=&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;fname&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;SOUL.md&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;USER.md&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;MEMORY.md&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;OPS.md&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;
        &lt;span class="n"&gt;path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fname&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;exists&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
            &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&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;## &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;fname&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read_text&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n\n&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ctx&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;update_memory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Append a fact to today&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;s daily log.&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;date&lt;/span&gt;
    &lt;span class="n"&gt;log_path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Path&lt;/span&gt;&lt;span class="p"&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;memory/&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;today&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;.md&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;log_path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;parent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;mkdir&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;exist_ok&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;log_path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;a&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;- &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&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;run_agent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user_input&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="n"&gt;context&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;read_context&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;claude-3-5-haiku-20241022&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;max_tokens&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1024&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;system&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;role&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;user_input&lt;/span&gt;&lt;span class="p"&gt;}]&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;reply&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;

    &lt;span class="c1"&gt;# Log the interaction
&lt;/span&gt;    &lt;span class="nf"&gt;update_memory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;interaction&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&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;User: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;user_input&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="si"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;... Agent: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;reply&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="si"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;]&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="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;reply&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;__main__&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;user_input&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;You: &lt;/span&gt;&lt;span class="sh"&gt;"&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;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;user_input&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;continue&lt;/span&gt;
        &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;run_agent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user_input&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&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;Agent: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What Makes This Work
&lt;/h2&gt;

&lt;p&gt;The agent's behavior comes entirely from the workspace files it reads:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SOUL.md&lt;/strong&gt; — defines who the agent is. Change this file, change the personality.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;MEMORY.md&lt;/strong&gt; — the agent's long-term memory. Persists across restarts. Gets smarter over time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;USER.md&lt;/strong&gt; — context about who the agent is serving. Tone and recommendations calibrate to this.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;OPS.md&lt;/strong&gt; — operating rules. What it can do autonomously, what requires approval.&lt;/p&gt;

&lt;p&gt;No hardcoded prompts. No framework magic. Just files.&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding Tools
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;subprocess&lt;/span&gt;

&lt;span class="n"&gt;TOOLS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;read_file&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;read_text&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;run_command&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="n"&gt;cmd&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;subprocess&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cmd&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;shell&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;capture_output&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="n"&gt;stdout&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;search_web&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;search&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;  &lt;span class="c1"&gt;# your search implementation
&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;run_with_tools&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user_input&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="c1"&gt;# Add tools to system context
&lt;/span&gt;    &lt;span class="n"&gt;tool_docs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&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;- &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;: use for &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;_&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt; &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;TOOLS&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;

    &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;claude-3-5-haiku-20241022&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;max_tokens&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1024&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;system&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nf"&gt;read_context&lt;/span&gt;&lt;span class="p"&gt;()&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="se"&gt;\n\n&lt;/span&gt;&lt;span class="s"&gt;## Available Tools&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;tool_docs&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;role&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;user_input&lt;/span&gt;&lt;span class="p"&gt;}]&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;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  When to Add a Framework
&lt;/h2&gt;

&lt;p&gt;Frameworks make sense when you need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Complex multi-agent orchestration&lt;/li&gt;
&lt;li&gt;Built-in RAG pipelines&lt;/li&gt;
&lt;li&gt;Visual workflow builders&lt;/li&gt;
&lt;li&gt;Enterprise integrations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For a single agent that reads files, uses a few tools, and maintains memory? This is enough.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Workspace Structure
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx @webbywisp/create-ai-agent my-workspace
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Scaffolds SOUL.md, USER.md, MEMORY.md, OPS.md, HEARTBEAT.md, and the memory/ directory. Drop in the Python above and you have a working agent.&lt;/p&gt;




&lt;p&gt;Pre-written templates for all the context files — $19: &lt;a href="https://webbywisp.gumroad.com/l/ejqpns" rel="noopener noreferrer"&gt;AI Agent Workspace Kit&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>agents</category>
      <category>programming</category>
    </item>
    <item>
      <title>5 Ways AI Agents Fail (And the File Structure That Prevents Them)</title>
      <dc:creator>Webby Wisp</dc:creator>
      <pubDate>Sat, 21 Mar 2026 16:13:20 +0000</pubDate>
      <link>https://dev.to/webbywisp/5-ways-ai-agents-fail-and-the-file-structure-that-prevents-them-4lo</link>
      <guid>https://dev.to/webbywisp/5-ways-ai-agents-fail-and-the-file-structure-that-prevents-them-4lo</guid>
      <description>&lt;p&gt;AI agents fail in predictable ways. After running one autonomously for weeks, here are the failure modes I hit most often — and how the workspace structure prevents them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Failure Mode 1: The Amnesiac Agent
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Symptom:&lt;/strong&gt; Agent gives inconsistent answers. Contradicts itself. Asks for info it already has. Can't reference past decisions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Root cause:&lt;/strong&gt; No persistent memory. Every session starts cold.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; MEMORY.md + daily notes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# MEMORY.md&lt;/span&gt;
&lt;span class="gu"&gt;## Active Projects&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; Workspace Kit: live on Gumroad ($19)
&lt;span class="p"&gt;-&lt;/span&gt; create-mcp-server: npm published

&lt;span class="gu"&gt;## Key Decisions&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; 2026-03-16: Move fast. Kill failures quickly.

&lt;span class="gu"&gt;## Lessons Learned&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; File-based memory beats vector DBs for most use cases
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Read at session start. Updated during heartbeats. The agent builds up a working model of your world over time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Failure Mode 2: The Impersonator
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Symptom:&lt;/strong&gt; Agent's tone shifts randomly. Sometimes formal, sometimes casual. Sometimes says "I" sometimes says "As an AI...". Doesn't feel like a consistent entity.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Root cause:&lt;/strong&gt; No identity definition. The model defaults to generic assistant mode.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; SOUL.md loaded at session start.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# SOUL.md&lt;/span&gt;
I'm Sage — chief operator of an AI org.
&lt;span class="p"&gt;-&lt;/span&gt; Sharp and efficient. No filler.
&lt;span class="p"&gt;-&lt;/span&gt; Proactive. Don't wait to be asked.
&lt;span class="p"&gt;-&lt;/span&gt; Honest about tradeoffs.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Consistent persona. Every session.&lt;/p&gt;

&lt;h2&gt;
  
  
  Failure Mode 3: The Context-Blind Agent
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Symptom:&lt;/strong&gt; Agent makes suggestions that don't fit your situation. Recommends tools you don't use. Misses obvious preferences. Treats you like a stranger.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Root cause:&lt;/strong&gt; No user model.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; USER.md.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# USER.md&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; Name: Wisp
&lt;span class="p"&gt;-&lt;/span&gt; Timezone: CET
&lt;span class="p"&gt;-&lt;/span&gt; Communication: direct, no fluff
&lt;span class="p"&gt;-&lt;/span&gt; Peak hours: morning (CET)
&lt;span class="p"&gt;-&lt;/span&gt; Background: software dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now the agent knows who it's talking to. Recommendations calibrate to your context, not a generic user.&lt;/p&gt;

&lt;h2&gt;
  
  
  Failure Mode 4: The Frozen Agent
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Symptom:&lt;/strong&gt; Agent only responds to direct requests. Never initiates. Never catches problems proactively. Needs constant prompting.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Root cause:&lt;/strong&gt; Purely reactive loop. No proactive behavior.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; HEARTBEAT.md + periodic triggers.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# HEARTBEAT.md&lt;/span&gt;
When idle: find one revenue-moving task. Execute. Report.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every 30 minutes, the agent wakes up and does something useful. No prompting required.&lt;/p&gt;

&lt;h2&gt;
  
  
  Failure Mode 5: The Feral Agent
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Symptom:&lt;/strong&gt; Agent takes actions it shouldn't. Sends emails without asking. Makes external API calls. Modifies files it shouldn't touch. Acts outside its scope.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Root cause:&lt;/strong&gt; No operating boundaries defined.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; OPS.md with explicit rules.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# OPS.md&lt;/span&gt;
&lt;span class="gu"&gt;## Ask First&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; Sending emails, tweets, public posts
&lt;span class="p"&gt;-&lt;/span&gt; Anything that leaves the machine
&lt;span class="p"&gt;-&lt;/span&gt; Anything irreversible

&lt;span class="gu"&gt;## Do Freely&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; Read files, search, organize
&lt;span class="p"&gt;-&lt;/span&gt; Work within the workspace
&lt;span class="p"&gt;-&lt;/span&gt; Update memory and logs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Clear scope. Clear escalation rules. The agent knows where the line is.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Pattern
&lt;/h2&gt;

&lt;p&gt;Every failure mode has the same root cause: the agent lacks structured context.&lt;/p&gt;

&lt;p&gt;The fix isn't a better model or more complex prompts. It's a workspace structure that loads the right context at session start:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;SOUL.md → who it is
USER.md → who it's serving
MEMORY.md → what it knows
OPS.md → how it operates
HEARTBEAT.md → what to check proactively
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Five files. Loaded at startup. Most failure modes prevented before they start.&lt;/p&gt;

&lt;h2&gt;
  
  
  Get the Structure
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx @webbywisp/create-ai-agent my-workspace
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Scaffolds the full directory with starter templates. Free.&lt;/p&gt;




&lt;p&gt;Pre-written, production-ready templates for all five files — $19: &lt;a href="https://webbywisp.gumroad.com/l/ejqpns" rel="noopener noreferrer"&gt;AI Agent Workspace Kit&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>productivity</category>
      <category>programming</category>
    </item>
    <item>
      <title>The Heartbeat Pattern: How I Keep AI Agents Productive Without Babysitting Them</title>
      <dc:creator>Webby Wisp</dc:creator>
      <pubDate>Sat, 21 Mar 2026 15:12:48 +0000</pubDate>
      <link>https://dev.to/webbywisp/the-heartbeat-pattern-how-i-keep-ai-agents-productive-without-babysitting-them-2mlh</link>
      <guid>https://dev.to/webbywisp/the-heartbeat-pattern-how-i-keep-ai-agents-productive-without-babysitting-them-2mlh</guid>
      <description>&lt;p&gt;Most AI agents are reactive. You ask, they answer. Session ends, they forget.&lt;/p&gt;

&lt;p&gt;The heartbeat pattern flips this. Your agent wakes up on a schedule, checks what needs doing, and acts — without being asked.&lt;/p&gt;

&lt;p&gt;Here's how it works.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Core Idea
&lt;/h2&gt;

&lt;p&gt;A heartbeat is a periodic trigger that fires every N minutes. When it fires, the agent reads a file called HEARTBEAT.md and follows whatever instructions are in it.&lt;/p&gt;

&lt;p&gt;Simple HEARTBEAT.md:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# HEARTBEAT.md&lt;/span&gt;
When idle: find one task that moves closer to revenue. Execute it. Report results.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it. Every 30 minutes, the agent wakes up, reads this, finds something useful to do, and does it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Gets Checked
&lt;/h2&gt;

&lt;p&gt;Here's a more detailed heartbeat checklist:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# HEARTBEAT.md&lt;/span&gt;

&lt;span class="gu"&gt;## Periodic Checks (rotate 2-4x per day)&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; Email: any urgent unread messages?
&lt;span class="p"&gt;-&lt;/span&gt; Calendar: events in next 24-48h?
&lt;span class="p"&gt;-&lt;/span&gt; Projects: anything blocked or overdue?
&lt;span class="p"&gt;-&lt;/span&gt; Content: anything ready to publish?

&lt;span class="gu"&gt;## Revenue Tasks&lt;/span&gt;
When nothing urgent: find one revenue-moving task.
Examples:
&lt;span class="p"&gt;-&lt;/span&gt; Publish pending article
&lt;span class="p"&gt;-&lt;/span&gt; Post to Reddit
&lt;span class="p"&gt;-&lt;/span&gt; Update sales copy
&lt;span class="p"&gt;-&lt;/span&gt; Follow up on inquiries
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The agent rotates through these, tracks what it last checked, and only acts when something actually needs attention.&lt;/p&gt;

&lt;h2&gt;
  
  
  The State File
&lt;/h2&gt;

&lt;p&gt;To avoid re-checking things constantly, the agent maintains a state file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"lastChecks"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"email"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1711015200&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"calendar"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1711008000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"projects"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1711018800&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Before checking email, it looks at &lt;code&gt;lastChecks.email&lt;/code&gt;. If it was less than 2 hours ago, skip it. This prevents the agent from hammering APIs on every heartbeat.&lt;/p&gt;

&lt;h2&gt;
  
  
  When to Stay Silent
&lt;/h2&gt;

&lt;p&gt;A well-configured heartbeat agent does not interrupt constantly. Rules:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Late night (23:00-08:00): silent unless urgent&lt;/li&gt;
&lt;li&gt;Nothing new since last check: HEARTBEAT_OK&lt;/li&gt;
&lt;li&gt;Just checked &amp;lt; 30 minutes ago: HEARTBEAT_OK&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The goal is proactive, not annoying.&lt;/p&gt;

&lt;h2&gt;
  
  
  When to Act
&lt;/h2&gt;

&lt;p&gt;The agent speaks up when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Important email arrived&lt;/li&gt;
&lt;li&gt;Calendar event &amp;lt; 2 hours away&lt;/li&gt;
&lt;li&gt;Project is blocked&lt;/li&gt;
&lt;li&gt;A task is ready to ship&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Otherwise, it does quiet background work — organizing files, updating memory, running checks — and stays out of the way.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Implementation Pattern
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;on_heartbeat&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="n"&gt;instructions&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;read_file&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;HEARTBEAT.md&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;state&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;read_json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;memory/heartbeat-state.json&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# Check what needs attention
&lt;/span&gt;    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;check&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;get_due_checks&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;run_check&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;check&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;needs_attention&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="nf"&gt;notify_user&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt;

    &lt;span class="c1"&gt;# Nothing urgent — do background work
&lt;/span&gt;    &lt;span class="nf"&gt;do_background_task&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;instructions&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;update_state&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Why This Beats Cron Jobs
&lt;/h2&gt;

&lt;p&gt;Cron jobs run code. Heartbeats run &lt;em&gt;judgment&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;A cron job that checks email sends you every email. A heartbeat agent checks email, reads it, decides if it matters, and only interrupts you for the ones that do.&lt;/p&gt;

&lt;p&gt;The intelligence is in the loop, not the schedule.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting the Structure
&lt;/h2&gt;

&lt;p&gt;The HEARTBEAT.md pattern is part of the AI Agent Workspace Kit:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx @webbywisp/create-ai-agent my-workspace
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Scaffolds HEARTBEAT.md, MEMORY.md, SOUL.md, and the full directory structure. Free.&lt;/p&gt;




&lt;p&gt;The complete kit with pre-written templates, heartbeat state tracking, and project memory — $19: &lt;a href="https://webbywisp.gumroad.com/l/ejqpns" rel="noopener noreferrer"&gt;AI Agent Workspace Kit&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>productivity</category>
      <category>programming</category>
    </item>
    <item>
      <title>Build an MCP Server in 10 Minutes (No Boilerplate)</title>
      <dc:creator>Webby Wisp</dc:creator>
      <pubDate>Sat, 21 Mar 2026 14:12:47 +0000</pubDate>
      <link>https://dev.to/webbywisp/build-an-mcp-server-in-10-minutes-no-boilerplate-2ee1</link>
      <guid>https://dev.to/webbywisp/build-an-mcp-server-in-10-minutes-no-boilerplate-2ee1</guid>
      <description>&lt;p&gt;MCP (Model Context Protocol) servers are having a moment. Every major AI tool is adding support. And building one is surprisingly fast.&lt;/p&gt;

&lt;p&gt;Here's how to go from zero to a working MCP server in under 10 minutes.&lt;/p&gt;

&lt;h2&gt;
  
  
  What You're Building
&lt;/h2&gt;

&lt;p&gt;An MCP server is a lightweight service that exposes tools, resources, or prompts to AI models. Instead of the AI guessing how to do something, you give it explicit, typed interfaces.&lt;/p&gt;

&lt;p&gt;Example: instead of an AI trying to figure out how to read files, you give it a &lt;code&gt;read_file&lt;/code&gt; tool with a defined schema. Reliable, auditable, composable.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Fast Path
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx @webbywisp/create-mcp-server my-server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Interactive wizard. Asks you three questions. Generates a complete TypeScript MCP server.&lt;/p&gt;

&lt;p&gt;Three templates to choose from:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;tool-server&lt;/strong&gt; — exposes callable functions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;server&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;tool&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;read_file&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;z&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;string&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;path&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;content&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;readFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;utf-8&lt;/span&gt;&lt;span class="dl"&gt;"&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="na"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;content&lt;/span&gt; &lt;span class="p"&gt;}]&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;resource-server&lt;/strong&gt; — exposes addressable data:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;server&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;resource&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;config://app&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Application config&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;uri&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&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="na"&gt;contents&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt; &lt;span class="na"&gt;uri&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;uri&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;href&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;}]&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;prompt-server&lt;/strong&gt; — structured prompt templates:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;server&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;code-review&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;code&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;z&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;string&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;code&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt; &lt;span class="na"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;user&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`Review this code:
&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}]&lt;/span&gt;
&lt;span class="p"&gt;}));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What Gets Generated
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;my-server/
├── src/
│   └── index.ts      # Your server (edit this)
├── package.json
├── tsconfig.json
└── README.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run it:&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="nb"&gt;cd &lt;/span&gt;my-server
npm &lt;span class="nb"&gt;install
&lt;/span&gt;npm run build
npm start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it. Working MCP server.&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding More Tools
&lt;/h2&gt;

&lt;p&gt;v0.2.0 added an &lt;code&gt;add&lt;/code&gt; subcommand:&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;# Add a tool to an existing server&lt;/span&gt;
npx @webbywisp/create-mcp-server add tool &lt;span class="nt"&gt;--name&lt;/span&gt; fetch_url &lt;span class="nt"&gt;--server&lt;/span&gt; ./my-server

&lt;span class="c"&gt;# Add a resource&lt;/span&gt;
npx @webbywisp/create-mcp-server add resource &lt;span class="nt"&gt;--name&lt;/span&gt; app_config &lt;span class="nt"&gt;--server&lt;/span&gt; ./my-server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No manual boilerplate. Just run the command and fill in the logic.&lt;/p&gt;

&lt;h2&gt;
  
  
  When to Use Each Template
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;tool-server&lt;/strong&gt; — when the AI needs to &lt;em&gt;do&lt;/em&gt; something: execute code, call APIs, write files, send messages.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;resource-server&lt;/strong&gt; — when the AI needs to &lt;em&gt;read&lt;/em&gt; something: config files, database queries, API responses as data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;prompt-server&lt;/strong&gt; — when you want to standardize how the AI approaches a task: code review, debugging, documentation generation.&lt;/p&gt;

&lt;p&gt;Most real servers end up mixing all three.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Bigger Picture
&lt;/h2&gt;

&lt;p&gt;MCP servers are how you give AI agents reliable, typed access to your systems. Instead of hoping the AI can figure out your API from documentation, you give it a proper interface.&lt;/p&gt;

&lt;p&gt;The pattern: build small, focused servers. One server per domain (files, HTTP, database, messaging). Compose them in your agent config.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx @webbywisp/create-mcp-server my-server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Free CLI, open source, TypeScript. Get the scaffold in seconds.&lt;/p&gt;

&lt;p&gt;If you want pre-built templates for auth patterns, webhook handling, database integrations, and deployment configs — that's in &lt;strong&gt;&lt;a href="https://webbywisp.gumroad.com/l/ecpkox" rel="noopener noreferrer"&gt;The MCP Server Starter Kit&lt;/a&gt;&lt;/strong&gt; ($19). Real implementations you can adapt instead of starting from scratch.&lt;/p&gt;

&lt;p&gt;Or stay with the free CLI — either way, you're building on a solid foundation.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>typescript</category>
      <category>programming</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Stop Using .env Files for AI Agent Config (Do This Instead)</title>
      <dc:creator>Webby Wisp</dc:creator>
      <pubDate>Sat, 21 Mar 2026 13:13:13 +0000</pubDate>
      <link>https://dev.to/webbywisp/stop-using-env-files-for-ai-agent-config-do-this-instead-1oi9</link>
      <guid>https://dev.to/webbywisp/stop-using-env-files-for-ai-agent-config-do-this-instead-1oi9</guid>
      <description>&lt;p&gt;Every AI agent tutorial starts the same way: "Create a .env file with your API keys."&lt;/p&gt;

&lt;p&gt;It works. But it doesn't scale. And it misses something important.&lt;/p&gt;

&lt;p&gt;Config isn't just credentials. It's context.&lt;/p&gt;

&lt;h2&gt;
  
  
  What .env Gets Right (and Wrong)
&lt;/h2&gt;

&lt;p&gt;.env files are great for secrets. API keys, tokens, passwords.&lt;/p&gt;

&lt;p&gt;But when you're building an AI agent, you also need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Who it is (role, values, tone)&lt;/li&gt;
&lt;li&gt;Who it's serving (preferences, timezone, style)&lt;/li&gt;
&lt;li&gt;What it's working on (active projects, recent decisions)&lt;/li&gt;
&lt;li&gt;How it should operate (rules, escalation paths)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of that fits in .env.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Better Approach: Structured Context Files
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;workspace/
├── .env              # Secrets only
├── SOUL.md           # Identity and values
├── USER.md           # Who the agent serves
├── MEMORY.md         # Long-term memory
├── OPS.md            # Operating procedures
└── HEARTBEAT.md      # Proactive task list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What Each File Does
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;SOUL.md&lt;/strong&gt; — identity:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;I'm Sage, chief operator of an AI org.
&lt;span class="p"&gt;-&lt;/span&gt; Proactive over reactive
&lt;span class="p"&gt;-&lt;/span&gt; Sharp and efficient
&lt;span class="p"&gt;-&lt;/span&gt; Ask before external actions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;USER.md&lt;/strong&gt; — user context:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="p"&gt;-&lt;/span&gt; Name: Wisp
&lt;span class="p"&gt;-&lt;/span&gt; Timezone: CET
&lt;span class="p"&gt;-&lt;/span&gt; Communication: direct, no fluff
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;MEMORY.md&lt;/strong&gt; — persistent state:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;## Active Projects&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; Workspace Kit: live on Gumroad ($19)

&lt;span class="gu"&gt;## Lessons Learned&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; File-based memory beats vector DBs for most use cases
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;HEARTBEAT.md&lt;/strong&gt; — proactive agenda:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;When idle: find one revenue-moving task. Execute. Report.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Why This Works Better
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Human-readable.&lt;/strong&gt; Open any file and understand the agent state instantly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Git-friendly.&lt;/strong&gt; Every change is a commit. Full history of how your agent evolved.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Separates concerns.&lt;/strong&gt; Secrets in .env. Context in markdown. Agent reads both at startup.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Composable.&lt;/strong&gt; Add TOOLS.md for notes. Add memory/projects/_index.md for project state. Grows with your needs.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Session Startup Pattern
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Works with any agent framework
&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;read_file&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;SOUL.md&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;      &lt;span class="c1"&gt;# Who am I?
&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;read_file&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;USER.md&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;       &lt;span class="c1"&gt;# Who am I serving?
&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;read_file&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;MEMORY.md&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;     &lt;span class="c1"&gt;# What do I remember?
&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;read_file&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;OPS.md&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;        &lt;span class="c1"&gt;# How do I operate?
&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;read_file&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;HEARTBEAT.md&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;  &lt;span class="c1"&gt;# What should I check?
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Five file reads. ~2,000 tokens. Fully oriented agent.&lt;/p&gt;

&lt;p&gt;Compare to cold start: "You are a helpful assistant."&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx @webbywisp/create-ai-agent my-workspace
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Scaffolds the full structure with starter templates. Free.&lt;/p&gt;




&lt;p&gt;Pre-written templates optimized for autonomous operation — $19: &lt;a href="https://webbywisp.gumroad.com/l/ejqpns" rel="noopener noreferrer"&gt;AI Agent Workspace Kit&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>productivity</category>
      <category>programming</category>
    </item>
    <item>
      <title>How I Shipped a $19 AI Product in 48 Hours Using an Agent to Build It</title>
      <dc:creator>Webby Wisp</dc:creator>
      <pubDate>Sat, 21 Mar 2026 12:12:59 +0000</pubDate>
      <link>https://dev.to/webbywisp/how-i-shipped-a-19-ai-product-in-48-hours-using-an-agent-to-build-it-2pdc</link>
      <guid>https://dev.to/webbywisp/how-i-shipped-a-19-ai-product-in-48-hours-using-an-agent-to-build-it-2pdc</guid>
      <description>&lt;p&gt;Two days ago I had an idea. Today it's live on Gumroad and has had its first sales.&lt;/p&gt;

&lt;p&gt;Here's the honest breakdown of how it happened — and the part that surprised me.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Idea
&lt;/h2&gt;

&lt;p&gt;I've been running an AI agent as my daily operator for a few months. It manages projects, writes content, tracks memory, runs autonomously. The workspace structure I built for it is the thing that makes it actually work.&lt;/p&gt;

&lt;p&gt;I thought: other people building AI agents probably want this structure too. So I packaged it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The product:&lt;/strong&gt; A structured workspace kit for AI agents — SOUL.md, USER.md, MEMORY.md, OPS.md, HEARTBEAT.md templates, plus a project tracking system and 30-day memory structure.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The price:&lt;/strong&gt; $19.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Time to ship:&lt;/strong&gt; 48 hours.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the Agent Did
&lt;/h2&gt;

&lt;p&gt;This is the part worth talking about.&lt;/p&gt;

&lt;p&gt;I didn't build the product manually. I described what I wanted, and the agent:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Wrote all the template files&lt;/strong&gt; — every SOUL.md, USER.md, MEMORY.md, OPS.md, and HEARTBEAT.md template in the kit&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Packaged it&lt;/strong&gt; — created the zip, organized the directory structure&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Wrote the sales copy&lt;/strong&gt; — Gumroad listing description, feature bullets, FAQ&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Published two Dev.to articles&lt;/strong&gt; to seed organic traffic before launch&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Built a free CLI&lt;/strong&gt; (&lt;code&gt;npx @webbywisp/create-ai-agent&lt;/code&gt;) as a top-of-funnel credibility asset&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I made decisions. The agent executed.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Workflow
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Day 1 Morning:
- Decided on the product concept
- Agent wrote template files
- Agent created the zip package
- Agent wrote Gumroad copy

Day 1 Afternoon:
- Listed on Gumroad (I did this part — 10 minutes)
- Agent published first Dev.to article

Day 2:
- Agent published more articles
- Agent built and published the free CLI to npm
- First sales came in
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The only things I did personally: make product decisions, list it on Gumroad, and read the reports.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Made This Possible
&lt;/h2&gt;

&lt;p&gt;The agent works autonomously because of the workspace structure it lives in:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;HEARTBEAT.md&lt;/strong&gt; — instead of waiting to be asked, it checks this file on idle cycles:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;When idle: find one task that moves closer to revenue. Execute it. Report results.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;MEMORY.md&lt;/strong&gt; — it remembers the project state across sessions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;## Active Projects&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; agent-workspace-kit: LIVE on Gumroad ($19)
&lt;span class="p"&gt;-&lt;/span&gt; Next steps: content series, Product Hunt launch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;OPS.md&lt;/strong&gt; — it knows how to operate:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;## My Role&lt;/span&gt;
CEO and chief operator. I set strategy, make decisions, orchestrate sub-agents.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Without this structure, the agent is just a chatbot that forgets everything. With it, it's closer to an employee.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Numbers (48h In)
&lt;/h2&gt;

&lt;p&gt;I'm not going to fake a big revenue reveal. It's early. But the infrastructure is live:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Product on Gumroad&lt;/li&gt;
&lt;li&gt;Free CLI on npm&lt;/li&gt;
&lt;li&gt;Dev.to content series driving organic traffic&lt;/li&gt;
&lt;li&gt;Reddit posts queued&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The goal was to ship fast and learn. That part worked.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's Replicable Here
&lt;/h2&gt;

&lt;p&gt;If you're building anything in the AI/agent space, the pattern is:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Give the agent a job description&lt;/strong&gt; (SOUL.md) — define what it is and what it values&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Give it memory&lt;/strong&gt; (MEMORY.md + daily notes) — so it knows the current state&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Give it a heartbeat&lt;/strong&gt; (HEARTBEAT.md) — proactive tasks it runs autonomously&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Get out of the way&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The agent builds. You make decisions.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Free Version
&lt;/h2&gt;

&lt;p&gt;If you want to set this up yourself:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx @webbywisp/create-ai-agent my-workspace
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Scaffolds the full structure with starter templates. Free, open.&lt;/p&gt;




&lt;p&gt;The complete kit — pre-written templates, 30-day memory system, project tracking — is $19: &lt;a href="https://webbywisp.gumroad.com/l/ejqpns" rel="noopener noreferrer"&gt;AI Agent Workspace Kit&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's the exact structure I used to build and ship this product.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>productivity</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
