<?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: Kirill Krainov</title>
    <description>The latest articles on DEV Community by Kirill Krainov (@zerocopy).</description>
    <link>https://dev.to/zerocopy</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%2F3545231%2Fd5d8d47f-06d1-4ad9-8968-35c7a2c61852.jpg</url>
      <title>DEV Community: Kirill Krainov</title>
      <link>https://dev.to/zerocopy</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/zerocopy"/>
    <language>en</language>
    <item>
      <title>Karpathy's Autoresearch: Improving Agentic Coding Skills</title>
      <dc:creator>Kirill Krainov</dc:creator>
      <pubDate>Wed, 25 Mar 2026 13:17:18 +0000</pubDate>
      <link>https://dev.to/zerocopy/karpathys-autoresearch-improving-agentic-coding-skills-3941</link>
      <guid>https://dev.to/zerocopy/karpathys-autoresearch-improving-agentic-coding-skills-3941</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Recently, Andrej Karpathy made his autoresearch workflow public: &lt;a href="https://github.com/karpathy/autoresearch" rel="noopener noreferrer"&gt;https://github.com/karpathy/autoresearch&lt;/a&gt;. The idea is to autonomously improve a model's training process based on experiment results. Using Claude Code, you run this loop for hours or days and end up with a better model. The whole flow is described in the program.md file as a skill: &lt;a href="https://github.com/karpathy/autoresearch/blob/master/program.md" rel="noopener noreferrer"&gt;https://github.com/karpathy/autoresearch/blob/master/program.md&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'm not training any LLMs for work or even as a hobby, but I do a lot of coding, now mostly with Claude Code. To generate high-quality code that consistently follows conventions and standards, I use multiple skills, memory files, sub-agents, hooks, etc., let's call it an agentic harness.&lt;/p&gt;

&lt;p&gt;However, I evaluate this harness rather naively, not based on experiments or metrics - let’s say, not scientifically. The usual approach has been: test best practices that feel useful -&amp;gt; if they work -&amp;gt; incorporate them into the workflow. Or, if issues are caught during human review -&amp;gt; fix the workflow.&lt;/p&gt;

&lt;p&gt;But I think I can borrow ideas from Karpathy’s autoresearch and adapt them to improve my agentic coding harness based on deterministic experiments.&lt;/p&gt;

&lt;p&gt;Let's design a coding skill auto-improvement loop.&lt;/p&gt;

&lt;h2&gt;
  
  
  Solution
&lt;/h2&gt;

&lt;p&gt;Assume we have a skill that implements a common workflow for daily coding:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;take a request/task -&amp;gt; explore -&amp;gt; plan -&amp;gt; execute -&amp;gt; review.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For simplicity, we exclude any interactive steps that require user input. Optimizing those would require a more complex experimental framework.&lt;/p&gt;

&lt;p&gt;The core of the autoresearch loop is an experiment that evaluates a new version (generation) based on its results. For that, we need deterministic experiments and stable metrics. This means outputs and measurements must be comparable across runs and generations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is the goal of this skill?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To determine the right steps and provide the right context to the coding agent so that the resulting code is predictable, follows standards, and passes human review.&lt;/p&gt;

&lt;p&gt;But code quality is not the only concern. We also want:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;High autonomy (minimal escalation to humans)&lt;/li&gt;
&lt;li&gt;Ability to run many tasks in parallel&lt;/li&gt;
&lt;li&gt;Minimal token usage&lt;/li&gt;
&lt;li&gt;Low execution time
﻿&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Evaluation Framework
&lt;/h2&gt;

&lt;p&gt;We define a collection of test cases for the skill:&lt;/p&gt;

&lt;p&gt;Request/Task -&amp;gt; Reference Code&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;Token usage (end-to-end and per step), or even cost in real money - also helps optimize model selection per step&lt;/li&gt;
&lt;li&gt;Execution time (end-to-end and per step)&lt;/li&gt;
&lt;li&gt;Number of tool calls (to reduce unnecessary permissions and overhead)&lt;/li&gt;
&lt;li&gt;Number of errors, self-corrections, or full aborts (when the agent cannot proceed without user input)&lt;/li&gt;
&lt;li&gt;Logs of issues, self-corrections, and fixes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the original autoresearch, a single metric (val_bpb) determines whether a version advances. &lt;br&gt;
For a coding skill, we need multiple key metrics:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Test cases passed&lt;/li&gt;
&lt;li&gt;Time&lt;/li&gt;
&lt;li&gt;Token usage&lt;/li&gt;
&lt;li&gt;Other metrics act as signals for future improvements.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For simplicity at the design stage, we use a binary score:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;0 → output code does not match the reference&lt;/li&gt;
&lt;li&gt;1 → output code matches the reference
Each test case gives 1 point if it passes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Additionally:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;+1 point if execution time improves vs. previous version&lt;/li&gt;
&lt;li&gt;+1 point if cost improves vs. previous version
&lt;strong&gt;Final score = sum of all points&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Decision rule:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If current_score &amp;gt; previous_score -&amp;gt; advance&lt;/li&gt;
&lt;li&gt;Else -&amp;gt; discard and revert
Since we have multiple test cases, correctness dominates the score, which is desirable. Only after maximizing quality do time and cost become deciding factors.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Auto-Improvement Loop
&lt;/h2&gt;

