<?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: Juan Bermudez Roldan</title>
    <description>The latest articles on DEV Community by Juan Bermudez Roldan (@juan_bermudezroldan_4f96).</description>
    <link>https://dev.to/juan_bermudezroldan_4f96</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%2F3860700%2Ffc6284c2-a640-42e4-b349-19f7a1e90918.jpg</url>
      <title>DEV Community: Juan Bermudez Roldan</title>
      <link>https://dev.to/juan_bermudezroldan_4f96</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/juan_bermudezroldan_4f96"/>
    <language>en</language>
    <item>
      <title>The 11 steps that run every time you press Enter in Claude Code</title>
      <dc:creator>Juan Bermudez Roldan</dc:creator>
      <pubDate>Sat, 04 Apr 2026 09:02:04 +0000</pubDate>
      <link>https://dev.to/juan_bermudezroldan_4f96/the-11-steps-that-run-every-time-you-press-enter-in-claude-code-ked</link>
      <guid>https://dev.to/juan_bermudezroldan_4f96/the-11-steps-that-run-every-time-you-press-enter-in-claude-code-ked</guid>
      <description>&lt;p&gt;Every time you press Enter in Claude Code, an 11-step loop kicks off. Not a simple request-response — a self-directed cycle that keeps running until the task is done.&lt;/p&gt;

&lt;p&gt;I spent a few weeks tracing through the source code and turned what I found into a free course. Here's the condensed version of that loop.&lt;/p&gt;

&lt;h2&gt;
  
  
  The 11 Steps
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Step 1 — Input.&lt;/strong&gt; You type a prompt. The terminal captures the keypress via a custom React renderer (yes, React in a terminal).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2 — Message.&lt;/strong&gt; Your text becomes a UserMessage object appended to the conversation history.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3 — Memory.&lt;/strong&gt; CLAUDE.md files from 4 levels (enterprise → user → project → subdirectory) are loaded and concatenated into the system prompt.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4 — System Prompt.&lt;/strong&gt; Tool definitions, environment info, and memory are merged into the full system prompt.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5 — API Call.&lt;/strong&gt; Messages + system prompt + tool definitions stream to the Anthropic API. Tokens come back in real time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 6 — Parse.&lt;/strong&gt; The response is split into content blocks: text, thinking, and tool_use.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 7 — Decision.&lt;/strong&gt; Does the response contain tool_use blocks? If yes → execute tools. If only text → done, return to user.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 8 — Execute.&lt;/strong&gt; Each tool is found in the registry, validated against its JSON Schema, permission-checked (allow/ask/deny), then executed. Read-only tools run in parallel; write tools run one at a time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 9 — Result.&lt;/strong&gt; Tool outputs are wrapped as UserMessage objects (the API requires strict user/assistant alternation).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 10 — Loop.&lt;/strong&gt; Updated history goes back to Claude. The loop continues until no more tool calls.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 11 — Render.&lt;/strong&gt; Final text streams to the terminal. The screen buffer diffs and redraws only changed cells.&lt;/p&gt;

&lt;h2&gt;
  
  
  What surprised me
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The agent loop itself is simple. The complexity lives in error recovery and retry logic (5 different retry strategies for different error types).&lt;/li&gt;
&lt;li&gt;There are 50+ tools, and read-only tools run concurrently while write tools get exclusive access.&lt;/li&gt;
&lt;li&gt;The source has ~8 unreleased features: a terminal companion pet (Buddy), persistent memory mode (Kairos), multi-agent teams, and more.&lt;/li&gt;
&lt;li&gt;Context compaction automatically summarizes old messages when the window fills up — there's a reactive safety net that catches prompt-too-long errors.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The full course
&lt;/h2&gt;

&lt;p&gt;I built a free interactive course that goes deep on each of these systems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;12 lessons covering all 8 architecture layers&lt;/li&gt;
&lt;li&gt;Animated video walkthroughs with narration&lt;/li&gt;
&lt;li&gt;Python code examples (not TypeScript — patterns you can reuse)&lt;/li&gt;
&lt;li&gt;Hands-on exercises and quizzes&lt;/li&gt;
&lt;li&gt;An interactive stepper that lets you click through all 11 steps&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://code.bluggie.com" rel="noopener noreferrer"&gt;code.bluggie.com&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Everything is free, no paywall. I'd love to hear what parts of Claude Code you'd want explained that I haven't covered yet.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Not affiliated with Anthropic. Built by reading the public source code.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>architecture</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
