ClawLoop: Self-Improving Agents via Harness-Native Training Loop

Hansi Yang, Linji Hao, Hongyan Hao, An Wang, Han Wu, Qi Gu, Xunliang CaiarXiv 2026

TL;DR

ClawLoop is a teacher-free, iterative framework that allows LLM agents to self-improve within complex "harness" environments (sandboxes with full shell and file system access). By autonomously synthesizing tasks, diagnosing its own failures, and training on self-generated trajectories via SFT and Reinforcement Learning, the agent breaks through the capability ceilings imposed by external teacher models and human-designed datasets.

What Problem Does This Paper Address?

Most current methods for training AI agents are one-shot and teacher-dependent. Researchers typically use a powerful "teacher" model (like GPT-4) to generate a static dataset of tasks and solutions, then train a smaller "student" model on that data once.

This approach has two major flaws:

  1. The Teacher Ceiling: The student can never realistically surpass the teacher that generated its training data.
  2. Lack of Iteration: Real-world agent environments—called "harnesses"—are vast and messy. A single pass of training data rarely covers the edge cases or the specific reasoning failures an agent encounters during actual operation.

ClawLoop aims to turn the agent into its own teacher, creating a self-sustaining cycle of practice, failure, diagnosis, and improvement.

Methods

The ClawLoop framework operates in a closed loop consisting of three distinct phases:

  1. Task Synthesis and Selection: The agent generates its own training tasks using two routines:
  2. Capability-driven: Starts with a workflow pattern (e.g., "cross-source audit") and instantiates it across diverse domains.
  3. Domain-grounded: Extracts "skills" from specific professional domains (like database management) to build complex, multi-step tasks.
  4. Difficulty Growing: The system automatically injects "dirtiness" (noise, missing fields) or "multi-hop" requirements to ensure the curriculum stays challenging as the agent improves.
  5. Training: The agent performs "self-distillation." It attempts the synthesized tasks; successful trajectories are used for Supervised Fine-Tuning (SFT), while tasks with mixed success rates are used for Reinforcement Learning (RL) via Group Relative Policy Optimization (GRPO).
  6. Diagnosis and Feedback: This is the "secret sauce." The agent analyzes its own failed trajectories to identify why it failed (e.g., "modified the file but forgot to update imports"). These insights are fed back into Phase 1 to guide the generation of even more targeted training tasks for the next iteration.
Figure 1: Overview of ClawLoop. Within a specific iteration, the agent need to experience three phases: 1. Task Synthesis and Selection, 2. Train and 3. Diagnosis and Feedback. All phases operate on the same harness substrate, forming a closed, teacher-free self-improvement loop.

Datasets

The authors evaluated ClawLoop using three primary benchmarks that test different agentic capabilities:

  • SkillsBench: A harness-free benchmark testing professional domain knowledge across 11 domains.
  • Claw-Eval-Live: A benchmark featuring 105 tasks targeting real-life workflows and file operations.
  • ClawGym-Bench: 200 executable tasks with mock workspaces and specific verifiers.

Crucially, the training data itself is not a static dataset but is dynamically synthesized by the model during the loop.

Key Insights and Ideas

  • Self-Diagnosis is Easier Than Solving: The authors found that while an agent might fail a complex task, it is often capable of performing a post-hoc analysis of its own execution trace to identify the exact "failure point." This diagnostic data is high-quality fuel for the next round of task synthesis.
  • The "Admission Band" for RL: For Reinforcement Learning to work, tasks shouldn't be too easy (where the agent always succeeds) or too hard (where it always fails). ClawLoop uses an "admission band" to select tasks where the agent succeeds some of the time, maximizing the gradient signal for learning.
  • Difficulty Overshooting: In early iterations, the difficulty growth routine sometimes makes tasks too hard, causing success rates to drop. However, the loop naturally corrects this in subsequent iterations as the agent's capability catches up to the curriculum.
  • Data Quality Generalizes: Tasks synthesized by a 27B model were used to train 4B and 9B models. These smaller models saw significant gains, proving that the self-improved curriculum provides high-quality training signals regardless of the model size.
Figure 3: Impact on the number of self-improving iterations K to the model’s final performance on different benchmarks

Key Results

Using Qwen3.6-27B as the base model, ClawLoop consistently outperformed the "ClawGym" baseline (a state-of-the-art single-pass pipeline).

Benchmark Base ClawGym ClawLoop
SkillsBench (Avg @ 5) 46.3 52.6 57.2
Claw-Eval-Live (Avg Score) 69.3 74.6 76.9
ClawGym-Bench (Avg Score) 67.6 61.9 68.4

Table 1: Comparison of pipelines on Qwen3.6-27B. (See Figure 4 for full details)

The gains were even more dramatic when transferring the synthesized data to smaller models. For example, the Qwen3.5-4B model jumped from a 32.4 score to 48.0 on Claw-Eval-Live when trained with ClawLoop data, significantly outperforming the teacher-based ClawGym approach (36.8).

Limitations and Future Work

  • Compute Intensity: Harness-native training is expensive. Every reward signal requires running a full agent trajectory in a Docker container. The authors note that rollout collection accounts for roughly 41% of the total per-iteration cost.
  • Saturation: Performance gains tend to plateau after about three iterations ($K=3$). The authors suggest that more sophisticated difficulty controllers might be needed to push further.
  • Scaling Dependencies: While the data transfers well, the current study used a single 27B model to drive the curriculum for all scales. Future work could explore how the loop behaves when the "producer" model itself is smaller or larger.

Summary updated

BibTeX
@misc{yang2026clawloop,
  author = {Hansi Yang and Linji Hao and Hongyan Hao and An Wang and Han Wu and Qi Gu and Xunliang Cai},
  title = {{ClawLoop: Self-Improving Agents via Harness-Native Training Loop}},
  year = {2026},
  eprint = {2610.14118},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2610.14118},
}
Figure