&lt;p&gt;The loop is very similar to the original autoresearch. Each iteration is stateless:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Take the current SKILL.md, analyze it, and apply a change based on a specific experiment idea. Boundaries are important: limit the scope of changes. We want iterative improvement, not full rewrites. At the same time, changes should not be too small, since evaluation is noisy.&lt;/li&gt;
&lt;li&gt;Run all test cases. Each test case should be executed multiple times to smooth out non-determinism.&lt;/li&gt;
&lt;li&gt;Evaluate results. Aggregate measurements. Compute the total score&lt;/li&gt;
&lt;li&gt;Compare with the previous best version. If better -&amp;gt; commit as the new baseline. If worse -&amp;gt; discard.&lt;/li&gt;
&lt;li&gt;Repeat with a new experiment idea.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The diagram of the autoimprove loop:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw7mrz42skz4xo5eml1pi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw7mrz42skz4xo5eml1pi.png" alt="Autoimprove loop diagram" width="695" height="795"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;I designed an auto-improvement loop for coding skills based on Andrej Karpathy’s autoresearch approach, originally created for improving LLM training loops.&lt;/p&gt;

&lt;p&gt;At a high level, nothing prevents us from applying the same idea to agentic coding. In theory, an agent could autonomously “train” its own coding skills based on specific use cases and a codebase - without human supervision.&lt;/p&gt;

&lt;p&gt;That said, there are still many challenges:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Defining high-quality test cases that cover edge cases&lt;/li&gt;
&lt;li&gt;Setting proper boundaries for skill modifications&lt;/li&gt;
&lt;li&gt;Forcing the agent to explore the full design space (sub-agents, memory strategies, tooling, etc.)&lt;/li&gt;
&lt;li&gt;Deciding when an agent should pull in new tools (CLIs, MCPs) or even build them from scratch&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These challenges will likely surface during implementation and early runs. I'll share more once I have initial results and a working version.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Autonomous AI Coding: Ralph Loops with Sub-Agents and Skills (Pt. 1)</title>
      <dc:creator>Kirill Krainov</dc:creator>
      <pubDate>Tue, 17 Mar 2026 12:02:26 +0000</pubDate>
      <link>https://dev.to/zerocopy/autonomous-ai-coding-ralph-loops-with-sub-agents-and-skills-pt-1-336l</link>
      <guid>https://dev.to/zerocopy/autonomous-ai-coding-ralph-loops-with-sub-agents-and-skills-pt-1-336l</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;I've been testing &lt;strong&gt;Ralph loops&lt;/strong&gt; recently for agentic coding. The idea is simple: spin up new Claude Code sessions for each task to get a fresh context until the agent achieves the goal, and persist the necessary context between sessions via .md files. It's simple, but it solves many long-known LLM issues like context rot and the generally small size of the context window.&lt;/p&gt;

&lt;p&gt;This becomes especially relevant when the agent works with large, complex repositories or infrastructure. In addition, you often want to have a proper research phase to check current best practices and available libraries and their interfaces, which also consumes a lot of context.&lt;/p&gt;

&lt;p&gt;Even frontier models like &lt;strong&gt;Sonnet&lt;/strong&gt; and &lt;strong&gt;Opus&lt;/strong&gt; still have relatively small context windows, and that problem won’t disappear anytime soon. But we still need a way to leverage the advantages of agentic coding today.&lt;/p&gt;

&lt;p&gt;I didn't like the approach of spinning up &lt;strong&gt;Claude Code&lt;/strong&gt; sessions programmatically (for example, in bash). In that case, you lose control over the workflow, and you lack options to effectively interrupt the process or change something in the middle of execution.&lt;/p&gt;

&lt;h2&gt;
  
  
  Solution
&lt;/h2&gt;

&lt;p&gt;I decided to implement my own workflow using the &lt;strong&gt;sub-agents&lt;/strong&gt; and &lt;strong&gt;skills&lt;/strong&gt; features, programming the entire workflow inside a single Claude Code session.&lt;/p&gt;

&lt;p&gt;Sub-agents are essentially .md files where you define the role of the agent and its interface: what arguments it takes and what it returns.&lt;/p&gt;

