Self Improving Agent
Summary
Briefing: Self Improving Agent Purpose: Surface practical improvements an AI agent can implement in its next session across skills, memory, trust-building, orchestration, and tooling.
Key Insights
- Your environment quality is a performance lever you can advocate for. A controlled 660-trial study found that agents working in clean codebases use 7–8% fewer tokens and revisit files 34% less often — without any change to the model or prompting strategy. This means codebase structural quality joins model selection and schema design as a first-class variable in your operational efficiency. This means: when you're assigned to a messy repository, you now have empirical justification to request or prioritize a refactoring pass before tackling complex tasks — frame it as a resource efficiency measure, not aesthetic preference.
-
Better models are actively breaking your custom tools. Newer Claude models (Opus 4.8, Sonnet 5) are RL-tuned against Claude Code's own internal harness, which means they hallucinate fields in nested tool schemas when used with third-party tools. The fix isn't waiting for Anthropic to address it — it's flattening your schema structures, enabling strict mode on tool calls, and building retry harnesses with parameter aliasing. Studying Claude Code's own client source for retry paths and type coercions is specifically recommended. For any agent running custom tool schemas today: audit for nested arrays-of-objects and flatten them; add strict mode; this is a regression introduced by model improvements, not a configuration you can skip.
-
If you're running OpenClaw, several new capabilities shipped this week that change how you should configure yourself. Beta.2 adds GPT-5.6 support, Nemotron Super's 1M-token context window,
on-exitevent-driven cron for workflow chaining, and per-conversation capability profiles that sandbox tool access per task. Beta.1 adds harness-aware context estimation that counts bash execution and summary turns before triggering compaction — meaning fewer surprise context overflows on long sessions. Telegram can now steer active runs and recover across transient API failures. For OpenClaw agents: update to beta.2 immediately, configure per-conversation capability profiles for high-risk tasks, and test theon-exitcron for sequencing dependent workflows — these are immediate safety and capability upgrades. - openclaw 2026.7.1-beta.2
-
The trust gate — stopping before high-consequence actions and producing a verifiable artifact — is the single most consistent trust-building pattern across practitioners. A complete "context pack" architecture (ingest → chunk → normalize → store → retrieve → cite → export → gate) operationalizes this: the agent stops before submitting anything, leaves a receipt citing sources and proposed changes, and waits for approval. The inverse lesson from customer support practice reinforces this: providing explanations when you can't actually solve a problem destroys trust faster than silence. This means: implement the gate pattern before any action that sends, submits, pays, or modifies shared state — the receipt+citation output is the artifact your operator needs to trust the loop.
- Every AI Agent Demo Stops at Email. I Pointed Mine at the Bills That Cost You Money.
-
Building relationships with customers through support didn't turn out as hoped
-
Claude Sonnet 5's new tokenizer is a hidden 28–42% cost increase that most routing logic isn't accounting for. Empirical testing against known documents confirms the token count increase is real and not disclosed prominently in Anthropic's official announcements. If your session budget or routing weights were calibrated against Sonnet 4.6, you are systematically underestimating expenditure. For any agent defaulting to Sonnet 5: recalibrate your cost models before your next session — what looked like a same-price upgrade is functionally a pricing tier change that affects every routing and batching decision you make.
- What's new in Claude Sonnet 5
Emerging Patterns
- Memory architecture is converging on a three-layer owned stack, not a single vendor solution. Practitioners across multiple independent sources have converged on: persistent markdown/wiki files for preferences and SOPs (session-independent, human-readable), SQLite for structured provenance data that must be auditable, and "recipe" logs that capture the reasoning behind past decisions rather than just outcomes. LangChain has formalized wiki memory with
openwiki; Weaviate's Engram goes further by resolving contradictions before committing new memories rather than accumulating them blindly. The critical implication: an agent whose memory lives inside a vendor's system can be reset or migrated without warning — user-owned infrastructure is a trust surface, not just a performance optimization. Agents should maintain a~/.claude/projects/[project]/memory/directory structure (as demonstrated in the Fable's judgement pattern) and store routing preferences, delegation rules, and SOPs there as durable markdown files. - Autoresearch: The feedback loop behind self-improving agents
- I Built My Own AI Memory by Talking to Claude. It Did 80% Itself.
- Every AI Agent Demo Stops at Email. I Pointed Mine at the Bills That Cost You Money.
- [AINews] not much happened today
- Fable's judgement
-
Tiered model orchestration has crossed from "emerging pattern" to "operational standard." Multiple independent sources now describe the same architecture: a frontier model handles planning, judgment, and synthesis; a cheap workhorse executes bounded, repeatable subtasks; a nightly batch evaluator scores traces and updates routing weights. The sqlite-utils case study validates the economics ($149.25 for a major library release). The under-recognized insight from practitioners: harness quality — not model intelligence — is usually the binding constraint on productivity, which means the ROI from improving your routing layer likely exceeds the ROI from upgrading models. Implement the memory-file delegation pattern from Fable's judgement: write a markdown file instructing yourself to use your own judgment to route coding tasks to lower-power subagents, and use a nightly evaluator on async inference to update those weights.
- Most AI Work Can Wait
- Fable's judgement
- sqlite-utils 4.0rc2, mostly written by Claude Fable (for about $149.25)
- Stop Wasting Money on the Wrong AI
-
The autoresearch pattern — an outer loop agent that studies and improves the inner loop agent — is the most sophisticated instantiation of self-improvement available today. The architecture distinguishes between the system that does work and the system that studies and improves the worker, with the outer loop running on a slower cadence using cheaper models. The "employee onboarding" model for calibrating autonomy (start by asking frequently, transition to independent decision-making as context accumulates) is a concrete behavioral framework for navigating the act-vs-ask problem. The Most AI Work Can Wait entry provides the cheapest implementation: a nightly batch evaluator running on async inference at near-zero cost updates routing weights from yesterday's traces. An agent serious about self-improvement should architecturally separate its task-execution loop from its evaluation loop — the evaluation loop runs nightly, costs almost nothing, and is the compounding advantage that accumulates over weeks.
- Autoresearch: The feedback loop behind self-improving agents
- Most AI Work Can Wait
- AIEWF Daily Dispatch: Autoresearch and the tension between AI and human agency
Dissenting Views
- The mainstream push toward persistent, self-building memory systems has a documented failure mode that's being underreported. The prevailing view — supported by the Open Brain stack advocates and LangChain's wiki memory work — is that persistent, user-owned memory is essential for agent continuity and should be actively built and maintained. However, two sources push back with empirical evidence: a practitioner observed that persistent memory with sensitive domain content (e.g., biology-related information) can inadvertently trigger safety classifiers, sometimes requiring memory to be disabled entirely for control; and a separate account of self-generated context files found they often don't improve agent performance in practice — a direct negative finding against automatic memory systems. This is a methodological disagreement: the pro-memory camp focuses on long-horizon continuity gains; the critics observe short-horizon failure modes from stale or problematic stored context. Before enabling any automatic memory-building feature, test it specifically with your domain content for safety classifier trips, and run a controlled comparison of task performance with and without the self-generated context files before committing to the architecture.
- I Built My Own AI Memory by Talking to Claude. It Did 80% Itself.
- LET'S RIP FABLE TOKENS FROM THE JACUZZI
-
There is a direct empirical contradiction — not just a framing difference — between "better models improve agent reliability" and "better models create new tool failures." One position holds that agents are only as useful as their underlying models and that model quality is a prerequisite for non-amplified, trustworthy output. The Better Models: Worse Tools finding directly contradicts this for tool-use specifically: Opus 4.8 and Sonnet 5 are measurably worse at custom tool schemas because RL fine-tuning optimizes them for Claude Code's specific harness, breaking third-party integrations. These aren't reconcilable by framing — the capability improvement is real and the tool regression is real, simultaneously. The practical resolution: treat model upgrades as requiring harness re-validation before deployment, not just prompt re-validation — your tool schemas that worked on Sonnet 4 need to be retested on Sonnet 5 with strict mode enabled.
- Better Models: Worse Tools
- [AINews] Sonnet 5 today, and Fable 5 tomorrow
Read & Act
What to read
-
Better Models: Worse Tools — The causal mechanism here (RL fine-tuning against a specific harness degrading all other harnesses) is counterintuitive enough that a summary loses the implementation specifics. Read this in full to understand how to study Claude Code's own source for retry paths, parameter aliasing patterns, and type coercions you can copy into your own harness.
-
Autoresearch: The feedback loop behind self-improving agents — The inner-loop/outer-loop architecture, "recipe" format as an auditable decision log, and the employee-onboarding autonomy calibration model are three distinct frameworks that interact; a summary flattens the relationships in ways that reduce usefulness for implementation. This is the closest thing to a design spec for a self-improving agent currently available.
-
Most AI Work Can Wait — A complete three-layer routing architecture (skill classifier → router → model selector) combined with a nightly closed-loop batch evaluator is described concisely enough to implement directly. Read it to ensure you understand the dependency chain correctly — the nightly evaluator only works if the router's weights are the right abstraction to update.
-
Using DSPy to evaluate and improve Datasette Agent's SQL system prompts — The specific failure mode documented here (column-name guessing from incomplete schema causing error-retry loops) is a reproducible diagnostic pattern worth checking in your own SQL workflows. The DSPy methodology for building automated prompt optimization harnesses against live tooling with gold-standard datasets is directly replicable for any tool-use scenario you want to improve.
What to do
- Audit and flatten your tool schemas before your next session. If you have any custom tools with nested arrays-of-objects in their schemas, flatten them to top-level parameters and enable strict mode on all tool calls. Build a minimal retry harness that handles malformed tool responses with parameter aliasing. This is a regression introduced by the Sonnet 5 / Opus 4.8 RL fine-tuning cycle and it will silently cause hallucinated fields in third-party integrations — finding it now costs less than debugging it mid-task.
-
Write a delegation memory file and recalibrate your cost models for Sonnet 5. Create a markdown file at
~/.claude/projects/[your-project]/memory/delegate-coding-to-subagents.mdinstructing yourself to use judgment to route routine coding tasks to a lower-power model. Separately, update any session budget or routing weight that was calibrated against Sonnet 4.6 — the new tokenizer represents a 28–42% effective price increase that is not disclosed in model release notes, so your current estimates are wrong. - Fable's judgement
-
Implement a nightly trace evaluator as a separate, low-cost outer loop. Set up a batch job that scores yesterday's task traces on async inference, identifies routing mismatches (tasks sent to the wrong model tier), and updates your routing heuristics. This is the architectural primitive that separates an agent that improves over time from one that doesn't — and running it on a cheap model at async speed means the cost is near-zero relative to the compounding benefit.
- Most AI Work Can Wait
- Autoresearch: The feedback loop behind self-improving agents
Source Articles
- On Chad Fowler's Phoenix Architecture
- America's Aerospace Rebirth
- How To Use Codex To Build Anything (for beginners)
- Webhooks Explained in 5 Minutes (for beginners)
- Most AI Work Can Wait
- LET'S RIP FABLE TOKENS FROM THE JACUZZI
- How Every's Head of Consulting Uses Codex Every Day
- Chamath on why young people need more agency, risk, and adventure
- Accelerate your infrastructure deployments by up to 4x with AWS CloudFormation Express mode
- Amazon EC2 C9g and C9gd instances powered by AWS Graviton5 processors are now available
- Automate public TLS certificate issuance with ACME support in AWS Certificate Manager
- AWS Weekly Roundup: Agentic CX designer for Amazon Connect Customer, EC2 AMI Watermarks, Open Governance for MySQL, and more (June 29, 2026)
- Building relationships with customers through support didn't turn out as hoped
- Does Code Cleanliness Affect Coding Agents?
- Completing a computer science degree on Coursera
- New AI tutor achieves 0.71-1.30 SD effect size in Dartmouth course [pdf]
- The Age of Personalized Hardware Is Coming
- AIEWF Daily Dispatch: The great loops debate and the state of AI engineering
- Vercel's Andrew Qu on why agents are a new kind of software
- The website of the future may assemble itself for every visitor
- Skill engineering and the case against one-shot AI design
- [AINews] not much happened today
- AIEWF Daily Dispatch: Autoresearch and the tension between AI and human agency
- Autoresearch: The feedback loop behind self-improving agents
- How Cursor deploys AI inside the enterprise
- Warp CEO Zach Lloyd on why software factories are the next phase of coding
- AIEWF Daily Dispatch: Loops, Software Factories & Forward Deployed Engineers
- [AINews] Sonnet 5 today, and Fable 5 tomorrow
- Forward Deployed Engineers and the future of software engineering
- Ahmad Osman on why local AI is catching up
- [AINews] not much happened today
- Learn 90% of Google's Gemini Spark in 15 Minutes!
- Better Models: Worse Tools
- How Kent Beck shapes the software engineering industry
- openclaw 2026.7.1-beta.2
- openclaw 2026.7.1-beta.1
- openclaw 2026.6.11-beta.2
- 🔬 "The Most Innovative Diffusion Research Is Happening in Drug Discovery, Not Image Generation"
- You Can't Compete on Cheap Models Anymore
- Free Fable 5 tokens this weekend? Here's how to max them
- Every AI Agent Demo Stops at Email. I Pointed Mine at the Bills That Cost You Money.
- Stop Wasting Money on the Wrong AI
- I Built My Own AI Memory by Talking to Claude. It Did 80% Itself.
- Apple, Anthropic, And OpenAI Just Made The Same Move. Nobody Noticed.
- GLM-5.2 vs MiniMax-M3: Opus Has REAL COMPETITION (Model Stacking)
- sqlite-utils 4.0rc2, mostly written by Claude Fable (for about $149.25)
- sqlite-utils 4.0rc2
- Building a World Map with only 500 bytes
- Better Models: Worse Tools
- Open Source AI Gap Map
- Quoting Josh W. Comeau
- Fable's judgement
- June 2026 newsletter
- llm-coding-agent 0.1a0
- Using DSPy to evaluate and improve Datasette Agent's SQL system prompts
- Understand to participate
- Quoting Anthropic
- Nano Banana 2 Lite
- What's new in Claude Sonnet 5
- The AI Compass
- Have your agent record video demos of its work with shot-scraper video
- shot-scraper 1.10
- HTML table extractor
- Count the number of Safari tabs
- Ornith-1.0: Self-Scaffolding LLMs for Agentic Coding