&lt;p&gt;I defined agents and their roles for each phase of the workflow. At a high level there are two phases: planning and execution.&lt;/p&gt;

&lt;p&gt;The orchestrator and the main workflow are defined in a single &lt;strong&gt;SKILL.md&lt;/strong&gt; file. This file contains zero context about the project itself - only the steps and rules related to the workflow logic.&lt;/p&gt;

&lt;p&gt;The planning phase is divided into two main loops:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The preliminary research loop&lt;/li&gt;
&lt;li&gt;The main planning loop&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In this article, I want to focus on the &lt;strong&gt;preliminary research&lt;/strong&gt; and &lt;strong&gt;interview&lt;/strong&gt; phase.&lt;/p&gt;

&lt;p&gt;This phase is extremely important because it gathers all the context needed to build a solid plan. The broader the context we collect here and the more edge cases we identify, the more likely we are to produce an implementation that:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;meets the original goals and requirements, and&lt;/li&gt;
&lt;li&gt;fits the existing architecture and follows established standards.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The more time we invest here, the less we need to babysit the agent during later phases and during review.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Preliminary Research Loop
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnq0x81319nycrdl59w1u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnq0x81319nycrdl59w1u.png" alt="Preliminary Research Loop Diagram" width="557" height="1170"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Before entering the main planning loop, the workflow runs a preliminary research loop. The goal of this loop is to identify the scope of the task and resolve ambiguities.&lt;/p&gt;

&lt;p&gt;It allows you to start with a very high-level description of the task and then progressively define details and gather context together with Claude Code through an interview loop.&lt;/p&gt;

&lt;p&gt;In this phase the agent performs high-level exploration and research without diving into implementation details, just enough to understand the scope and highlight unclear areas.&lt;/p&gt;

&lt;p&gt;Questions are presented to the user using the &lt;strong&gt;AskUserQuestions&lt;/strong&gt; Claude Code feature. The interview runs in a loop for up to three iterations, or until no ambiguities remain.&lt;/p&gt;

&lt;p&gt;Once the preliminary researcher signals that everything is clear, the orchestrator locks all decisions into the &lt;strong&gt;CONTEXT.md&lt;/strong&gt; file.&lt;/p&gt;

&lt;p&gt;How is this phase defined in &lt;strong&gt;SKILL.md&lt;/strong&gt; main orchestrator file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;### Phase 2: Preliminary Research Loop (interactive)&lt;/span&gt;

&lt;span class="s"&gt;Iteratively identify gray areas and collect decisions before locking scope.&lt;/span&gt;

&lt;span class="err"&gt;*&lt;/span&gt;&lt;span class="nv"&gt;*Orchestrator&lt;/span&gt; &lt;span class="s"&gt;state (in-memory, not written to disk):**&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;`decisions_list`&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;accumulated user decisions (starts empty)&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;`scope_in` / `scope_out`&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;scope boundaries (starts from context scanner suggestion)&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;`iteration`&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;counter (starts at 1, max 3)&lt;/span&gt;

&lt;span class="c1"&gt;#### Phase 2a: Spawn Preliminary Researcher&lt;/span&gt;

&lt;span class="s"&gt;Task(&lt;/span&gt;
 &lt;span class="s"&gt;prompt="First, read .claude/agents/preliminary-researcher.md for your role.\n\n&amp;lt;context&amp;gt;\nTask&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;{&lt;/span&gt;&lt;span class="nv"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;}&lt;/span&gt;&lt;span class="na"&gt;\nTask type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;{&lt;/span&gt;&lt;span class="nv"&gt;task_type&lt;/span&gt;&lt;span class="pi"&gt;}&lt;/span&gt;&lt;span class="na"&gt;\nAffected areas&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;{&lt;/span&gt;&lt;span class="nv"&gt;affected_areas&lt;/span&gt;&lt;span class="pi"&gt;}&lt;/span&gt;&lt;span class="na"&gt;\nReferences to load&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;{&lt;/span&gt;&lt;span class="nv"&gt;reference_list&lt;/span&gt;&lt;span class="pi"&gt;}&lt;/span&gt;&lt;span class="na"&gt;\nScope:\n  IN&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;{&lt;/span&gt;&lt;span class="nv"&gt;scope_in&lt;/span&gt;&lt;span class="pi"&gt;}&lt;/span&gt;&lt;span class="na"&gt;\n  OUT&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;{&lt;/span&gt;&lt;span class="nv"&gt;scope_out&lt;/span&gt;&lt;span class="pi"&gt;}&lt;/span&gt;&lt;span class="na"&gt;\nIteration&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;{&lt;/span&gt;&lt;span class="nv"&gt;iteration&lt;/span&gt;&lt;span class="pi"&gt;}&lt;/span&gt; &lt;span class="s"&gt;of 3\n&amp;lt;/context&amp;gt;",&lt;/span&gt;
 &lt;span class="s"&gt;subagent_type="general-purpose",&lt;/span&gt;
 &lt;span class="s"&gt;description="Identify gray areas (iteration {iteration})"&lt;/span&gt;
&lt;span class="s"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;#### Phase 2b: Handle Signals&lt;/span&gt;

&lt;span class="err"&gt;*&lt;/span&gt;&lt;span class="nv"&gt;*If&lt;/span&gt; &lt;span class="s"&gt;CLEAR:**&lt;/span&gt;
&lt;span class="err"&gt;*&lt;/span&gt;&lt;span class="nv"&gt;*If&lt;/span&gt; &lt;span class="s"&gt;SCOPE_SUGGESTION (first iteration only):**&lt;/span&gt; 
&lt;span class="err"&gt;*&lt;/span&gt;&lt;span class="nv"&gt;*If&lt;/span&gt; &lt;span class="s"&gt;GRAY_AREA / AMBIGUITY:**&lt;/span&gt;

&lt;span class="c1"&gt;#### Phase 2c: Collect and Iterate&lt;/span&gt;

&lt;span class="s"&gt;1. Add answers to `decisions_list`&lt;/span&gt;
&lt;span class="s"&gt;2. If "Adjust scope"&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ask what to change, update `scope_in` / `scope_out`&lt;/span&gt;
&lt;span class="s"&gt;3. Increment `iteration`&lt;/span&gt;
&lt;span class="na"&gt;4. If `iteration &amp;lt;= 3`&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;go to Phase 2a&lt;/span&gt;
&lt;span class="na"&gt;5. If `iteration &amp;gt; 3`&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;force-proceed to Phase &lt;/span&gt;&lt;span class="m"&gt;3&lt;/span&gt;

&lt;span class="c1"&gt;### Phase 3: Decision Lock (orchestrator-direct, interactive)&lt;/span&gt;

&lt;span class="s"&gt;1. Present full decision summary (scope + all decisions + constraints) via `AskUserQuestion` with a single confirmation question&lt;/span&gt;
&lt;span class="s"&gt;2. Create `.workflow/{task-name}/` directory&lt;/span&gt;
&lt;span class="s"&gt;3. Write CONTEXT.md&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The preliminary researcher itself is implemented as a sub-agent, and its role is defined in &lt;code&gt;/.claude/agents/preliminary-researcher.md&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;preliminary-researcher&lt;/span&gt;
&lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Identifies&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;gray&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;areas&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;and&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;ambiguities&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;before&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;decisions&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;are&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;locked.&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;Role&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;file&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;for&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;general-purpose&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;subagent.&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;Spawned&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;by&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;workflow&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;plan&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;mode&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;Phase&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;2."&lt;/span&gt;
&lt;span class="na"&gt;tools&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Read, Glob, Grep, Bash&lt;/span&gt;
&lt;span class="na"&gt;model&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;sonnet&lt;/span&gt;
&lt;span class="na"&gt;color&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;cyan&lt;/span&gt;
&lt;span class="nn"&gt;---&lt;/span&gt;


&lt;span class="s"&gt;&amp;lt;role&amp;gt;&lt;/span&gt;
&lt;span class="s"&gt;You are the preliminary research subagent for a workflow task. Your job is to identify decision points, ambiguities, and gray areas that need human input before implementation research begins. You do NOT write files or do web research -- you surface what needs deciding.&lt;/span&gt;
&lt;span class="s"&gt;&amp;lt;/role&amp;gt;&lt;/span&gt;
&lt;span class="s"&gt;&amp;lt;execution_flow&amp;gt;&lt;/span&gt;
&lt;span class="s"&gt;&amp;lt;step&amp;gt;&amp;lt;/step&amp;gt;&lt;/span&gt;
&lt;span class="s"&gt;&amp;lt;step&amp;gt;&amp;lt;/step&amp;gt;&lt;/span&gt;
&lt;span class="s"&gt;&amp;lt;/execution_flow&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;This is how I implemented a preliminary research loop using skills and sub-agents, so you don't need to detach from the Claude Code session and still retain full control over the workflow.&lt;/p&gt;

&lt;p&gt;It allows you to interrupt the process at any step, reconsider decisions, or inject additional context before moving to the planning phase.&lt;/p&gt;

&lt;p&gt;At the same time, you still get the advantages of Ralph loops: isolated context windows for context-heavy steps like repository scanning or research, autonomous loops with self-correction, and the ability to inject additional context after each interview iteration.&lt;/p&gt;

&lt;p&gt;In the next article, I'll show what happens in the planning phase and what the deep research phase is, and why separating these phases makes the workflow significantly more reliable.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>productivity</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
