Help
RSS
API
Feed
Maltego
Contact
Domain > vadim.blog
×
More information on this domain is in
AlienVault OTX
Is this malicious?
Yes
No
DNS Resolutions
Date
IP Address
2020-04-26
34.193.197.239
(
ClassC
)
2026-03-04
216.198.79.1
(
ClassC
)
Port 443
HTTP/1.1 200 OKAccept-Ranges: bytesAccess-Control-Allow-Origin: *Age: 0Cache-Control: public, max-age0, must-revalidateContent-Disposition: inlineContent-Length: 533277Content-Type: text/html; charsetutf-8Date: Wed, 04 Mar 2026 14:54:48 GMTEtag: 0a1ba49b6d578b35ba5ddd5e02d33567Last-Modified: Wed, 04 Mar 2026 14:54:48 GMTServer: VercelStrict-Transport-Security: max-age63072000X-Vercel-Cache: HITX-Vercel-Id: pdx1::l8bfq-1772636088307-bfa97fe661cf !doctype html>html langen dirltr classblog-wrapper blog-list-page plugin-blog plugin-id-default data-has-hydratedfalse>head>meta charsetUTF-8>meta namegenerator contentDocusaurus v3.9.2>title data-rhtrue>Vadim's blog/title>meta data-rhtrue nameviewport contentwidthdevice-width,initial-scale1>meta data-rhtrue nametwitter:card contentsummary_large_image>meta data-rhtrue propertyog:image contenthttps://vadim.blog/img/docusaurus-social-card.jpg>meta data-rhtrue nametwitter:image contenthttps://vadim.blog/img/docusaurus-social-card.jpg>meta data-rhtrue propertyog:url contenthttps://vadim.blog/>meta data-rhtrue propertyog:locale contenten>meta data-rhtrue namedocusaurus_locale contenten>meta data-rhtrue namedocsearch:language contenten>meta data-rhtrue propertyog:title contentVadim's blog>meta data-rhtrue namedescription contentArticles on AI engineering, LLM agents, eval-driven development, edge computing, and TypeScript/Rust by Vadim Nicolai.>meta data-rhtrue propertyog:description contentArticles on AI engineering, LLM agents, eval-driven development, edge computing, and TypeScript/Rust by Vadim Nicolai.>meta data-rhtrue namedocusaurus_tag contentblog_posts_list>meta data-rhtrue namedocsearch:docusaurus_tag contentblog_posts_list>link data-rhtrue relicon href/img/favicon.ico>link data-rhtrue relcanonical hrefhttps://vadim.blog/>link data-rhtrue relalternate hrefhttps://vadim.blog/ hreflangen>link data-rhtrue relalternate hrefhttps://vadim.blog/ hreflangx-default>script data-rhtrue>function insertBanner(){var ndocument.createElement(div);n.id__docusaurus-base-url-issue-banner-container;n.innerHTML\ndiv id__docusaurus-base-url-issue-banner styleborder: thick solid red; background-color: rgb(255, 230, 179); margin: 20px; padding: 20px; font-size: 20px;>\n p stylefont-weight: bold; font-size: 30px;>Your Docusaurus site did not load properly./p>\n p>A very common reason is a wrong site a hrefhttps://docusaurus.io/docs/docusaurus.config.js/#baseUrl stylefont-weight: bold;>baseUrl configuration/a>./p>\n p>Current configured baseUrl span stylefont-weight: bold; color: red;>//span> (default value)/p>\n p>We suggest trying baseUrl span id__docusaurus-base-url-issue-banner-suggestion-container stylefont-weight: bold; color: green;>/span>/p>\n/div>\n,document.body.prepend(n);var edocument.getElementById(__docusaurus-base-url-issue-banner-suggestion-container),swindow.location.pathname,o/s.substr(-1)?s:s+/;e.innerHTMLo}document.addEventListener(DOMContentLoaded,function(){void 0window.docusaurus&&insertBanner()})/script>script data-rhtrue typeapplication/ld+json>{@context:https://schema.org,@type:Blog,@id:https://vadim.blog/,mainEntityOfPage:https://vadim.blog/,headline:Blog,description:Articles on AI engineering, LLM agents, eval-driven development, edge computing, and TypeScript/Rust by Vadim Nicolai.,blogPost:{@type:BlogPosting,@id:https://vadim.blog/claude-code-no-indexing,mainEntityOfPage:https://vadim.blog/claude-code-no-indexing,url:https://vadim.blog/claude-code-no-indexing,headline:Claude Code Doesnt Index Your Codebase. Heres What It Does Instead.,name:Claude Code Doesnt Index Your Codebase. Heres What It Does Instead.,description:Claude Code uses agentic search — Glob, Grep, Read — instead of RAG or vector embeddings. The creator explained why on HN. Here are the tradeoffs, the economics, and when each approach wins.,datePublished:2026-03-03T00:00:00.000Z,author:{@type:Person,name:Vadim Nicolai,description:Senior Software Engineer,url:https://www.linkedin.com/in/vadimnicolai/,image:https://github.com/nicolad.png},keywords:},{@type:BlogPosting,@id:https://vadim.blog/pixel-perfect-playwright-figma-mcp,mainEntityOfPage:https://vadim.blog/pixel-perfect-playwright-figma-mcp,url:https://vadim.blog/pixel-perfect-playwright-figma-mcp,headline:Pixel-Perfect UI with Playwright and Figma MCP: What Actually Works in 2026,name:Pixel-Perfect UI with Playwright and Figma MCP: What Actually Works in 2026,description:Honest assessment of achieving pixel-perfect UI using headless Playwright and Figma MCP. Real code, real friction, and what breaks when AI meets design tokens.,datePublished:2026-03-02T00:00:00.000Z,author:{@type:Person,name:Vadim Nicolai,description:Senior Software Engineer,url:https://www.linkedin.com/in/vadimnicolai/,image:https://github.com/nicolad.png},keywords:},{@type:BlogPosting,@id:https://vadim.blog/two-paradigms-multi-agent-ai-rust-vs-claude-teams,mainEntityOfPage:https://vadim.blog/two-paradigms-multi-agent-ai-rust-vs-claude-teams,url:https://vadim.blog/two-paradigms-multi-agent-ai-rust-vs-claude-teams,headline:Two Paradigms of Multi-Agent AI: Rust Parallel Agents vs Claude Code Agent Teams,name:Two Paradigms of Multi-Agent AI: Rust Parallel Agents vs Claude Code Agent Teams,description:From static Tokio fan-out to full agent-teams parity in Rust — a technical comparison of three multi-agent coordination models, with real implementation code including TaskQueue, Mailbox, PlanGate, and ShutdownToken.,datePublished:2026-03-01T00:00:00.000Z,author:{@type:Person,name:Vadim Nicolai,description:Senior Software Engineer,url:https://www.linkedin.com/in/vadimnicolai/,image:https://github.com/nicolad.png},keywords:},{@type:BlogPosting,@id:https://vadim.blog/ai-sdlc-meta-approaches,mainEntityOfPage:https://vadim.blog/ai-sdlc-meta-approaches,url:https://vadim.blog/ai-sdlc-meta-approaches,headline:The Two-Layer Model That Separates AI Teams That Ship from Those That Demo,name:The Two-Layer Model That Separates AI Teams That Ship from Those That Demo,description:Why do AI demos fail in production? The two-layer model — Eval-First, Grounding-First, Spec-Driven — explains how top AI teams build systems that actually ship.,datePublished:2026-02-25T00:00:00.000Z,author:{@type:Person,name:Vadim Nicolai,description:Senior Software Engineer,url:https://www.linkedin.com/in/vadimnicolai/,image:https://github.com/nicolad.png},keywords:},{@type:BlogPosting,@id:https://vadim.blog/code-improver-research-to-practice,mainEntityOfPage:https://vadim.blog/code-improver-research-to-practice,url:https://vadim.blog/code-improver-research-to-practice,headline:5 Meta-Tools, 0 Ad-Hoc Edits: Structured Code Repair with AI Agents,name:5 Meta-Tools, 0 Ad-Hoc Edits: Structured Code Repair with AI Agents,description:Ad-hoc AI edits break code. Standardized repair workflows dont. Five meta-tools for N+1 queries, type safety, performance, dead code, and security — grounded in 5 research papers.,datePublished:2026-02-25T00:00:00.000Z,author:{@type:Person,name:Vadim Nicolai,description:Senior Software Engineer,url:https://www.linkedin.com/in/vadimnicolai/,image:https://github.com/nicolad.png},keywords:},{@type:BlogPosting,@id:https://vadim.blog/codebase-auditor-research-to-practice,mainEntityOfPage:https://vadim.blog/codebase-auditor-research-to-practice,url:https://vadim.blog/codebase-auditor-research-to-practice,headline:Your Linter Cant Trace Execution Paths. This Agent Can.,name:Your Linter Cant Trace Execution Paths. This Agent Can.,description:Linters catch patterns. This AI agent traces N+1 queries from resolver to database and back. Four research papers shaped an auditor with playbooks for perf, security, types, and dead code.,datePublished:2026-02-25T00:00:00.000Z,author:{@type:Person,name:Vadim Nicolai,description:Senior Software Engineer,url:https://www.linkedin.com/in/vadimnicolai/,image:https://github.com/nicolad.png},keywords:},{@type:BlogPosting,@id:https://vadim.blog/meta-optimizer-research-to-practice,mainEntityOfPage:https://vadim.blog/meta-optimizer-research-to-practice,url:https://vadim.blog/meta-optimizer-research-to-practice,headline:We Built a Strategic Brain for Our AI Pipeline. Heres What It Learned.,name:We Built a Strategic Brain for Our AI Pipeline. Heres What It Learned.,description:Six agents can mine, audit, evolve, fix, and verify code. None knows when to do any of it. We built the coordinator that decides — with phase detection, cost-aware routing, and a kill switch.,datePublished:2026-02-25T00:00:00.000Z,author:{@type:Person,name:Vadim Nicolai,description:Senior Software Engineer,url:https://www.linkedin.com/in/vadimnicolai/,image:https://github.com/nicolad.png},keywords:},{@type:BlogPosting,@id:https://vadim.blog/skill-evolver-research-to-practice,mainEntityOfPage:https://vadim.blog/skill-evolver-research-to-practice,url:https://vadim.blog/skill-evolver-research-to-practice,headline:How We Built an Agent That Edits Its Own Instructions,name:How We Built an Agent That Edits Its Own Instructions,description:An AI agent that improves its own prompts based on measured evidence — not vibes. Five research papers, five anti-patterns, and one strict scope boundary that makes it safe.,datePublished:2026-02-25T00:00:00.000Z,author:{@type:Person,name:Vadim Nicolai,description:Senior Software Engineer,url:https://www.linkedin.com/in/vadimnicolai/,image:https://github.com/nicolad.png},keywords:},{@type:BlogPosting,@id:https://vadim.blog/trajectory-miner-research-to-practice,mainEntityOfPage:https://vadim.blog/trajectory-miner-research-to-practice,url:https://vadim.blog/trajectory-miner-research-to-practice,headline:Why Do AI Agents Keep Making the Same Mistakes?,name:Why Do AI Agents Keep Making the Same Mistakes?,description:AI agents start fresh every session, repeating errors. We built a trajectory miner that extracts patterns from past sessions — heres the architecture, grounded in 4 research papers.,datePublished:2026-02-25T00:00:00.000Z,author:{@type:Person,name:Vadim Nicolai,description:Senior Software Engineer,url:https://www.linkedin.com/in/vadimnicolai/,image:https://github.com/nicolad.png},keywords:},{@type:BlogPosting,@id:https://vadim.blog/verification-gate-research-to-practice,mainEntityOfPage:https://vadim.blog/verification-gate-research-to-practice,url:https://vadim.blog/verification-gate-research-to-practice,headline:The Agent That Says No: Why Verification Beats Generation,name:The Agent That Says No: Why Verification Beats Generation,description:An autonomous improvement system without verification is autonomous damage. Meet the agent that gates every change with confidence scores, counterfactual analysis, and build checks.,datePublished:2026-02-25T00:00:00.000Z,author:{@type:Person,name:Vadim Nicolai,description:Senior Software Engineer,url:https://www.linkedin.com/in/vadimnicolai/,image:https://github.com/nicolad.png},keywords:}}/script>link relalternate typeapplication/rss+xml href/rss.xml titleVadim's blog RSS Feed>link relalternate typeapplication/atom+xml href/atom.xml titleVadim's blog Atom Feed>meta namedescription contentVadim Nicolai's blog on software engineering, AI, web development, and technology insights.>script typeapplication/ld+json>{@context:https://schema.org,@type:Blog,name:Vadims blog,url:https://vadim.blog,description:Software engineering, AI, and web development insights by Vadim Nicolai,author:{@type:Person,name:Vadim Nicolai,url:https://www.linkedin.com/in/vadimnicolai/}}/script>link relstylesheet href/assets/css/styles.6aac96aa.css>script src/assets/js/runtime~main.34c985a4.js deferdefer>/script>script src/assets/js/main.6c8ea711.js deferdefer>/script>/head>body classnavigation-with-keyboard>svg styledisplay: none;>defs>symbol idtheme-svg-external-link viewBox0 0 24 24>path fillcurrentColor dM21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z/>/symbol>/defs>/svg>script>document.documentElement.setAttribute(data-theme,dark),document.documentElement.setAttribute(data-theme-choice,dark),function(){try{const cnew URLSearchParams(window.location.search).entries();for(vart,eof c)if(t.startsWith(docusaurus-data-)){var at.replace(docusaurus-data-,data-);document.documentElement.setAttribute(a,e)}}catch(t){}}()/script>div id__docusaurus>div roleregion aria-labelSkip to main content>a classskipToContent_BeHc href#__docusaurus_skipToContent_fallback>Skip to main content/a>/div>nav aria-labelMain classtheme-layout-navbar navbar navbar--fixed-top>div classnavbar__inner>div classtheme-layout-navbar-left navbar__items>a classnavbar__brand href/>div classnavbar__logo>img src/img/logo.svg altVadim's blog logo classthemedComponent_FTcb themedComponent--light_NnF0>img src/img/logo.svg altVadim's blog logo classthemedComponent_FTcb themedComponent--dark_HE6J>/div>b classnavbar__title text--truncate>Vadim's blog/b>/a>/div>div classtheme-layout-navbar-right navbar__items navbar__items--right>div classnavbarSearchContainer_ybV0>/div>/div>/div>div rolepresentation classnavbar-sidebar__backdrop>/div>/nav>div id__docusaurus_skipToContent_fallback classtheme-layout-main main-wrapper mainWrapper_EkpW>div classcontainer margin-vert--lg>div classrow>aside classcol col--3>nav classsidebar_rWTd thin-scrollbar aria-labelBlog recent posts navigation>div classsidebarItemTitle_mV9d margin-bottom--md>Recent posts/div>div rolegroup>h3 classyearGroupHeading_UOvE>2026/h3>ul classsidebarItemList_BZyE clean-list>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/claude-code-no-indexing>Claude Code Doesn't Index Your Codebase. Here's What It Does Instead./a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/pixel-perfect-playwright-figma-mcp>Pixel-Perfect UI with Playwright and Figma MCP: What Actually Works in 2026/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/two-paradigms-multi-agent-ai-rust-vs-claude-teams>Two Paradigms of Multi-Agent AI: Rust Parallel Agents vs Claude Code Agent Teams/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/ai-sdlc-meta-approaches>The Two-Layer Model That Separates AI Teams That Ship from Those That Demo/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/code-improver-research-to-practice>5 Meta-Tools, 0 Ad-Hoc Edits: Structured Code Repair with AI Agents/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/codebase-auditor-research-to-practice>Your Linter Can't Trace Execution Paths. This Agent Can./a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/meta-optimizer-research-to-practice>We Built a Strategic Brain for Our AI Pipeline. Here's What It Learned./a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/skill-evolver-research-to-practice>How We Built an Agent That Edits Its Own Instructions/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/trajectory-miner-research-to-practice>Why Do AI Agents Keep Making the Same Mistakes?/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/verification-gate-research-to-practice>The Agent That Says No: Why Verification Beats Generation/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/how-i-built-ux-team-claude-code-agent-teams>How I Built a UX Team with Claude Code Agent Teams/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/bmad-langfuse-claude-code-agent-teams>BMAD Method + Langfuse + Claude Code Agent Teams in Production/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/trigger-dev-deep-dive>Trigger.dev Deep Dive: Background Jobs, Queue Fan-Out, MCP, and Agent Skills/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/concurrent-ai-agents-on-cloudflare-workers>Concurrent AI Agents on CF Workers/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/architect-agent>Building an Automated Architecture Reviewer with Claude Opus 4.6/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/production-ready-ai-job-classification-in-python-with-langchain-and-cloudflare-workers-ai>Production-Ready AI Job Classification in Python with LangChain and Cloudflare Workers AI/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/job-search-agent-google-adk-search-grounding>Building a Job Search Agent with Google ADK and Search Grounding/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/streaming-openai-tts-to-cloudflare-r2>Streaming OpenAI TTS to Cloudflare R2/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/langsmith-prompt-management>LangSmith Prompt Management/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/langfuse-features-prompts-tracing-scores-usage>Langfuse Features: Prompts, Tracing, Scores, Usage/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/openrouter-deepseek-integration>OpenRouter Integration with DeepSeek/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/ai-driven-company-enrichment-deepseek-cloudflare-browser-rendering>AI-Driven Company Enrichment with DeepSeek via Cloudflare Browser Rendering/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/2026/02/08/agent-skills-spec>Agent Skills spec + Mastra integration/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/ai-powered-bulk-skill-extraction-cloudflare-embeddings-vector-taxonomy>AI-Powered Skill Extraction with Cloudflare Embeddings and a Vector Taxonomy/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/ai-observability-llm-evals-langfuse>AI Observability for LLM Evals with Langfuse/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/eval-gated-grounded-research-pipeline>Schema-First RAG with Eval-Gated Grounding and Claim-Card Provenance/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/2026/02/03/building-production-evals-for-llm-systems>Evals for Workflow-First Production LLMs: Contracts, Rubrics, Sampling, and Observability/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/2026/01/25/langgraph-system-deepseek-powered-job-pre-screening-for-worldwide-remote-roles>Agentic Job Pre-Screening with LangGraph + DeepSeek: Auto-Reject Fake “Remote” Roles/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/2026/01/18/langgraph-tts-therapeutic-audio-architecture>Building Long-Running TTS Pipelines with LangGraph: Orchestrating Long-Form Audio Generation/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/defituna-limit-orders-solana-implementation>DeFiTuna: On-Chain Limit Orders on Solana/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/deploying-laserstream-cloudflare-containers>Deploying Real-Time Solana Data Streams on Cloudflare Containers with LaserStream/a>/li>/ul>/div>div rolegroup>h3 classyearGroupHeading_UOvE>2025/h3>ul classsidebarItemList_BZyE clean-list>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/defituna-amm-smart-contract-guide>DefiTuna AMM Smart Contract — Anchor Implementation Guide/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/building-jupiter-swap-integration-solana-anchor>Building a Production-Ready Jupiter Swap Integration on Solana with Anchor/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/amm-vs-cpamm-solana-liquidity-designs>AMM vs CPAMM on Solana: constant product vs CLMM, DLMM, PMM, and order books/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/tokio-vs-tokio-stream-websocket-adapters>Tokio vs tokio-stream in WebSocket adapters - stream-first vs select!/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/hyperliquid-gasless-trading-strategies>Hyperliquid Gasless Trading – Deep Comparison, Fees, and 20 Optimized Strategies/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/market-wizard-bullish-bias-playbook>Slaying Bullish Bias - A Market Wizards Playbook/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/nautilus-marketiftouched-validation>Contributing a Safer MarketIfTouchedOrder to Nautilus Trader — Hardening Conditional Orders in Rust/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/nautilus-limitiftouched-validation>Contributing a Safer LimitIfTouchedOrder to Nautilus Trader — A Small Open-Source Win for Rust Trading/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/openai-ffmpeg-integration>How to Integrate OpenAI TTS with FFmpeg in a FastAPI Service/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/deepseek-r1-ollama-fastapi>How to Set Up and Run DeepSeek-R1 Locally With Ollama and FastAPI/a>/li>/ul>/div>div rolegroup>h3 classyearGroupHeading_UOvE>2024/h3>ul classsidebarItemList_BZyE clean-list>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/ddg-da-adapting-ai>Adapting Stock Forecasts with AI/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/qlib-mlflow-integration>Leveraging Qlib and MLflow for Unified Experiment Tracking/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/qlib-hft-ai>Qlib’s Nested Execution for High-Frequency Trading with AI/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/qlib-portfolio-strategy>A Comprehensive Guide to Qlib’s Portfolio Strategy, TopkDropoutStrategy, and EnhancedIndexingStrategy/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/qlib-ai-quant-workflow-scoreic>Understanding Score IC in Qlib for Enhanced Profit/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/qlib-ai-quant-workflow-pytorch-mlp>Powering Quant Finance with Qlib’s PyTorch MLP on Alpha360/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/qlib-ai-quant-workflow-lightgbm>Harnessing AI for Quantitative Finance with Qlib and LightGBM/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/qlib-ai-quant-workflow-adarnn>Adaptive Deep Learning in Quant Finance with Qlib’s PyTorch AdaRNN/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/understanding-gradient-descent-in-linear-regression>Understanding Gradient Descent in Linear Regression/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/understanding-linear-regression-in-machine-learning>Understanding Linear Regression in Machine Learning/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/technical-analysis-comparison-nvidia-partners>Technical Analysis of Key NVIDIA Partners - A Comparative Study/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/correct-exchange-mapping-ib-veighna>Correct Exchange Mapping in VeighNa to Resolve IB Security Definition Errors/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/understanding-sniper-algorithm-implementation>Understanding the Sniper Algorithm Implementation in Algorithmic Trading/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/backtesting-nvidia-moving-average-crossover-veighna>Backtesting NVIDIA Stock Strategies on VeighNa - Moving Average Crossover Strategy/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/automate-financial-data-collection-huggingface>Automating Financial Data Collection and Uploading to Hugging Face for Algorithmic Trading/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/algo-trading-veighna-interactive-brokers>Algorithmic Trading with VeighNa and Interactive Brokers - Installation Guide and Troubleshooting/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/predicting-bank-failures-gradient-descent>Predicting Bank Failures Using Gradient Descent and Machine Learning/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/gradient-descent-trading-algorithms>Understanding Gradient Descent and Its Applications in Trading Algorithms/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/euclidean-distance-trading-algorithms>Understanding Euclidean Distance and Its Applications in Trading Algorithms/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/bias-variance-tradeoff-ml>Understanding the Bias-Variance Tradeoff and No Free Lunch Theorem in Machine Learning/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/linear-regression-finance>Predicting Stock Returns Using Linear Regression in Finance/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/ai-ml-finance>Leveraging AI and Machine Learning in Finance - A Strategic Advantage/a>/li>li classsidebarItem_c0ih>a classsidebarItemLink_pNZK href/catboost-vs-xgboost>Enhancing Trading Strategies with AI - Comparing CatBoost and XGBoost/a>/li>/ul>/div>/nav>/aside>main classcol col--7>article classmargin-bottom--xl>header>h2 classtitle_dNhx>a href/claude-code-no-indexing>Claude Code Doesn't Index Your Codebase. Here's What It Does Instead./a>/h2>div classcontainer_doFt margin-vert--md>time datetime2026-03-03T00:00:00.000Z>March 3, 2026/time> · !-- -->21 min read/div>div classmargin-top--md margin-bottom--sm row>div classcol col--12 authorCol_hjHn>div classavatar margin-bottom--sm>a classavatar__photo-link href/authors/nicolad>img classavatar__photo authorImage_kUwH srchttps://github.com/nicolad.png altVadim Nicolai>/a>div classavatar__intro authorDetails_ToDN>div classavatar__name>a href/authors/nicolad>span classauthorName_MPGl translateno>Vadim Nicolai/span>/a>/div>small classauthorTitle_d5ss titleSenior Software Engineer>Senior Software Engineer/small>div classauthorSocials_OyCQ>a hrefhttps://github.com/nicolad target_blank relnoopener noreferrer classauthorSocialLink_gxZK titleGitHub>svg xmlnshttp://www.w3.org/2000/svg width1em height1em viewBox0 0 256 250 preserveAspectRatioxMidYMid style--dark:#000;--light:#fff classauthorSocialIcon_b4L1 githubSvg_uT5Q>path dM128.001 0C57.317 0 0 57.307 0 128.001c0 56.554 36.676 104.535 87.535 121.46 6.397 1.185 8.746-2.777 8.746-6.158 0-3.052-.12-13.135-.174-23.83-35.61 7.742-43.124-15.103-43.124-15.103-5.823-14.795-14.213-18.73-14.213-18.73-11.613-7.944.876-7.78.876-7.78 12.853.902 19.621 13.19 19.621 13.19 11.417 19.568 29.945 13.911 37.249 10.64 1.149-8.272 4.466-13.92 8.127-17.116-28.431-3.236-58.318-14.212-58.318-63.258 0-13.975 5-25.394 13.188-34.358-1.329-3.224-5.71-16.242 1.24-33.874 0 0 10.749-3.44 35.21 13.121 10.21-2.836 21.16-4.258 32.038-4.307 10.878.049 21.837 1.47 32.066 4.307 24.431-16.56 35.165-13.12 35.165-13.12 6.967 17.63 2.584 30.65 1.255 33.873 8.207 8.964 13.173 20.383 13.173 34.358 0 49.163-29.944 59.988-58.447 63.157 4.591 3.972 8.682 11.762 8.682 23.704 0 17.126-.148 30.91-.148 35.126 0 3.407 2.304 7.398 8.792 6.14C219.37 232.5 256 184.537 256 128.002 256 57.307 198.691 0 128.001 0Zm-80.06 182.34c-.282.636-1.283.827-2.194.39-.929-.417-1.45-1.284-1.15-1.922.276-.655 1.279-.838 2.205-.399.93.418 1.46 1.293 1.139 1.931Zm6.296 5.618c-.61.566-1.804.303-2.614-.591-.837-.892-.994-2.086-.375-2.66.63-.566 1.787-.301 2.626.591.838.903 1 2.088.363 2.66Zm4.32 7.188c-.785.545-2.067.034-2.86-1.104-.784-1.138-.784-2.503.017-3.05.795-.547 2.058-.055 2.861 1.075.782 1.157.782 2.522-.019 3.08Zm7.304 8.325c-.701.774-2.196.566-3.29-.49-1.119-1.032-1.43-2.496-.726-3.27.71-.776 2.213-.558 3.315.49 1.11 1.03 1.45 2.505.701 3.27Zm9.442 2.81c-.31 1.003-1.75 1.459-3.199 1.033-1.448-.439-2.395-1.613-2.103-2.626.301-1.01 1.747-1.484 3.207-1.028 1.446.436 2.396 1.602 2.095 2.622Zm10.744 1.193c.036 1.055-1.193 1.93-2.715 1.95-1.53.034-2.769-.82-2.786-1.86 0-1.065 1.202-1.932 2.733-1.958 1.522-.03 2.768.818 2.768 1.868Zm10.555-.405c.182 1.03-.875 2.088-2.387 2.37-1.485.271-2.861-.365-3.05-1.386-.184-1.056.893-2.114 2.376-2.387 1.514-.263 2.868.356 3.061 1.403Z>/path>/svg>/a>a hrefhttps://www.linkedin.com/in/vadimnicolai/ target_blank relnoopener noreferrer classauthorSocialLink_gxZK titleLinkedIn>svg xmlnshttp://www.w3.org/2000/svg width1em height1em preserveAspectRatioxMidYMid viewBox0 0 256 256 style--dark:#0a66c2;--light:#ffffffe6 classauthorSocialIcon_b4L1 linkedinSvg_nq_B>path dM218.123 218.127h-37.931v-59.403c0-14.165-.253-32.4-19.728-32.4-19.756 0-22.779 15.434-22.779 31.369v60.43h-37.93V95.967h36.413v16.694h.51a39.907 39.907 0 0 1 35.928-19.733c38.445 0 45.533 25.288 45.533 58.186l-.016 67.013ZM56.955 79.27c-12.157.002-22.014-9.852-22.016-22.009-.002-12.157 9.851-22.014 22.008-22.016 12.157-.003 22.014 9.851 22.016 22.008A22.013 22.013 0 0 1 56.955 79.27m18.966 138.858H37.95V95.967h37.97v122.16ZM237.033.018H18.89C8.58-.098.125 8.161-.001 18.471v219.053c.122 10.315 8.576 18.582 18.89 18.474h218.144c10.336.128 18.823-8.139 18.966-18.474V18.454c-.147-10.33-8.635-18.588-18.966-18.453>/path>/svg>/a>/div>/div>/div>/div>/div>/header>div classmarkdown>p>em>Last verified: March 2026/em>/p>p>Boris Cherny's team built RAG into early Claude Code. They tested it against agentic search. Agentic search won — not narrowly. A Claude engineer confirmed it in a Hacker News thread: "In our testing we found that agentic search outperformed it by a lot, and this was surprising."/p>p>That thread is the clearest primary source on how Claude Code actually works — and why it works that way. Most articles on the topic paraphrase it from memory. This one starts from the source./p>blockquote>p>strong>Q: Does Claude Code index your codebase?/strong>strong>A:/strong> No. Claude Code does not pre-index your codebase or use vector embeddings. Instead, it uses filesystem tools — Glob for file pattern matching, Grep for content search, and Read for loading specific files — to explore code on demand as it works through each task. Anthropic calls this "agentic search."/p>/blockquote>hr>h2 classanchor anchorTargetStickyNavbar_eHHq idthe-confession-what-boris-cherny-actually-said>The Confession: What Boris Cherny Actually Saida href#the-confession-what-boris-cherny-actually-said classhash-link aria-labelDirect link to The Confession: What Boris Cherny Actually Said titleDirect link to The Confession: What Boris Cherny Actually Said translateno>/a>/h2>p>In a a hrefhttps://news.ycombinator.com/item?id43164253 target_blank relnoopener noreferrer class>public Hacker News thread/a>, Boris Cherny — principal software engineer at Anthropic and Claude Code's creator — wrote this directly:/p>blockquote>p>"Early versions of Claude Code used RAG + a local vector db, but we found pretty quickly that agentic search generally works better. It is also simpler and doesn't have the same issues around security, privacy, staleness, and reliability."/p>/blockquote>p>That post on a hrefhttps://x.com/bcherny/status/2017824286489383315 target_blank relnoopener noreferrer class>X/Twitter/a> was followed by a comment from a Claude engineer in the same HN thread: "Right — Claude Code doesn't use RAG currently. In our testing we found that agentic search outperformed it by a lot, and this was surprising."/p>p>The "surprising" qualifier matters. This was not a story where the team started with a principled position and built to confirm it. They built RAG, tested it, found it underperformed, and redesigned. The result is an architecture that runs against the grain of every major competing tool — and the gap is not accidental./p>p>Cherny's background shapes how to read this decision. Before Anthropic, he was a principal engineer at Meta. He describes Claude Code's origin as a personal experiment: he gave the model a bash tool, watched it autonomously write AppleScript to query his music library, and realized the implication. An agent with tools beats a script with pre-retrieved context. That insight drove Claude Code's entire design. The a hrefhttps://www.ycombinator.com/library/NJ-inside-claude-code-with-its-creator-boris-cherny target_blank relnoopener noreferrer class>YC Startup Library interview/a> goes deeper on this philosophy: Cherny believes the future of development lies in "agent topologies" — multiple agents with fresh, isolated context windows working in parallel, not a single large agent with accumulated, polluted memory./p>p>The architectural bet against indexing is downstream from that belief./p>hr>h2 classanchor anchorTargetStickyNavbar_eHHq idhow-claude-code-actually-searches-your-code>How Claude Code Actually Searches Your Codea href#how-claude-code-actually-searches-your-code classhash-link aria-labelDirect link to How Claude Code Actually Searches Your Code titleDirect link to How Claude Code Actually Searches Your Code translateno>/a>/h2>p>"Agentic" means the model drives the search process rather than receiving pre-retrieved context. Claude Code decides what to look for, picks the right tool, acts on the result, and loops until it has enough to complete the task. The loop is think → act → observe → repeat, continuing until the model produces a plain text response with no tool call attached./p>p>What makes this work in practice is that the tools have very different cost profiles — and Claude Code is designed to use them in cost order./p>h3 classanchor anchorTargetStickyNavbar_eHHq idthe-tool-hierarchy-with-token-economics>The Tool Hierarchy with Token Economicsa href#the-tool-hierarchy-with-token-economics classhash-link aria-labelDirect link to The Tool Hierarchy with Token Economics titleDirect link to The Tool Hierarchy with Token Economics translateno>/a>/h3>table>thead>tr>th>Tool/th>th>What It Does/th>th>Token Cost/th>th>Use Case/th>/tr>/thead>tbody>tr>td>strong>Glob/strong>/td>td>File path pattern matching/td>td>Near-zero — returns paths only/td>td>code>workers/**/*.toml/code>, code>src/**/*.graphql/code>/td>/tr>tr>td>strong>Grep/strong>/td>td>Regex content search (powered by ripgrep)/td>td>Lightweight — returns matching lines/td>td>code>createD1HttpClient/code>, code>is_remote_eu/code>/td>/tr>tr>td>strong>Read/strong>/td>td>Full file contents into context/td>td>Heavy — 500–5,000 tokens per file/td>td>Confirm and load a specific file/td>/tr>tr>td>strong>Explore agent/strong>/td>td>Isolated read-only sub-agent (Haiku model)/td>td>Isolated — does not touch main context window/td>td>Deep codebase exploration across many files/td>/tr>/tbody>/table>p>Eighteen built-in tools are confirmed in a hrefhttps://www.blog.brightcoding.dev/2025/07/17/inside-claude-code-a-deep-dive-reverse-engineering-report/ target_blank relnoopener noreferrer class>BrightCoding's reverse-engineering of Claude Code's minified JS/a>, including Bash, Grep, Glob, Read, WebFetch, and the Task tool that spawns sub-agents. The a hrefhttps://github.com/Piebald-AI/claude-code-system-prompts target_blank relnoopener noreferrer class>Piebald-AI GitHub repo/a> tracks all system prompt components and sub-agent prompts per version, updated within minutes of each Claude Code release. a hrefhttps://medium.com/@georgesung/tracing-claude-codes-llm-traffic-agentic-loop-sub-agents-tool-use-prompts-7796941806f5 target_blank relnoopener noreferrer class>George Sung independently confirmed/a> the same loop structure in January 2026 by forking Ollama to intercept API traffic./p>p>strong>Glob/strong> is the opening move. code>workers/**/*.toml/code> costs almost nothing — it returns file paths, not file contents. Claude Code uses Glob to narrow the search space before any expensive operations begin./p>p>strong>Grep/strong> does heavier lifting: searching file contents by regex. Running code>grep -r "createD1HttpClient" ./code> returns every line containing that string, with surrounding context. It is fast, exact, and composable. Claude Code chains Grep calls the way a developer would in a terminal — each search informed by the previous result, progressively narrowing toward the relevant files./p>div classlanguage-bash codeBlockContainer_Yv7m theme-code-block style--prism-color:#F8F8F2;--prism-background-color:#282A36>div classcodeBlockContent_RrKf>pre tabindex0 classprism-code language-bash codeBlock_bNmq thin-scrollbar stylecolor:#F8F8F2;background-color:#282A36>code classcodeBlockLines_bZid>span classtoken-line stylecolor:#F8F8F2>span classtoken plain># The kind of grep chain Claude Code runs:/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>grep -r "createD1HttpClient" src//span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>grep -r "D1HttpClient" src/db//span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>grep -r "import.*d1-http" src//span>br>/span>/code>/pre>/div>/div>p>strong>Read/strong> loads a full file into the context window. A 200-line TypeScript file costs roughly 500–1,500 tokens. Claude Code reserves Read for files already identified as relevant via Glob and Grep — it is the confirm step, not the discovery tool./p>h3 classanchor anchorTargetStickyNavbar_eHHq idthe-explore-sub-agent-architecture>The Explore Sub-Agent Architecturea href#the-explore-sub-agent-architecture classhash-link aria-labelDirect link to The Explore Sub-Agent Architecture titleDirect link to The Explore Sub-Agent Architecture translateno>/a>/h3>p>For deep exploration, Claude Code spawns an Explore sub-agent: a read-only specialist that runs on the Haiku model inside its own isolated context window. The a hrefhttps://github.com/Piebald-AI/claude-code-system-prompts target_blank relnoopener noreferrer class>Piebald-AI repo/a> documents three sub-agent prompt types with their sizes as of current versions: Explore agent (516 tokens), Plan mode enhanced (633 tokens), Task tool (294 tokens)./p>p>The Explore agent can Glob, Grep, Read, and run limited Bash (list, copy, move). It cannot create or modify files. When it finishes, it returns a summary to the main agent — not raw file contents. That summary preserves the insight while discarding the tokens./p>p>This is the key isolation property: exploration work does not consume the main conversation's context budget. Cherny has described this as essential to his "agent topologies" philosophy — fresh context windows prevent the main session from accumulating irrelevant content from early searches that turned out to be dead ends./p>blockquote>p>strong>Q: How does Claude Code search code in large repositories?/strong>strong>A:/strong> Claude Code uses a three-tool hierarchy: Glob (lightweight file path pattern matching), Grep (content search returning matching lines), and Read (full file content into context). For deep exploration, it spawns an Explore sub-agent — a read-only Haiku model with its own isolated context window — to keep heavy search from consuming the main conversation's token budget./p>/blockquote>hr>h2 classanchor anchorTargetStickyNavbar_eHHq idthe-economics-why-this-approach-is-viable-at-scale>The Economics: Why This Approach Is Viable at Scalea href#the-economics-why-this-approach-is-viable-at-scale classhash-link aria-labelDirect link to The Economics: Why This Approach Is Viable at Scale titleDirect link to The Economics: Why This Approach Is Viable at Scale translateno>/a>/h2>p>The most important financial fact about Claude Code's architecture is the 92% prompt prefix reuse rate. a hrefhttps://blog.lmcache.ai/en/2025/12/23/context-engineering-reuse-pattern-under-the-hood-of-claude-code/ target_blank relnoopener noreferrer class>LMCache's December 2025 analysis/a> found that across all phases of Claude Code's agentic loop — including the ReAct-based sub-agent loops — the same prefix (system prompt, tool definitions, CLAUDE.md contents) appears in 92% of turns./p>p>This matters because of how Anthropic's prompt caching works: cache write tokens cost 1.25x base price, but cache read tokens cost only 0.1x. For a 2M-token session, processing without caching costs span classkatex>span classkatex-mathml>math xmlnshttp://www.w3.org/1998/Math/MathML>semantics>mrow>mn>6.00./mn>mi>W/mi>mi>i/mi>mi>t/mi>mi>h/mi>mi>p/mi>mi>r/mi>mi>e/mi>mi>f/mi>mi>i/mi>mi>x/mi>mi>c/mi>mi>a/mi>mi>c/mi>mi>h/mi>mi>i/mi>mi>n/mi>mi>g/mi>mi>a/mi>mi>t/mi>mn>92/mn>/mrow>annotation encodingapplication/x-tex>6.00. With prefix caching at 92% reuse, that drops to /annotation>/semantics>/math>/span>span classkatex-html aria-hiddentrue>span classbase>span classstrut styleheight:0.8889em;vertical-align:-0.1944em>/span>span classmord>6.00./span>span classmord mathnormal stylemargin-right:0.13889em>W/span>span classmord mathnormal>i/span>span classmord mathnormal>t/span>span classmord mathnormal>h/span>span classmord mathnormal>p/span>span classmord mathnormal stylemargin-right:0.02778em>r/span>span classmord mathnormal>e/span>span classmord mathnormal stylemargin-right:0.10764em>f/span>span classmord mathnormal>i/span>span classmord mathnormal>x/span>span classmord mathnormal>c/span>span classmord mathnormal>a/span>span classmord mathnormal>c/span>span classmord mathnormal>hin/span>span classmord mathnormal stylemargin-right:0.03588em>g/span>span classmord mathnormal>a/span>span classmord mathnormal>t/span>span classmord>92/span>/span>/span>/span>1.152 — an 81% cost reduction./p>p>Without this, the "burn tokens iteratively" critique would be damning. With it, the economics of agentic search become defensible even on large codebases./p>p>There is a real pricing cliff to understand. Claude API input tokens are priced at span classkatex>span classkatex-mathml>math xmlnshttp://www.w3.org/1998/Math/MathML>semantics>mrow>mn>3/mn>mi mathvariantnormal>//mi>mi>m/mi>mi>i/mi>mi>l/mi>mi>l/mi>mi>i/mi>mi>o/mi>mi>n/mi>mi>u/mi>mi>p/mi>mi>t/mi>mi>o/mi>mn>200/mn>mi>K/mi>mi>t/mi>mi>o/mi>mi>k/mi>mi>e/mi>mi>n/mi>mi>s/mi>mi>p/mi>mi>e/mi>mi>r/mi>mi>r/mi>mi>e/mi>mi>q/mi>mi>u/mi>mi>e/mi>mi>s/mi>mi>t/mi>mo separatortrue>;/mo>mi>b/mi>mi>e/mi>mi>y/mi>mi>o/mi>mi>n/mi>mi>d/mi>mn>200/mn>mi>K/mi>mo separatortrue>,/mo>mi>a/mi>mi>l/mi>mi>l/mi>mi>t/mi>mi>o/mi>mi>k/mi>mi>e/mi>mi>n/mi>mi>s/mi>mi>i/mi>mi>n/mi>mi>t/mi>mi>h/mi>mi>a/mi>mi>t/mi>mi>r/mi>mi>e/mi>mi>q/mi>mi>u/mi>mi>e/mi>mi>s/mi>mi>t/mi>mi>c/mi>mi>o/mi>mi>s/mi>mi>t/mi>/mrow>annotation encodingapplication/x-tex>3/million up to 200K tokens per request; beyond 200K, all tokens in that request cost /annotation>/semantics>/math>/span>span classkatex-html aria-hiddentrue>span classbase>span classstrut styleheight:1em;vertical-align:-0.25em>/span>span classmord>3//span>span classmord mathnormal>mi/span>span classmord mathnormal stylemargin-right:0.01968em>l/span>span classmord mathnormal stylemargin-right:0.01968em>l/span>span classmord mathnormal>i/span>span classmord mathnormal>o/span>span classmord mathnormal>n/span>span classmord mathnormal>u/span>span classmord mathnormal>pt/span>span classmord mathnormal>o/span>span classmord>200/span>span classmord mathnormal stylemargin-right:0.07153em>K/span>span classmord mathnormal>t/span>span classmord mathnormal>o/span>span classmord mathnormal stylemargin-right:0.03148em>k/span>span classmord mathnormal>e/span>span classmord mathnormal>n/span>span classmord mathnormal>s/span>span classmord mathnormal>p/span>span classmord mathnormal stylemargin-right:0.02778em>er/span>span classmord mathnormal stylemargin-right:0.02778em>r/span>span classmord mathnormal>e/span>span classmord mathnormal stylemargin-right:0.03588em>q/span>span classmord mathnormal>u/span>span classmord mathnormal>es/span>span classmord mathnormal>t/span>span classmpunct>;/span>span classmspace stylemargin-right:0.1667em>/span>span classmord mathnormal>b/span>span classmord mathnormal stylemargin-right:0.03588em>ey/span>span classmord mathnormal>o/span>span classmord mathnormal>n/span>span classmord mathnormal>d/span>span classmord>200/span>span classmord mathnormal stylemargin-right:0.07153em>K/span>span classmpunct>,/span>span classmspace stylemargin-right:0.1667em>/span>span classmord mathnormal>a/span>span classmord mathnormal stylemargin-right:0.01968em>l/span>span classmord mathnormal stylemargin-right:0.01968em>l/span>span classmord mathnormal>t/span>span classmord mathnormal>o/span>span classmord mathnormal stylemargin-right:0.03148em>k/span>span classmord mathnormal>e/span>span classmord mathnormal>n/span>span classmord mathnormal>s/span>span classmord mathnormal>in/span>span classmord mathnormal>t/span>span classmord mathnormal>ha/span>span classmord mathnormal>t/span>span classmord mathnormal stylemargin-right:0.02778em>r/span>span classmord mathnormal>e/span>span classmord mathnormal stylemargin-right:0.03588em>q/span>span classmord mathnormal>u/span>span classmord mathnormal>es/span>span classmord mathnormal>t/span>span classmord mathnormal>cos/span>span classmord mathnormal>t/span>/span>/span>/span>6/million — a 2x jump. This is a hard threshold, not a gradual escalation. Agentic sessions that accumulate significant context must manage this cliff deliberately. a hrefhttps://code.claude.com/docs/en/costs target_blank relnoopener noreferrer class>Anthropic's cost documentation/a> estimates heavy API coding sessions at span classkatex>span classkatex-mathml>math xmlnshttp://www.w3.org/1998/Math/MathML>semantics>mrow>mn>3/mn>mo separatortrue>,/mo>mn>650/mn>mo>+/mo>mi mathvariantnormal>//mi>mi>m/mi>mi>o/mi>mi>n/mi>mi>t/mi>mi>h/mi>mi mathvariantnormal>./mi>mi>C/mi>mi>l/mi>mi>a/mi>mi>u/mi>mi>d/mi>mi>e/mi>mi>M/mi>mi>a/mi>mi>x/mi>mi>a/mi>mi>t/mi>/mrow>annotation encodingapplication/x-tex>3,650+/month. Claude Max at /annotation>/semantics>/math>/span>span classkatex-html aria-hiddentrue>span classbase>span classstrut styleheight:0.8389em;vertical-align:-0.1944em>/span>span classmord>3/span>span classmpunct>,/span>span classmspace stylemargin-right:0.1667em>/span>span classmord>650/span>span classmspace stylemargin-right:0.2222em>/span>span classmbin>+/span>span classmspace stylemargin-right:0.2222em>/span>/span>span classbase>span classstrut styleheight:1em;vertical-align:-0.25em>/span>span classmord>//span>span classmord mathnormal>m/span>span classmord mathnormal>o/span>span classmord mathnormal>n/span>span classmord mathnormal>t/span>span classmord mathnormal>h/span>span classmord>./span>span classmord mathnormal stylemargin-right:0.07153em>C/span>span classmord mathnormal stylemargin-right:0.01968em>l/span>span classmord mathnormal>a/span>span classmord mathnormal>u/span>span classmord mathnormal>d/span>span classmord mathnormal>e/span>span classmord mathnormal stylemargin-right:0.10903em>M/span>span classmord mathnormal>a/span>span classmord mathnormal>x/span>span classmord mathnormal>a/span>span classmord mathnormal>t/span>/span>/span>/span>200/month works out to approximately 18x cheaper for intensive use — which is why most developers using Claude Code heavily are on the subscription plan rather than the API./p>p>The latency problem with sequential tool calls is real — but being solved. a hrefhttps://relace.ai/blog/fast-agentic-search target_blank relnoopener noreferrer class>Relace's Fast Agentic Search (FAS)/a> showed what is possible: an RL-trained sub-agent calling 4–12 tools in parallel instead of sequentially. Each sequential tool call takes 1–2 seconds; 20 sequential turns means 20–40 seconds of latency. FAS reduced 20 turns to 5 and 10 turns to 4, a 4x latency reduction, while maintaining accuracy comparable to Claude Sonnet 4.5. The bottleneck is sequential execution, not the agentic approach itself./p>hr>h2 classanchor anchorTargetStickyNavbar_eHHq idhow-the-competition-does-it-cursor-windsurf-and-copilot>How the Competition Does It: Cursor, Windsurf, and Copilota href#how-the-competition-does-it-cursor-windsurf-and-copilot classhash-link aria-labelDirect link to How the Competition Does It: Cursor, Windsurf, and Copilot titleDirect link to How the Competition Does It: Cursor, Windsurf, and Copilot translateno>/a>/h2>p>Claude Code's no-index bet cuts against the design of every major competing tool./p>table>thead>tr>th>Tool/th>th>Search Strategy/th>th>Index Location/th>th>Privacy Model/th>th>Freshness/th>/tr>/thead>tbody>tr>td>strong>Claude Code/strong>/td>td>Agentic: Glob → Grep → Read → Explore agents/td>td>No index (runtime search)/td>td>Data never leaves machine/td>td>Always current (filesystem reads)/td>/tr>tr>td>strong>Cursor/strong>/td>td>Semantic vector RAG + optional @Codebase/td>td>Turbopuffer (cloud) + local cache/td>td>Embeddings + masked paths in cloud/td>td>Merkle-tree delta sync; incremental lag/td>/tr>tr>td>strong>Windsurf Cascade/strong>/td>td>AST-level semantic RAG, local index/td>td>Local (+ optional remote)/td>td>Local-first; enterprise options/td>td>Auto-updated on file change/td>/tr>tr>td>strong>GitHub Copilot/strong>/td>td>Code-tuned transformer embeddings/td>td>GitHub API (remote) + local for under 750 files/td>td>Embeddings in GitHub cloud/td>td>Indexed per commit; local for uncommitted/td>/tr>tr>td>strong>Zed AI/strong>/td>td>Automatic context discovery (agentic-leaning)/td>td>Varies by model provider/td>td>Depends on provider/td>td>Runtime/td>/tr>/tbody>/table>p>strong>Cursor/strong> is the most technically detailed comparison. The a hrefhttps://read.engineerscodex.com/p/how-cursor-indexes-codebases-fast target_blank relnoopener noreferrer class>Engineers Codex analysis/a> documents the full pipeline: Cursor computes a Merkle tree of hashes of all valid files, sends delta diffs to AWS-cached embedding storage, and queries a hrefhttps://turbopuffer.com target_blank relnoopener noreferrer class>Turbopuffer/a> — a serverless vector and full-text search engine — at inference time. Only metadata is stored in the cloud: masked paths (each path component hashed with a secret key and fixed nonce), line ranges, and embedding vectors. Raw source code never leaves the machine. Indexing time dropped from a median of 7.87s to 525ms after optimization. Cursor shows an index status indicator; Claude Code shows nothing, because nothing needs to build./p>p>strong>Windsurf Cascade/strong> takes a different approach: AST-level indexing, building semantic blocks at function, method, and class boundaries rather than naive text chunks. The index starts immediately on workspace open and stays updated automatically on file change. It is local-first, which gives it the freshness advantage of no sync lag./p>p>strong>GitHub Copilot/strong> went generally available with semantic search in a hrefhttps://github.blog/changelog/2025-03-12-instant-semantic-code-search-indexing-now-generally-available-for-github-copilot/ target_blank relnoopener noreferrer class>March 2025/a>. The embedding model is a proprietary transformer fine-tuned on source code. For projects under 750 files, VS Code builds a local advanced index automatically; 750–2,500 files requires a manual trigger; above 2,500 falls back to a basic index. Uncommitted changes use a hybrid local approach./p>p>The user experience difference is immediate: Cursor and Copilot require a setup phase with progress indicators. Claude Code requires nothing. That zero-friction start is not just UX polish — it reflects the architecture. There is genuinely nothing to build./p>blockquote>p>strong>Q: What is the difference between Claude Code and Cursor indexing?/strong>strong>A:/strong> Cursor proactively indexes your codebase using tree-sitter chunking and vector embeddings stored in Turbopuffer, updated incrementally via Merkle tree sync. Claude Code does not index at all — it searches on demand using grep-style exact-match tools. Cursor wins on semantic and conceptual search; Claude Code wins on precision, freshness, and zero setup time./p>/blockquote>hr>h2 classanchor anchorTargetStickyNavbar_eHHq idwhy-anthropic-chose-grep-over-embeddings>Why Anthropic Chose Grep Over Embeddingsa href#why-anthropic-chose-grep-over-embeddings classhash-link aria-labelDirect link to Why Anthropic Chose Grep Over Embeddings titleDirect link to Why Anthropic Chose Grep Over Embeddings translateno>/a>/h2>blockquote>p>strong>Q: Why doesn't Claude Code use RAG?/strong>strong>A:/strong> Claude Code's creator Boris Cherny explained on Hacker News that early versions did use RAG with a local vector database, but the team found agentic search consistently outperformed it. The main reasons: precision (grep finds exact matches, embeddings introduce fuzzy positives), simplicity (no index to build or maintain), freshness (a pre-built index drifts from code during active editing), and privacy (no data leaves the machine for embedding computation)./p>/blockquote>p>The precision argument is the strongest one for code specifically. code>createD1HttpClient/code> either appears in a file or it does not. There is no fuzzy positive. Vector embeddings can surface "conceptually adjacent" code that shares no tokens with the target symbol — and in a coding context, conceptual adjacency without textual match is usually noise, not signal./p>p>There is also academic validation. An a hrefhttps://arxiv.org/abs/2602.23368 target_blank relnoopener noreferrer class>Amazon Science paper published February 2026/a> (arXiv 2602.23368, "Keyword Search Is All You Need") ran a systematic comparison of RAG against agentic keyword search across retrieval tasks and found that keyword search via agentic tool use achieves over 90% of RAG-level performance without a vector database. The benchmark focused on document Q&A rather than code navigation specifically — but the principle that exact-match retrieval with iterative refinement competes with semantic search holds in the code context where symbols are precise by definition./p>p>Anthropic's own engineering blog makes the philosophical case explicit. Their September 2025 post, a hrefhttps://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents target_blank relnoopener noreferrer class>"Effective Context Engineering for AI Agents"/a>, states: "Good context engineering means finding the smallest possible set of high-signal tokens that maximize the likelihood of some desired outcome." The "just in time" framing is key — agents should maintain lightweight identifiers (file paths, function names) and load data at runtime rather than pre-loading a large static context./p>p>The December 2024 a hrefhttps://www.anthropic.com/research/building-effective-agents target_blank relnoopener noreferrer class>"Building Effective Agents"/a> post reinforces this: "The most successful implementations use simple, composable patterns rather than complex frameworks." The basic building block is an LLM enhanced with retrieval, tools, and memory — but critically, with the model generating its own search queries rather than receiving pre-retrieved context./p>p>Four specific objections drove the RAG abandonment decision. strong>Security/strong>: an index stored somewhere is a target; Cursor's path masking adds cryptographic complexity that Claude Code avoids entirely. strong>Privacy/strong>: embeddings of proprietary code leak information even as dense vectors; research on embedding inversion has shown partial text recovery in some settings. strong>Staleness/strong>: an index built at session start is stale as soon as the first file changes. strong>Reliability/strong>: every additional system is a failure point; vector DBs have latency spikes, embedding APIs have rate limits, sync pipelines have bugs./p>hr>h2 classanchor anchorTargetStickyNavbar_eHHq idthe-real-costs-token-burn-and-the-semantic-miss>The Real Costs: Token Burn and the Semantic Missa href#the-real-costs-token-burn-and-the-semantic-miss classhash-link aria-labelDirect link to The Real Costs: Token Burn and the Semantic Miss titleDirect link to The Real Costs: Token Burn and the Semantic Miss translateno>/a>/h2>p>The strongest published critique of agentic search came from a hrefhttps://milvus.io/blog/why-im-against-claude-codes-grep-only-retrieval-it-just-burns-too-many-tokens.md target_blank relnoopener noreferrer class>Milvus/a>. Their argument: "Grep is a dead end that drowns you in irrelevant matches, burns tokens, and stalls your workflow. Without semantic understanding, it's like asking your AI to debug blindfolded." They propose their Claude Context vector MCP plugin as a hybrid fix, claiming 40% token reduction./p>p>Milvus sells a vector database. That commercial interest is transparent and worth noting. It does not make the technical criticism wrong./p>p>The token burn problem is real on common terms. Search code>useState/code> across a React codebase and you will get hundreds of matches across dozens of files. Claude Code must either process all of them (expensive) or refine the query (adds turns). On codebases with inconsistent naming or high churn, the refinement loop can consume substantial context before reaching the target file./p>p>The 200K token pricing cliff makes this worse when hit: any request exceeding 200K input tokens pays 2x on all tokens in that request, not just the excess. The jump from span classkatex>span classkatex-mathml>math xmlnshttp://www.w3.org/1998/Math/MathML>semantics>mrow>mn>3/mn>mi mathvariantnormal>//mi>mi>m/mi>mi>i/mi>mi>l/mi>mi>l/mi>mi>i/mi>mi>o/mi>mi>n/mi>mi>t/mi>mi>o/mi>/mrow>annotation encodingapplication/x-tex>3/million to /annotation>/semantics>/math>/span>span classkatex-html aria-hiddentrue>span classbase>span classstrut styleheight:1em;vertical-align:-0.25em>/span>span classmord>3//span>span classmord mathnormal>mi/span>span classmord mathnormal stylemargin-right:0.01968em>l/span>span classmord mathnormal stylemargin-right:0.01968em>l/span>span classmord mathnormal>i/span>span classmord mathnormal>o/span>span classmord mathnormal>n/span>span classmord mathnormal>t/span>span classmord mathnormal>o/span>/span>/span>/span>6/million is a hard threshold, not a gradual escalation — and agentic sessions on large codebases with vague prompts can hit it faster than expected./p>p>The semantic miss problem is the other genuine limitation. Grep finds what you name. If code>createD1HttpClient/code> was renamed code>buildGatewayClient/code> six months ago, grep finds nothing. Vector embeddings preserve semantic relationships across renames — a real advantage on codebases with heavy refactoring history or cryptic abbreviation conventions./p>p>In practice, Claude Code compensates by running multiple searches: "auth", "session", "token", "middleware", "jwt", "bearer" — triangulating toward the module rather than naming it directly. This multi-step reasoning is something static embedding retrieval cannot do (a vector DB returns its top-k hits and stops). But it costs more turns and more tokens than a single well-placed semantic query would./p>p>Where agentic search wins clearly:/p>ul>li class>strong>Exact symbol lookup/strong> — function names, class names, import paths are precise by definition/li>li class>strong>Active editing sessions/strong> — grep reads current filesystem state; no index can be as fresh/li>li class>strong>Security and privacy contexts/strong> — zero data leaves the machine/li>li class>strong>Well-named, medium-sized codebases/strong> — consistent naming discipline eliminates most semantic miss risk/li>/ul>p>Where proactive indexing wins:/p>ul>li class>strong>Large monorepos/strong> — millions of lines where iterative grep exploration burns context faster than it narrows/li>li class>strong>Conceptual search/strong> — "find all places we handle authentication" without knowing exact symbol names/li>li class>strong>Unfamiliar codebases/strong> — when you cannot yet name what you are looking for, semantic similarity is more useful than exact match/li>li class>strong>Enterprise teams/strong> — persistent cross-session context without re-exploration cost/li>/ul>blockquote>p>strong>Q: Is agentic search better than RAG for code?/strong>strong>A:/strong> For many workloads, yes. A February 2026 Amazon Science paper (arXiv 2602.23368) found keyword search via agentic tool use achieves over 90% of RAG-level performance without a vector database. For code specifically, exact-match search outperforms semantic retrieval on stable, well-named codebases because code symbols are precise. RAG's advantage is on conceptual search across large repos with inconsistent naming./p>/blockquote>hr>h2 classanchor anchorTargetStickyNavbar_eHHq idwhat-developers-built-to-fill-the-gap>What Developers Built to Fill the Gapa href#what-developers-built-to-fill-the-gap classhash-link aria-labelDirect link to What Developers Built to Fill the Gap titleDirect link to What Developers Built to Fill the Gap translateno>/a>/h2>p>The community response to Claude Code's no-index architecture is itself a data point. Developers who needed semantic search on top of agentic search built it as an MCP extension rather than switching tools./p>p>Several projects emerged:/p>ul>li class>strong>a hrefhttps://github.com/zilliztech/claude-context target_blank relnoopener noreferrer class>Claude Context/a>/strong> (Milvus/Zilliz) — an MCP server adding vector-powered semantic search to Claude Code's tool set; the same Milvus that wrote the critique built the fix/li>li class>strong>a hrefhttps://github.com/evanrianto/claude-codebase-indexer target_blank relnoopener noreferrer class>claude-codebase-indexer/a>/strong> — vector-based search with intelligent chunking as a Claude Code add-on/li>li class>strong>a hrefhttps://github.com/ericbuess/claude-code-project-index target_blank relnoopener noreferrer class>claude-code-project-index/a>/strong> — a PROJECT_INDEX system for persistent architectural awareness across sessions/li>li class>strong>a hrefhttps://cocoindex.io/examples/code_index target_blank relnoopener noreferrer class>CocoIndex/a>/strong> — real-time codebase indexing designed to work alongside any AI coding agent/li>li class>strong>a hrefhttps://ast-grep.github.io target_blank relnoopener noreferrer class>ast-grep/a>/strong> — structural search understanding code ASTs, not raw text; finds patterns like "all arrow functions returning a Promise" without exact symbol names/li>/ul>p>The architectural significance: Claude Code is simultaneously an MCP client (connecting to external tool servers like these) and an MCP server (exposing its own file editing and command execution tools to Claude Desktop, Cursor, and Windsurf). The a hrefhttps://code.claude.com/docs/en/mcp target_blank relnoopener noreferrer class>MCP documentation/a> describes both directions. The no-index architecture is not a closed position — it is a composable default. Vector search is a plugin away for anyone who needs it./p>p>The community's response tells us who the current architecture serves well (developers on medium-to-large codebases with disciplined naming who need precision and privacy) and who it does not fully serve out of the box (teams working on large legacy systems with inconsistent conventions where conceptual search across sessions would save significant time)./p>hr>h2 classanchor anchorTargetStickyNavbar_eHHq idwhere-this-is-going>Where This Is Goinga href#where-this-is-going classhash-link aria-labelDirect link to Where This Is Going titleDirect link to Where This Is Going translateno>/a>/h2>p>Context windows keep expanding. Claude Sonnet 4.6 supports 1M tokens in beta. At that scale, the distinction between "indexing" and "just loading everything" starts to blur — a sufficiently large context window could theoretically hold a medium-sized codebase in its entirety./p>p>There is a catch. a hrefhttps://www.nxcode.io/resources/claude-1m-token-context-codebase-analysis-guide-2026 target_blank relnoopener noreferrer class>NxCode's analysis of Opus 4.6 at 1M tokens/a> documents a 17-point MRCR retrieval accuracy drop as context fills (93% at shorter contexts, 76% at 1M tokens). Large context is available but not free of quality degradation — models lose precision at the edges of their effective attention range. Loading an entire codebase into a context window does not guarantee the model uses that context accurately./p>p>Three trajectories are running in parallel:/p>p>strong>Agentic search improves its execution./strong> Relace's parallel tool call result — 4x latency reduction by calling 4–12 tools simultaneously via RL-trained optimization — shows the sequential bottleneck can be engineered away. The fundamental approach stays the same; the execution gets more efficient. Expect Claude Code's own tool execution to move in this direction./p>p>strong>Hybrid architectures become the production consensus./strong> The HN community thread on a hrefhttps://news.ycombinator.com/item?id47134263 target_blank relnoopener noreferrer class>agentic vs. RAG in production/a> reflects what practitioners are reaching for at enterprise scale: vector prefiltering to narrow candidates, followed by agentic confirmation. Faster first-query response from embeddings, precision and freshness from grep-based verification. Neither architecture alone is the final answer for the largest systems./p>p>strong>Context window economics change the calculus./strong> With 1M token contexts and Anthropic's 81% cost reduction from prefix caching, the "loading an entire codebase is prohibitively expensive" constraint is weakening. Anthropic's principle — "just in time retrieval of the smallest possible set of high-signal tokens" — remains the right engineering philosophy, but the practical threshold for "too large to load" keeps rising./p>p>What is not changing is Cherny's underlying bet. Claude Code is a hrefhttps://www.latent.space/p/claude-code target_blank relnoopener noreferrer class>described by its creator as "a Unix utility, not a product"/a>. The design principle is "do the simple thing first": memory is a markdown file, prompt summarization is done simply, search is grep. Complexity is deferred until it is demonstrated to be necessary. The RAG experiment demonstrated it was not — at least not for the majority of workloads./p>p>The one scenario where indexing becomes necessary is the scenario that is genuinely hard to grep: a monorepo at Google or Meta scale, with millions of files, multiple programming languages, decades of naming inconsistency, and teams who need to ask conceptual questions about code they have never read. That is a real workload. It is not the workload Claude Code was designed for./p>p>For the rest — developers working on their own codebases, on team projects with shared naming conventions, on repositories they understand well enough to name what they are looking for — the agentic search approach holds. Grep is precise, fresh, and private. The model learns to search the way you would, because it has the same tools you do. And as 1M-token context windows become the baseline, the gap between "search" and "load everything" shrinks further — which means the principle Anthropic bet on (retrieve just in time, keep context tight, prefer simplicity) only becomes more relevant as the underlying capability improves./p>hr>h2 classanchor anchorTargetStickyNavbar_eHHq idreferences>Referencesa href#references classhash-link aria-labelDirect link to References titleDirect link to References translateno>/a>/h2>p>strong>Primary sources/strong>/p>ul>li class>a hrefhttps://x.com/bcherny/status/2017824286489383315 target_blank relnoopener noreferrer class>Boris Cherny on X — RAG abandoned quote/a>/li>li class>a hrefhttps://news.ycombinator.com/item?id43164253 target_blank relnoopener noreferrer class>Hacker News thread — Claude engineer confirmation (item 43164253)/a>/li>li class>a hrefhttps://www.ycombinator.com/library/NJ-inside-claude-code-with-its-creator-boris-cherny target_blank relnoopener noreferrer class>Inside Claude Code with Boris Cherny — YC Startup Library/a>/li>li class>a hrefhttps://www.anthropic.com/research/building-effective-agents target_blank relnoopener noreferrer class>Anthropic: Building Effective Agents/a> (Dec 2024)/li>li class>a hrefhttps://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents target_blank relnoopener noreferrer class>Anthropic: Effective Context Engineering for AI Agents/a> (Sep 2025)/li>li class>a hrefhttps://code.claude.com/docs/en/overview target_blank relnoopener noreferrer class>Claude Code official documentation/a>/li>li class>a hrefhttps://code.claude.com/docs/en/costs target_blank relnoopener noreferrer class>Claude Code: costs/a>/li>li class>a hrefhttps://www.latent.space/p/claude-code target_blank relnoopener noreferrer class>Claude Code on Latent Space Podcast/a>/li>/ul>p>strong>Architecture and reverse engineering/strong>/p>ul>li class>a hrefhttps://www.blog.brightcoding.dev/2025/07/17/inside-claude-code-a-deep-dive-reverse-engineering-report/ target_blank relnoopener noreferrer class>BrightCoding — Inside Claude Code: Deep-Dive Reverse Engineering Report/a>/li>li class>a hrefhttps://github.com/Piebald-AI/claude-code-system-prompts target_blank relnoopener noreferrer class>Piebald-AI/claude-code-system-prompts (GitHub)/a>/li>li class>a hrefhttps://blog.lmcache.ai/en/2025/12/23/context-engineering-reuse-pattern-under-the-hood-of-claude-code/ target_blank relnoopener noreferrer class>LMCache — Context Engineering & Reuse Pattern Under the Hood of Claude Code/a> (Dec 2025)/li>li class>a hrefhttps://medium.com/@georgesung/tracing-claude-codes-llm-traffic-agentic-loop-sub-agents-tool-use-prompts-7796941806f5 target_blank relnoopener noreferrer class>George Sung — Tracing Claude Code's LLM Traffic/a> (Jan 2026)/li>li class>a hrefhttps://kirshatrov.com/posts/claude-code-internals target_blank relnoopener noreferrer class>Kir Shatrov — Reverse engineering Claude Code/a>/li>/ul>p>strong>Competitor architecture/strong>/p>ul>li class>a hrefhttps://read.engineerscodex.com/p/how-cursor-indexes-codebases-fast target_blank relnoopener noreferrer class>How Cursor Indexes Codebases Fast — Engineers Codex/a>/li>li class>a hrefhttps://cursor.com/blog/secure-codebase-indexing target_blank relnoopener noreferrer class>Cursor Secure Codebase Indexing/a>/li>li class>a hrefhttps://docs.windsurf.com/context-awareness/remote-indexing target_blank relnoopener noreferrer class>Windsurf Remote Indexing Docs/a>/li>li class>a hrefhttps://github.blog/changelog/2025-03-12-instant-semantic-code-search-indexing-now-generally-available-for-github-copilot/ target_blank relnoopener noreferrer class>GitHub Copilot Semantic Search GA — GitHub Changelog/a> (Mar 2025)/li>/ul>p>strong>Performance and benchmarks/strong>/p>ul>li class>a hrefhttps://relace.ai/blog/fast-agentic-search target_blank relnoopener noreferrer class>Relace — Exploiting Parallel Tool Calls to Make Agentic Search 4x Faster/a>/li>li class>a hrefhttps://milvus.io/blog/why-im-against-claude-codes-grep-only-retrieval-it-just-burns-too-many-tokens.md target_blank relnoopener noreferrer class>Milvus — Why I'm Against Claude Code's Grep-Only Retrieval/a>/li>li class>a hrefhttps://arxiv.org/abs/2602.23368 target_blank relnoopener noreferrer class>arXiv 2602.23368 — Keyword Search Is All You Need/a> (Feb 2026)/li>li class>a hrefhttps://www.nxcode.io/resources/claude-1m-token-context-codebase-analysis-guide-2026 target_blank relnoopener noreferrer class>NxCode — Claude Opus 4.6 at 1M Token Context/a>/li>/ul>p>strong>Community tools/strong>/p>ul>li class>a hrefhttps://github.com/zilliztech/claude-context target_blank relnoopener noreferrer class>Claude Context MCP (Zilliz)/a>/li>li class>a hrefhttps://github.com/evanrianto/claude-codebase-indexer target_blank relnoopener noreferrer class>claude-codebase-indexer/a>/li>li class>a hrefhttps://github.com/ericbuess/claude-code-project-index target_blank relnoopener noreferrer class>claude-code-project-index/a>/li>li class>a hrefhttps://cocoindex.io/examples/code_index target_blank relnoopener noreferrer class>CocoIndex real-time codebase indexing/a>/li>li class>a hrefhttps://ast-grep.github.io target_blank relnoopener noreferrer class>ast-grep structural search/a>/li>/ul>/div>footer classrow docusaurus-mt-lg>div classcol>b>Tags:/b>ul classtags_eMma padding--none margin-left--sm>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/claude-code>claude-code/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/agentic-search>agentic-search/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/rag>RAG/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/coding-assistants>coding-assistants/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/context-engineering>context-engineering/a>/li>/ul>/div>/footer>/article>article classmargin-bottom--xl>header>h2 classtitle_dNhx>a href/pixel-perfect-playwright-figma-mcp>Pixel-Perfect UI with Playwright and Figma MCP: What Actually Works in 2026/a>/h2>div classcontainer_doFt margin-vert--md>time datetime2026-03-02T00:00:00.000Z>March 2, 2026/time> · !-- -->14 min read/div>div classmargin-top--md margin-bottom--sm row>div classcol col--12 authorCol_hjHn>div classavatar margin-bottom--sm>a classavatar__photo-link href/authors/nicolad>img classavatar__photo authorImage_kUwH srchttps://github.com/nicolad.png altVadim Nicolai>/a>div classavatar__intro authorDetails_ToDN>div classavatar__name>a href/authors/nicolad>span classauthorName_MPGl translateno>Vadim Nicolai/span>/a>/div>small classauthorTitle_d5ss titleSenior Software Engineer>Senior Software Engineer/small>div classauthorSocials_OyCQ>a hrefhttps://github.com/nicolad target_blank relnoopener noreferrer classauthorSocialLink_gxZK titleGitHub>svg xmlnshttp://www.w3.org/2000/svg width1em height1em viewBox0 0 256 250 preserveAspectRatioxMidYMid style--dark:#000;--light:#fff classauthorSocialIcon_b4L1 githubSvg_uT5Q>path dM128.001 0C57.317 0 0 57.307 0 128.001c0 56.554 36.676 104.535 87.535 121.46 6.397 1.185 8.746-2.777 8.746-6.158 0-3.052-.12-13.135-.174-23.83-35.61 7.742-43.124-15.103-43.124-15.103-5.823-14.795-14.213-18.73-14.213-18.73-11.613-7.944.876-7.78.876-7.78 12.853.902 19.621 13.19 19.621 13.19 11.417 19.568 29.945 13.911 37.249 10.64 1.149-8.272 4.466-13.92 8.127-17.116-28.431-3.236-58.318-14.212-58.318-63.258 0-13.975 5-25.394 13.188-34.358-1.329-3.224-5.71-16.242 1.24-33.874 0 0 10.749-3.44 35.21 13.121 10.21-2.836 21.16-4.258 32.038-4.307 10.878.049 21.837 1.47 32.066 4.307 24.431-16.56 35.165-13.12 35.165-13.12 6.967 17.63 2.584 30.65 1.255 33.873 8.207 8.964 13.173 20.383 13.173 34.358 0 49.163-29.944 59.988-58.447 63.157 4.591 3.972 8.682 11.762 8.682 23.704 0 17.126-.148 30.91-.148 35.126 0 3.407 2.304 7.398 8.792 6.14C219.37 232.5 256 184.537 256 128.002 256 57.307 198.691 0 128.001 0Zm-80.06 182.34c-.282.636-1.283.827-2.194.39-.929-.417-1.45-1.284-1.15-1.922.276-.655 1.279-.838 2.205-.399.93.418 1.46 1.293 1.139 1.931Zm6.296 5.618c-.61.566-1.804.303-2.614-.591-.837-.892-.994-2.086-.375-2.66.63-.566 1.787-.301 2.626.591.838.903 1 2.088.363 2.66Zm4.32 7.188c-.785.545-2.067.034-2.86-1.104-.784-1.138-.784-2.503.017-3.05.795-.547 2.058-.055 2.861 1.075.782 1.157.782 2.522-.019 3.08Zm7.304 8.325c-.701.774-2.196.566-3.29-.49-1.119-1.032-1.43-2.496-.726-3.27.71-.776 2.213-.558 3.315.49 1.11 1.03 1.45 2.505.701 3.27Zm9.442 2.81c-.31 1.003-1.75 1.459-3.199 1.033-1.448-.439-2.395-1.613-2.103-2.626.301-1.01 1.747-1.484 3.207-1.028 1.446.436 2.396 1.602 2.095 2.622Zm10.744 1.193c.036 1.055-1.193 1.93-2.715 1.95-1.53.034-2.769-.82-2.786-1.86 0-1.065 1.202-1.932 2.733-1.958 1.522-.03 2.768.818 2.768 1.868Zm10.555-.405c.182 1.03-.875 2.088-2.387 2.37-1.485.271-2.861-.365-3.05-1.386-.184-1.056.893-2.114 2.376-2.387 1.514-.263 2.868.356 3.061 1.403Z>/path>/svg>/a>a hrefhttps://www.linkedin.com/in/vadimnicolai/ target_blank relnoopener noreferrer classauthorSocialLink_gxZK titleLinkedIn>svg xmlnshttp://www.w3.org/2000/svg width1em height1em preserveAspectRatioxMidYMid viewBox0 0 256 256 style--dark:#0a66c2;--light:#ffffffe6 classauthorSocialIcon_b4L1 linkedinSvg_nq_B>path dM218.123 218.127h-37.931v-59.403c0-14.165-.253-32.4-19.728-32.4-19.756 0-22.779 15.434-22.779 31.369v60.43h-37.93V95.967h36.413v16.694h.51a39.907 39.907 0 0 1 35.928-19.733c38.445 0 45.533 25.288 45.533 58.186l-.016 67.013ZM56.955 79.27c-12.157.002-22.014-9.852-22.016-22.009-.002-12.157 9.851-22.014 22.008-22.016 12.157-.003 22.014 9.851 22.016 22.008A22.013 22.013 0 0 1 56.955 79.27m18.966 138.858H37.95V95.967h37.97v122.16ZM237.033.018H18.89C8.58-.098.125 8.161-.001 18.471v219.053c.122 10.315 8.576 18.582 18.89 18.474h218.144c10.336.128 18.823-8.139 18.966-18.474V18.454c-.147-10.33-8.635-18.588-18.966-18.453>/path>/svg>/a>/div>/div>/div>/div>/div>/header>div classmarkdown>p>I asked an AI coding assistant to implement a page layout from a Figma design. It got the heading size wrong (28px instead of 24px), inserted a 4px gap where there should have been 8px, and hallucinated a duplicate magnifying glass icon inside the search bar. The overall structure was fine. The details were not./p>p>This is the state of AI-assisted design-to-code in 2026. The tools get you 65-80% of the way there, then leave you in a no-man's land where the remaining pixels matter more than all the ones that came before. Every frontend engineer who has shipped production UI knows: "close enough" is not close enough./p>p>I spent a session trying to close that gap using the toolchain everyone is talking about -- Figma MCP for design context, headless Playwright for runtime measurement, and an AI assistant for the correction loop. Here is what happened, what broke, and what produced results./p>/div>footer classrow docusaurus-mt-lg>div classcol col--9>b>Tags:/b>ul classtags_eMma padding--none margin-left--sm>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/figma-mcp>figma-mcp/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/playwright>playwright/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/pixel-perfect>pixel-perfect/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/design-to-code>design-to-code/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/radix-themes>radix-themes/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/typescript>typescript/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/ai-coding>ai-coding/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/mcp>mcp/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/frontend>frontend/a>/li>/ul>/div>div classcol text--right col--3>a aria-labelRead more about Pixel-Perfect UI with Playwright and Figma MCP: What Actually Works in 2026 href/pixel-perfect-playwright-figma-mcp>b>Read more/b>/a>/div>/footer>/article>article classmargin-bottom--xl>header>h2 classtitle_dNhx>a href/two-paradigms-multi-agent-ai-rust-vs-claude-teams>Two Paradigms of Multi-Agent AI: Rust Parallel Agents vs Claude Code Agent Teams/a>/h2>div classcontainer_doFt margin-vert--md>time datetime2026-03-01T00:00:00.000Z>March 1, 2026/time> · !-- -->28 min read/div>div classmargin-top--md margin-bottom--sm row>div classcol col--12 authorCol_hjHn>div classavatar margin-bottom--sm>a classavatar__photo-link href/authors/nicolad>img classavatar__photo authorImage_kUwH srchttps://github.com/nicolad.png altVadim Nicolai>/a>div classavatar__intro authorDetails_ToDN>div classavatar__name>a href/authors/nicolad>span classauthorName_MPGl translateno>Vadim Nicolai/span>/a>/div>small classauthorTitle_d5ss titleSenior Software Engineer>Senior Software Engineer/small>div classauthorSocials_OyCQ>a hrefhttps://github.com/nicolad target_blank relnoopener noreferrer classauthorSocialLink_gxZK titleGitHub>svg xmlnshttp://www.w3.org/2000/svg width1em height1em viewBox0 0 256 250 preserveAspectRatioxMidYMid style--dark:#000;--light:#fff classauthorSocialIcon_b4L1 githubSvg_uT5Q>path dM128.001 0C57.317 0 0 57.307 0 128.001c0 56.554 36.676 104.535 87.535 121.46 6.397 1.185 8.746-2.777 8.746-6.158 0-3.052-.12-13.135-.174-23.83-35.61 7.742-43.124-15.103-43.124-15.103-5.823-14.795-14.213-18.73-14.213-18.73-11.613-7.944.876-7.78.876-7.78 12.853.902 19.621 13.19 19.621 13.19 11.417 19.568 29.945 13.911 37.249 10.64 1.149-8.272 4.466-13.92 8.127-17.116-28.431-3.236-58.318-14.212-58.318-63.258 0-13.975 5-25.394 13.188-34.358-1.329-3.224-5.71-16.242 1.24-33.874 0 0 10.749-3.44 35.21 13.121 10.21-2.836 21.16-4.258 32.038-4.307 10.878.049 21.837 1.47 32.066 4.307 24.431-16.56 35.165-13.12 35.165-13.12 6.967 17.63 2.584 30.65 1.255 33.873 8.207 8.964 13.173 20.383 13.173 34.358 0 49.163-29.944 59.988-58.447 63.157 4.591 3.972 8.682 11.762 8.682 23.704 0 17.126-.148 30.91-.148 35.126 0 3.407 2.304 7.398 8.792 6.14C219.37 232.5 256 184.537 256 128.002 256 57.307 198.691 0 128.001 0Zm-80.06 182.34c-.282.636-1.283.827-2.194.39-.929-.417-1.45-1.284-1.15-1.922.276-.655 1.279-.838 2.205-.399.93.418 1.46 1.293 1.139 1.931Zm6.296 5.618c-.61.566-1.804.303-2.614-.591-.837-.892-.994-2.086-.375-2.66.63-.566 1.787-.301 2.626.591.838.903 1 2.088.363 2.66Zm4.32 7.188c-.785.545-2.067.034-2.86-1.104-.784-1.138-.784-2.503.017-3.05.795-.547 2.058-.055 2.861 1.075.782 1.157.782 2.522-.019 3.08Zm7.304 8.325c-.701.774-2.196.566-3.29-.49-1.119-1.032-1.43-2.496-.726-3.27.71-.776 2.213-.558 3.315.49 1.11 1.03 1.45 2.505.701 3.27Zm9.442 2.81c-.31 1.003-1.75 1.459-3.199 1.033-1.448-.439-2.395-1.613-2.103-2.626.301-1.01 1.747-1.484 3.207-1.028 1.446.436 2.396 1.602 2.095 2.622Zm10.744 1.193c.036 1.055-1.193 1.93-2.715 1.95-1.53.034-2.769-.82-2.786-1.86 0-1.065 1.202-1.932 2.733-1.958 1.522-.03 2.768.818 2.768 1.868Zm10.555-.405c.182 1.03-.875 2.088-2.387 2.37-1.485.271-2.861-.365-3.05-1.386-.184-1.056.893-2.114 2.376-2.387 1.514-.263 2.868.356 3.061 1.403Z>/path>/svg>/a>a hrefhttps://www.linkedin.com/in/vadimnicolai/ target_blank relnoopener noreferrer classauthorSocialLink_gxZK titleLinkedIn>svg xmlnshttp://www.w3.org/2000/svg width1em height1em preserveAspectRatioxMidYMid viewBox0 0 256 256 style--dark:#0a66c2;--light:#ffffffe6 classauthorSocialIcon_b4L1 linkedinSvg_nq_B>path dM218.123 218.127h-37.931v-59.403c0-14.165-.253-32.4-19.728-32.4-19.756 0-22.779 15.434-22.779 31.369v60.43h-37.93V95.967h36.413v16.694h.51a39.907 39.907 0 0 1 35.928-19.733c38.445 0 45.533 25.288 45.533 58.186l-.016 67.013ZM56.955 79.27c-12.157.002-22.014-9.852-22.016-22.009-.002-12.157 9.851-22.014 22.008-22.016 12.157-.003 22.014 9.851 22.016 22.008A22.013 22.013 0 0 1 56.955 79.27m18.966 138.858H37.95V95.967h37.97v122.16ZM237.033.018H18.89C8.58-.098.125 8.161-.001 18.471v219.053c.122 10.315 8.576 18.582 18.89 18.474h218.144c10.336.128 18.823-8.139 18.966-18.474V18.454c-.147-10.33-8.635-18.588-18.966-18.453>/path>/svg>/a>/div>/div>/div>/div>/div>/header>div classmarkdown>div classtheme-admonition theme-admonition-tip admonition_pzgI alert alert--success>div classadmonitionHeading_mFfB>span classadmonitionIcon_jqV3>svg viewBox0 0 12 16>path fill-ruleevenodd dM6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z>/path>/svg>/span>TL;DR/div>div classadmonitionContent_Xy4E>p>Three multi-agent coordination positions, a hrefhttps://github.com/nicolad/nomadically.work target_blank relnoopener noreferrer class>one codebase/a>. A static Rust/Tokio fan-out assigns 20 agents at compile time with zero coordination overhead. A code>team.rs/code> library implements the full Claude Code agent-teams model in pure Rust — code>TaskQueue/code>, code>Mailbox/code>, code>PlanGate/code>, code>ShutdownToken/code> — and the code>study/code> pipeline now uses it to run a 2-step search→write flow with inter-worker messaging. Claude Code agent teams invert every assumption of static fan-out: dynamic task claiming, file-locked concurrency, full bidirectional messaging. The decision rule is one question: strong>do your agents need to talk to each other?/strong> If no, code>tokio::spawn/code> + code>Arc<T>/code>. If yes: build code>team.rs/code>, or use code>TeamCreate/code>./p>/div>/div>p>Multi-agent AI engineering has become a core discipline in production software development. The interesting question is no longer whether to build multi-agent systems. It is how — and specifically, which architectural pattern to reach for given the nature of the work. The clearest demonstration is that multiple fundamentally different paradigms live inside the a hrefhttps://github.com/nicolad/nomadically.work target_blank relnoopener noreferrer class>same codebase/a>./p>p>When this article was first published, the comparison was binary: the Rust crate used bare code>tokio::spawn/code> fan-out while Claude Code provided the coordination model. That binary is no longer accurate. The research crate now ships code>team.rs/code> — a 641-line generic coordination library in pure Rust that implements the complete Claude Code agent-teams model. The codebase now demonstrates all three positions simultaneously./p>h2 classanchor anchorTargetStickyNavbar_eHHq idwhy-multi-agent-ai-systems-are-having-a-moment-in-2026>Why Multi-Agent AI Systems Are Having a Moment in 2026a href#why-multi-agent-ai-systems-are-having-a-moment-in-2026 classhash-link aria-labelDirect link to Why Multi-Agent AI Systems Are Having a Moment in 2026 titleDirect link to Why Multi-Agent AI Systems Are Having a Moment in 2026 translateno>/a>/h2>p>Agent papers grew from roughly 820 in 2024 to over 2,500 in 2025. Enterprise AI projects using multi-agent architectures reportedly reached 72% in 2025. LangGraph, the most-adopted orchestration framework in the ecosystem, leads adoption; AutoGen and CrewAI follow. The concept has moved from research to production infrastructure faster than most practitioners anticipated./p>p>What the research papers do not tell you is which architectural pattern to use. That is the gap this article closes./p>h2 classanchor anchorTargetStickyNavbar_eHHq idparadigm-1-infrastructure-owned-parallelism--the-rustdeepseek-approach>Paradigm 1: Infrastructure-Owned Parallelism — The Rust/DeepSeek Approacha href#paradigm-1-infrastructure-owned-parallelism--the-rustdeepseek-approach classhash-link aria-labelDirect link to Paradigm 1: Infrastructure-Owned Parallelism — The Rust/DeepSeek Approach titleDirect link to Paradigm 1: Infrastructure-Owned Parallelism — The Rust/DeepSeek Approach translateno>/a>/h2>p>The a hrefhttps://github.com/nicolad/nomadically.work/tree/main/research target_blank relnoopener noreferrer class>code>research/code> crate/a> is a real Rust binary that fans out up to 20 parallel DeepSeek agents against Semantic Scholar, collects their outputs, and writes results to Cloudflare D1. Its architecture is aggressive in its simplicity./p>p>The entry point (a hrefhttps://github.com/nicolad/nomadically.work/blob/main/research/src/bin/research_agent.rs target_blank relnoopener noreferrer class>code>research/src/bin/research_agent.rs/code>/a>) exposes five subcommands: code>research/code> (single agent), code>study/code> (20 parallel agents over agentic-coding topics), code>prep/code> (10 parallel agents over application-prep topics), code>enhance/code> (10 agents per application section), and code>backend/code> (20 agents for backend interview prep). Every subcommand follows the same pattern: define a static list of tasks, queue them, spawn workers, collect results./p>p>The task list is a compile-time constant:/p>div classlanguage-rust codeBlockContainer_Yv7m theme-code-block style--prism-color:#F8F8F2;--prism-background-color:#282A36>div classcodeBlockContent_RrKf>pre tabindex0 classprism-code language-rust codeBlock_bNmq thin-scrollbar stylecolor:#F8F8F2;background-color:#282A36>code classcodeBlockLines_bZid>span classtoken-line stylecolor:#F8F8F2>span classtoken comment stylecolor:rgb(98, 114, 164)>// research/src/study.rs — 20 topics, statically defined/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>pub/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>const/span>span classtoken plain> /span>span classtoken constant stylecolor:rgb(189, 147, 249)>TOPICS/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken operator>&/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>/span>span classtoken class-name>TopicDef/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>/span>span classtoken plain> /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken operator>&/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken class-name>TopicDef/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain> slug/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken string stylecolor:rgb(255, 121, 198)>"tool-use-patterns"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>.../span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken class-name>TopicDef/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain> slug/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken string stylecolor:rgb(255, 121, 198)>"react-agent-loop"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>.../span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken comment stylecolor:rgb(98, 114, 164)>// ... 18 more/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>br>/span>/code>/pre>/div>/div>p>The task structure is fully known before the binary starts. There is no runtime negotiation over which agent handles which topic./p>h2 classanchor anchorTargetStickyNavbar_eHHq idhow-the-deepseek-tool-use-loop-works-in-rust>How the DeepSeek Tool-Use Loop Works in Rusta href#how-the-deepseek-tool-use-loop-works-in-rust classhash-link aria-labelDirect link to How the DeepSeek Tool-Use Loop Works in Rust titleDirect link to How the DeepSeek Tool-Use Loop Works in Rust translateno>/a>/h2>p>Each spawned agent runs the same inner loop, implemented in a hrefhttps://github.com/nicolad/nomadically.work/blob/main/research/src/agent.rs target_blank relnoopener noreferrer class>code>research/src/agent.rs/code>/a>. The loop is a direct implementation of the OpenAI-compatible function-calling protocol — without a Python SDK wrapper, without a framework abstraction layer:/p>div classlanguage-rust codeBlockContainer_Yv7m theme-code-block style--prism-color:#F8F8F2;--prism-background-color:#282A36>div classcodeBlockContent_RrKf>pre tabindex0 classprism-code language-rust codeBlock_bNmq thin-scrollbar stylecolor:#F8F8F2;background-color:#282A36>code classcodeBlockLines_bZid>span classtoken-line stylecolor:#F8F8F2>span classtoken comment stylecolor:rgb(98, 114, 164)>// research/src/agent.rs — the agentic tool-use loop/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>impl/span>span classtoken plain> /span>span classtoken class-name>DeepSeekAgent/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>pub/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>async/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>fn/span>span classtoken plain> /span>span classtoken function-definition function stylecolor:rgb(80, 250, 123)>prompt/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken operator>&/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>self/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> user_prompt/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken class-name>String/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>->/span>span classtoken plain> /span>span classtoken class-name>Result/span>span classtoken operator></span>span classtoken class-name>String/span>span classtoken operator>>/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>mut/span>span classtoken plain> messages/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken class-name>Vec/span>span classtoken operator></span>span classtoken class-name>Value/span>span classtoken operator>>/span>span classtoken plain> /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken macro property>vec!/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken macro property>json!/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken string stylecolor:rgb(255, 121, 198)>"role"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken string stylecolor:rgb(255, 121, 198)>"system"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken string stylecolor:rgb(255, 121, 198)>"content"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>self/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>preamble/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken macro property>json!/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken string stylecolor:rgb(255, 121, 198)>"role"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken string stylecolor:rgb(255, 121, 198)>"user"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken string stylecolor:rgb(255, 121, 198)>"content"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> user_prompt/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain styledisplay:inline-block>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>loop/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> resp/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken class-name>Value/span>span classtoken plain> /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>self/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>http/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>post/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken operator>&/span>span classtoken macro property>format!/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken string stylecolor:rgb(255, 121, 198)>"{}/v1/chat/completions"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>self/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>base_url/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>bearer_auth/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken operator>&/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>self/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>api_key/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>json/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken operator>&/span>span classtoken plain>body/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>send/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>await/span>span classtoken operator>?/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>json/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>await/span>span classtoken operator>?/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain styledisplay:inline-block>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> finish_reason /span>span classtoken operator>/span>span classtoken plain> resp/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>/span>span classtoken string stylecolor:rgb(255, 121, 198)>"choices"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>/span>span classtoken number>0/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>/span>span classtoken string stylecolor:rgb(255, 121, 198)>"finish_reason"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>as_str/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>unwrap_or/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken string stylecolor:rgb(255, 121, 198)>"stop"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain styledisplay:inline-block>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>match/span>span classtoken plain> finish_reason /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken string stylecolor:rgb(255, 121, 198)>"tool_calls"/span>span classtoken plain> /span>span classtoken operator>>/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken comment stylecolor:rgb(98, 114, 164)>// Execute each requested tool, append results, loop again/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> messages/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>push/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>message/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>clone/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>for/span>span classtoken plain> call /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>in/span>span classtoken plain> calls /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> result /span>span classtoken operator>/span>span classtoken plain> tool/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>call_json/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>args/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>await/span>span classtoken operator>?/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> messages/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>push/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken macro property>json!/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken string stylecolor:rgb(255, 121, 198)>"role"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken string stylecolor:rgb(255, 121, 198)>"tool"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken string stylecolor:rgb(255, 121, 198)>"tool_call_id"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> call_id/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken string stylecolor:rgb(255, 121, 198)>"content"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> result/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> _ /span>span classtoken operator>>/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken comment stylecolor:rgb(98, 114, 164)>// "stop" — return the final content/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>return/span>span classtoken plain> message/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>/span>span classtoken string stylecolor:rgb(255, 121, 198)>"content"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>as_str/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>map/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken class-name>String/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken plain>from/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>.../span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>br>/span>/code>/pre>/div>/div>p>The code>Tool/code> trait that backs this loop uses code>async_trait/code> and is simple by design:/p>div classlanguage-rust codeBlockContainer_Yv7m theme-code-block style--prism-color:#F8F8F2;--prism-background-color:#282A36>div classcodeBlockContent_RrKf>pre tabindex0 classprism-code language-rust codeBlock_bNmq thin-scrollbar stylecolor:#F8F8F2;background-color:#282A36>code classcodeBlockLines_bZid>span classtoken-line stylecolor:#F8F8F2>span classtoken attribute attr-name stylecolor:rgb(241, 250, 140)>#async_trait/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>pub/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>trait/span>span classtoken plain> /span>span classtoken type-definition class-name>Tool/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken class-name>Send/span>span classtoken plain> /span>span classtoken operator>+/span>span classtoken plain> /span>span classtoken class-name>Sync/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>fn/span>span classtoken plain> /span>span classtoken function-definition function stylecolor:rgb(80, 250, 123)>name/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken operator>&/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>self/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>->/span>span classtoken plain> /span>span classtoken operator>&/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>str/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>fn/span>span classtoken plain> /span>span classtoken function-definition function stylecolor:rgb(80, 250, 123)>definition/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken operator>&/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>self/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>->/span>span classtoken plain> /span>span classtoken class-name>ToolDefinition/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>async/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>fn/span>span classtoken plain> /span>span classtoken function-definition function stylecolor:rgb(80, 250, 123)>call_json/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken operator>&/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>self/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> args/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken class-name>Value/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>->/span>span classtoken plain> /span>span classtoken class-name>Result/span>span classtoken operator></span>span classtoken class-name>String/span>span classtoken operator>>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>br>/span>/code>/pre>/div>/div>p>Tools register their own JSON Schema via code>definition()/code>, and the agent loop dispatches by name. In the research crate, the tools are code>search_papers/code> (Semantic Scholar API) and code>get_paper_detail/code>. Agents in the code>study/code> subcommand use both tools for paper lookup; agents in the code>prep/code> subcommand run without tools — direct chat completions for speed, because their task structure does not require external lookups./p>h2 classanchor anchorTargetStickyNavbar_eHHq idspawning-parallel-agents-with-tokio>Spawning Parallel Agents with Tokioa href#spawning-parallel-agents-with-tokio classhash-link aria-labelDirect link to Spawning Parallel Agents with Tokio titleDirect link to Spawning Parallel Agents with Tokio translateno>/a>/h2>p>The code>prep/code> pipeline still demonstrates the flat fan-out pattern — no inter-worker communication, no dependency graph. The code>APPLICATION_TOPICS/code> path is the cleanest example of infrastructure-owned parallelism:/p>div classlanguage-rust codeBlockContainer_Yv7m theme-code-block style--prism-color:#F8F8F2;--prism-background-color:#282A36>div classcodeBlockContent_RrKf>pre tabindex0 classprism-code language-rust codeBlock_bNmq thin-scrollbar stylecolor:#F8F8F2;background-color:#282A36>code classcodeBlockLines_bZid>span classtoken-line stylecolor:#F8F8F2>span classtoken comment stylecolor:rgb(98, 114, 164)>// research/src/study.rs — run_prep()/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> queue/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken class-name>TaskQueue/span>span classtoken operator></span>span classtoken class-name>TopicDef/span>span classtoken operator>>/span>span classtoken plain> /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken class-name>TaskQueue/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken function stylecolor:rgb(80, 250, 123)>new/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>for/span>span classtoken plain> topic_def /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>in/span>span classtoken plain> /span>span classtoken constant stylecolor:rgb(189, 147, 249)>APPLICATION_TOPICS/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> queue/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>push/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>topic_def/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>slug/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken operator>*/span>span classtoken plain>topic_def/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken macro property>vec!/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken number>2/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>await/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain styledisplay:inline-block>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> mailbox /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken class-name>Mailbox/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken function stylecolor:rgb(80, 250, 123)>new/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>_shutdown_tx/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> shutdown/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain> /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken function stylecolor:rgb(80, 250, 123)>shutdown_pair/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> summary /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken class-name>TeamLead/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken function stylecolor:rgb(80, 250, 123)>new/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken constant stylecolor:rgb(189, 147, 249)>APPLICATION_TOPICS/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>len/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>run/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>queue/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> mailbox/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> shutdown/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>move/span>span classtoken plain> /span>span classtoken closure-params closure-punctuation punctuation stylecolor:rgb(248, 248, 242)>|/span>span classtoken closure-params>ctx/span>span classtoken closure-params punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken closure-params> task/span>span classtoken closure-params closure-punctuation punctuation stylecolor:rgb(248, 248, 242)>|/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> api_key /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken class-name>Arc/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken function stylecolor:rgb(80, 250, 123)>clone/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken operator>&/span>span classtoken plain>api_key/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> d1 /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken class-name>Arc/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken function stylecolor:rgb(80, 250, 123)>clone/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken operator>&/span>span classtoken plain>d1/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> topic_def /span>span classtoken operator>/span>span classtoken plain> task/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>payload/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>async/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>move/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken macro property>info!/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>worker /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken operator>%/span>span classtoken plain>ctx/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>worker_id/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> topic /span>span classtoken operator>/span>span classtoken plain> topic_def/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>slug/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken string stylecolor:rgb(255, 121, 198)>"Prep agent starting"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> row /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken function stylecolor:rgb(80, 250, 123)>run_direct_agent/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>topic_def/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken operator>&/span>span classtoken plain>api_key/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>await/span>span classtoken operator>?/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> d1/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>insert_study_topic/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken operator>&/span>span classtoken plain>row/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>await/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>with_context/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken closure-params closure-punctuation punctuation stylecolor:rgb(248, 248, 242)>|/span>span classtoken closure-params closure-punctuation punctuation stylecolor:rgb(248, 248, 242)>|/span>span classtoken plain> /span>span classtoken macro property>format!/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken string stylecolor:rgb(255, 121, 198)>"D1 insert failed for {}"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> topic_def/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>slug/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken operator>?/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken macro property>info!/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>worker /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken operator>%/span>span classtoken plain>ctx/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>worker_id/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> topic /span>span classtoken operator>/span>span classtoken plain> topic_def/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>slug/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken string stylecolor:rgb(255, 121, 198)>"Saved to D1"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken class-name>Ok/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken operator></span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken namespace>anyhow/span>span classtoken namespace punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken class-name>Error/span>span classtoken operator>>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>await/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>br>/span>/code>/pre>/div>/div>p>No mailbox communication between workers. No dependencies. Each worker reads its own topic, makes its own API call, writes its own row to D1. Workers never communicate with each other. This is the flat fan-out case expressed through the team abstraction — functionally equivalent to a bare code>tokio::spawn/code> loop, but now with retry, idle notifications, and cooperative shutdown included for free./p>p>Shared state is wrapped in code>Arc<T>/code> and cloned cheaply into each task. A Tokio task carries roughly 64 bytes of overhead and spawns in sub-microsecond time. Spinning up 20 agents adds negligible latency to program startup./p>h2 classanchor anchorTargetStickyNavbar_eHHq idthe-third-path-implementing-agent-teams-primitives-in-rust>The Third Path: Implementing Agent-Teams Primitives in Rusta href#the-third-path-implementing-agent-teams-primitives-in-rust classhash-link aria-labelDirect link to The Third Path: Implementing Agent-Teams Primitives in Rust titleDirect link to The Third Path: Implementing Agent-Teams Primitives in Rust translateno>/a>/h2>p>After observing the mismatch between "static fan-out is too rigid for the study pipeline" and "spinning up a full Claude session per research topic is too expensive," the research crate grew a third position: code>research/src/team.rs/code>, a 641-line Rust coordination library that implements the complete Claude Code agent-teams model natively./p>p>This is not an accidental similarity. The module-level doc comment states the goal explicitly, mapping every agent-teams concept to its Rust equivalent:/p>table>thead>tr>th>Agent-teams concept/th>th>code>team.rs/code> equivalent/th>/tr>/thead>tbody>tr>td>Shared task list/td>td>code>TaskQueue<P>/code>/td>/tr>tr>td>Atomic task claiming/td>td>code>TaskQueue::claim/code>/td>/tr>tr>td>Task dependencies/td>td>code>depends_on/code> in code>TaskQueue::push/code>/td>/tr>tr>td>Retry on failure/td>td>code>max_attempts/code> + re-queue on fail/td>/tr>tr>td>Queue change notification/td>td>code>TaskQueue::notify_handle/code>/td>/tr>tr>td>Lead / worker separation/td>td>code>TeamLead/code> + code>TeamContext/code>/td>/tr>tr>td>Worker identity/td>td>stable code>worker-NN/code> IDs/td>/tr>tr>td>Peer discovery/td>td>code>ctx.peer_ids/code> in code>TeamContext/code>/td>/tr>tr>td>Point-to-point message/td>td>code>Mailbox::send/code>/td>/tr>tr>td>Broadcast to all teammates/td>td>code>Mailbox::broadcast/code>/td>/tr>tr>td>Idle notifications/td>td>worker → code>team-lead/code> inbox on exit/td>/tr>tr>td>Plan approval gate/td>td>code>PlanGate/code>/td>/tr>tr>td>Cooperative shutdown/td>td>code>ShutdownToken/code> / code>shutdown_pair/code>/td>/tr>/tbody>/table>p>Every concept from the Claude Code agent-teams documentation has a direct Rust/Tokio equivalent. The target audience is clear: engineers who need the coordination semantics of agent teams but cannot or will not run a full Claude session per task — whether because of WASM constraints, cost at scale, or infrastructure ownership requirements./p>p>The full implementation is in a hrefhttps://github.com/nicolad/nomadically.work/blob/main/research/src/team.rs target_blank relnoopener noreferrer class>code>research/src/team.rs/code>/a>./p>h3 classanchor anchorTargetStickyNavbar_eHHq idtaskqueue--atomic-claiming-with-dependency-support>TaskQueue — Atomic Claiming with Dependency Supporta href#taskqueue--atomic-claiming-with-dependency-support classhash-link aria-labelDirect link to TaskQueue — Atomic Claiming with Dependency Support titleDirect link to TaskQueue — Atomic Claiming with Dependency Support translateno>/a>/h3>p>code>TaskQueue<P>/code> is generic over the task payload type. Its code>claim()/code> method is the coordination core — it holds the mutex for the full claim operation, computes which tasks have their dependencies satisfied, and claims the lowest available ID:/p>div classlanguage-rust codeBlockContainer_Yv7m theme-code-block style--prism-color:#F8F8F2;--prism-background-color:#282A36>div classcodeBlockContent_RrKf>pre tabindex0 classprism-code language-rust codeBlock_bNmq thin-scrollbar stylecolor:#F8F8F2;background-color:#282A36>code classcodeBlockLines_bZid>span classtoken-line stylecolor:#F8F8F2>span classtoken comment stylecolor:rgb(98, 114, 164)>// research/src/team.rs — TaskQueue::claim/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>pub/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>async/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>fn/span>span classtoken plain> /span>span classtoken function-definition function stylecolor:rgb(80, 250, 123)>claim/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken operator>&/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>self/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> worker/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken operator>&/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>str/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>->/span>span classtoken plain> /span>span classtoken class-name>Option/span>span classtoken operator></span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken class-name>TaskId/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken class-name>String/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken class-name>P/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken operator>>/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>mut/span>span classtoken plain> s /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>self/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>inner/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>lock/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>await/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> done/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken class-name>HashSet/span>span classtoken operator></span>span classtoken class-name>TaskId/span>span classtoken operator>>/span>span classtoken plain> /span>span classtoken operator>/span>span classtoken plain> s/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>tasks/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>values/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>filter/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken closure-params closure-punctuation punctuation stylecolor:rgb(248, 248, 242)>|/span>span classtoken closure-params>t/span>span classtoken closure-params closure-punctuation punctuation stylecolor:rgb(248, 248, 242)>|/span>span classtoken plain> t/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>status /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken class-name>TaskStatus/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken class-name>Completed/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>map/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken closure-params closure-punctuation punctuation stylecolor:rgb(248, 248, 242)>|/span>span classtoken closure-params>t/span>span classtoken closure-params closure-punctuation punctuation stylecolor:rgb(248, 248, 242)>|/span>span classtoken plain> t/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>id/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>collect/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> id /span>span classtoken operator>/span>span classtoken plain> s/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>tasks/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>values/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>filter/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken closure-params closure-punctuation punctuation stylecolor:rgb(248, 248, 242)>|/span>span classtoken closure-params>t/span>span classtoken closure-params closure-punctuation punctuation stylecolor:rgb(248, 248, 242)>|/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> t/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>status /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken class-name>TaskStatus/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken class-name>Pending/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken operator>&&/span>span classtoken plain> t/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>depends_on/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>iter/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>all/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken closure-params closure-punctuation punctuation stylecolor:rgb(248, 248, 242)>|/span>span classtoken closure-params>d/span>span classtoken closure-params closure-punctuation punctuation stylecolor:rgb(248, 248, 242)>|/span>span classtoken plain> done/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>contains/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>d/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>map/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken closure-params closure-punctuation punctuation stylecolor:rgb(248, 248, 242)>|/span>span classtoken closure-params>t/span>span classtoken closure-params closure-punctuation punctuation stylecolor:rgb(248, 248, 242)>|/span>span classtoken plain> t/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>id/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>min/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken operator>?/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain> /span>span classtoken comment stylecolor:rgb(98, 114, 164)>// lowest ID wins (ID-order preference)/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> task /span>span classtoken operator>/span>span classtoken plain> s/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>tasks/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>get_mut/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken operator>&/span>span classtoken plain>id/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>unwrap/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> task/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>status /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken class-name>TaskStatus/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken class-name>Claimed/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>worker/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>into/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> task/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>attempts /span>span classtoken operator>+/span>span classtoken plain> /span>span classtoken number>1/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken class-name>Some/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>id/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> task/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>name/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>clone/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> task/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>payload/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>clone/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>br>/span>/code>/pre>/div>/div>p>Tasks are pushed with an explicit dependency list:/p>div classlanguage-rust codeBlockContainer_Yv7m theme-code-block style--prism-color:#F8F8F2;--prism-background-color:#282A36>div classcodeBlockContent_RrKf>pre tabindex0 classprism-code language-rust codeBlock_bNmq thin-scrollbar stylecolor:#F8F8F2;background-color:#282A36>code classcodeBlockLines_bZid>span classtoken-line stylecolor:#F8F8F2>span classtoken comment stylecolor:rgb(98, 114, 164)>// research/src/team.rs — TaskQueue::push/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>pub/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>async/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>fn/span>span classtoken plain> /span>span classtoken function-definition function stylecolor:rgb(80, 250, 123)>push/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken operator>&/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>self/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> name/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>impl/span>span classtoken plain> /span>span classtoken class-name>Into/span>span classtoken operator></span>span classtoken class-name>String/span>span classtoken operator>>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> payload/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken class-name>P/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> depends_on/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken class-name>Vec/span>span classtoken operator></span>span classtoken class-name>TaskId/span>span classtoken operator>>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken comment stylecolor:rgb(98, 114, 164)>// IDs that must be Completed before this can be claimed/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> max_attempts/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>u32/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>->/span>span classtoken plain> /span>span classtoken class-name>TaskId/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>mut/span>span classtoken plain> s /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>self/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>inner/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>lock/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>await/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> id /span>span classtoken operator>/span>span classtoken plain> s/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>next_id/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> s/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>next_id /span>span classtoken operator>+/span>span classtoken plain> /span>span classtoken number>1/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> s/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>tasks/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>insert/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>id/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken class-name>TaskEntry/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> id/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> name/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> name/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>into/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> payload/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> status/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken class-name>TaskStatus/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken class-name>Pending/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> depends_on/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> attempts/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken number>0/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> max_attempts/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> id/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>br>/span>/code>/pre>/div>/div>p>Failure handling re-queues the task as code>Pending/code> if attempts remain, permanently marks it code>Failed/code> otherwise, and notifies idle workers via code>Notify/code>:/p>div classlanguage-rust codeBlockContainer_Yv7m theme-code-block style--prism-color:#F8F8F2;--prism-background-color:#282A36>div classcodeBlockContent_RrKf>pre tabindex0 classprism-code language-rust codeBlock_bNmq thin-scrollbar stylecolor:#F8F8F2;background-color:#282A36>code classcodeBlockLines_bZid>span classtoken-line stylecolor:#F8F8F2>span classtoken comment stylecolor:rgb(98, 114, 164)>// research/src/team.rs — TaskQueue::fail/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>pub/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>async/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>fn/span>span classtoken plain> /span>span classtoken function-definition function stylecolor:rgb(80, 250, 123)>fail/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken operator>&/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>self/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> id/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken class-name>TaskId/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>mut/span>span classtoken plain> s /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>self/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>inner/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>lock/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>await/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>if/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> /span>span classtoken class-name>Some/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>t/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain> /span>span classtoken operator>/span>span classtoken plain> s/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>tasks/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>get_mut/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken operator>&/span>span classtoken plain>id/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>if/span>span classtoken plain> t/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>attempts /span>span classtoken operator>>/span>span classtoken plain> t/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>max_attempts /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken macro property>warn!/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>task /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken operator>%/span>span classtoken plain>t/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>name/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> attempts /span>span classtoken operator>/span>span classtoken plain> t/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>attempts/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken string stylecolor:rgb(255, 121, 198)>"Task permanently failed"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> t/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>status /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken class-name>TaskStatus/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken class-name>Failed/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>else/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken macro property>warn!/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>task /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken operator>%/span>span classtoken plain>t/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>name/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> attempt /span>span classtoken operator>/span>span classtoken plain> t/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>attempts/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> max /span>span classtoken operator>/span>span classtoken plain> t/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>max_attempts/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken string stylecolor:rgb(255, 121, 198)>"Task failed — re-queuing for retry"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> t/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>status /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken class-name>TaskStatus/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken class-name>Pending/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>self/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>changed/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>notify_waiters/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>br>/span>/code>/pre>/div>/div>h3 classanchor anchorTargetStickyNavbar_eHHq idmailbox--point-to-point-and-broadcast-messaging>Mailbox — Point-to-Point and Broadcast Messaginga href#mailbox--point-to-point-and-broadcast-messaging classhash-link aria-labelDirect link to Mailbox — Point-to-Point and Broadcast Messaging titleDirect link to Mailbox — Point-to-Point and Broadcast Messaging translateno>/a>/h3>p>The code>Mailbox/code> is an code>Arc/code>-wrapped code>HashMap<String, VecDeque<Envelope>>/code> — named inboxes, FIFO order. Any string can be an inbox name: worker IDs, task slugs, topic slugs. From the doc comment:/p>blockquote>p>Workers write to named inboxes and read from their own. The inbox name can be a worker ID, a task name, a topic slug — any agreed-upon key. This mirrors the agent-teams mailbox where teammates message each other directly without going through the lead./p>/blockquote>p>Point-to-point send:/p>div classlanguage-rust codeBlockContainer_Yv7m theme-code-block style--prism-color:#F8F8F2;--prism-background-color:#282A36>div classcodeBlockContent_RrKf>pre tabindex0 classprism-code language-rust codeBlock_bNmq thin-scrollbar stylecolor:#F8F8F2;background-color:#282A36>code classcodeBlockLines_bZid>span classtoken-line stylecolor:#F8F8F2>span classtoken comment stylecolor:rgb(98, 114, 164)>// research/src/team.rs — Mailbox::send/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>pub/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>async/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>fn/span>span classtoken plain> /span>span classtoken function-definition function stylecolor:rgb(80, 250, 123)>send/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken operator>&/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>self/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> from/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>impl/span>span classtoken plain> /span>span classtoken class-name>Into/span>span classtoken operator></span>span classtoken class-name>String/span>span classtoken operator>>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> to/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>impl/span>span classtoken plain> /span>span classtoken class-name>Into/span>span classtoken operator></span>span classtoken class-name>String/span>span classtoken operator>>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> subject/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>impl/span>span classtoken plain> /span>span classtoken class-name>Into/span>span classtoken operator></span>span classtoken class-name>String/span>span classtoken operator>>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> body/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>impl/span>span classtoken plain> /span>span classtoken class-name>Into/span>span classtoken operator></span>span classtoken class-name>String/span>span classtoken operator>>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>.../span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>br>/span>/code>/pre>/div>/div>p>Broadcast delivers the same message to every recipient in the slice:/p>div classlanguage-rust codeBlockContainer_Yv7m theme-code-block style--prism-color:#F8F8F2;--prism-background-color:#282A36>div classcodeBlockContent_RrKf>pre tabindex0 classprism-code language-rust codeBlock_bNmq thin-scrollbar stylecolor:#F8F8F2;background-color:#282A36>code classcodeBlockLines_bZid>span classtoken-line stylecolor:#F8F8F2>span classtoken comment stylecolor:rgb(98, 114, 164)>// research/src/team.rs — Mailbox::broadcast/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>pub/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>async/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>fn/span>span classtoken plain> /span>span classtoken function-definition function stylecolor:rgb(80, 250, 123)>broadcast/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken operator>&/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>self/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> from/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>impl/span>span classtoken plain> /span>span classtoken class-name>Into/span>span classtoken operator></span>span classtoken class-name>String/span>span classtoken operator>>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> recipients/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken operator>&/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>/span>span classtoken operator>&/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>str/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> subject/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>impl/span>span classtoken plain> /span>span classtoken class-name>Into/span>span classtoken operator></span>span classtoken class-name>String/span>span classtoken operator>>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> body/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>impl/span>span classtoken plain> /span>span classtoken class-name>Into/span>span classtoken operator></span>span classtoken class-name>String/span>span classtoken operator>>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> from /span>span classtoken operator>/span>span classtoken plain> from/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>into/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> subject /span>span classtoken operator>/span>span classtoken plain> subject/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>into/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> body /span>span classtoken operator>/span>span classtoken plain> body/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>into/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>for/span>span classtoken plain> recipient /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>in/span>span classtoken plain> recipients /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>self/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>send/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>from/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>clone/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken operator>*/span>span classtoken plain>recipient/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> subject/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>clone/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> body/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>clone/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>await/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>br>/span>/code>/pre>/div>/div>p>Blocking receive parks the task until a message arrives:/p>div classlanguage-rust codeBlockContainer_Yv7m theme-code-block style--prism-color:#F8F8F2;--prism-background-color:#282A36>div classcodeBlockContent_RrKf>pre tabindex0 classprism-code language-rust codeBlock_bNmq thin-scrollbar stylecolor:#F8F8F2;background-color:#282A36>code classcodeBlockLines_bZid>span classtoken-line stylecolor:#F8F8F2>span classtoken comment stylecolor:rgb(98, 114, 164)>// research/src/team.rs — Mailbox::recv_wait/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>pub/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>async/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>fn/span>span classtoken plain> /span>span classtoken function-definition function stylecolor:rgb(80, 250, 123)>recv_wait/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken operator>&/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>self/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> inbox/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken operator>&/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>str/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>->/span>span classtoken plain> /span>span classtoken class-name>Envelope/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>loop/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>if/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> /span>span classtoken class-name>Some/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>env/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain> /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>self/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>recv/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>inbox/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>await/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>return/span>span classtoken plain> env/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>self/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>notify/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>notified/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>await/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>br>/span>/code>/pre>/div>/div>p>The code>Envelope/code> struct carries a monotonic message ID, sender, recipient, subject, and body (plain text or JSON):/p>div classlanguage-rust codeBlockContainer_Yv7m theme-code-block style--prism-color:#F8F8F2;--prism-background-color:#282A36>div classcodeBlockContent_RrKf>pre tabindex0 classprism-code language-rust codeBlock_bNmq thin-scrollbar stylecolor:#F8F8F2;background-color:#282A36>code classcodeBlockLines_bZid>span classtoken-line stylecolor:#F8F8F2>span classtoken comment stylecolor:rgb(98, 114, 164)>// research/src/team.rs/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>pub/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>struct/span>span classtoken plain> /span>span classtoken type-definition class-name>Envelope/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>pub/span>span classtoken plain> id/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>u64/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>pub/span>span classtoken plain> from/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken class-name>String/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>pub/span>span classtoken plain> to/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken class-name>String/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>pub/span>span classtoken plain> subject/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken class-name>String/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>pub/span>span classtoken plain> body/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken class-name>String/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>br>/span>/code>/pre>/div>/div>h3 classanchor anchorTargetStickyNavbar_eHHq idteamleadrun--the-worker-driver>TeamLead::run() — The Worker Drivera href#teamleadrun--the-worker-driver classhash-link aria-labelDirect link to TeamLead::run() — The Worker Driver titleDirect link to TeamLead::run() — The Worker Driver translateno>/a>/h3>p>code>TeamLead/code> holds two fields: code>worker_count/code> and code>idle_poll_ms/code>. Its code>run()/code> method is fully generic — the task payload type, return type, and worker closure are all type parameters:/p>div classlanguage-rust codeBlockContainer_Yv7m theme-code-block style--prism-color:#F8F8F2;--prism-background-color:#282A36>div classcodeBlockContent_RrKf>pre tabindex0 classprism-code language-rust codeBlock_bNmq thin-scrollbar stylecolor:#F8F8F2;background-color:#282A36>code classcodeBlockLines_bZid>span classtoken-line stylecolor:#F8F8F2>span classtoken comment stylecolor:rgb(98, 114, 164)>// research/src/team.rs — TeamLead::run (signature)/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>pub/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>async/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>fn/span>span classtoken plain> /span>span classtoken function-definition function stylecolor:rgb(80, 250, 123)>run/span>span classtoken operator></span>span classtoken class-name>P/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken class-name>R/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken class-name>F/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken class-name>Fut/span>span classtoken operator>>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken operator>&/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>self/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> queue/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken class-name>TaskQueue/span>span classtoken operator></span>span classtoken class-name>P/span>span classtoken operator>>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> mailbox/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken class-name>Mailbox/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> shutdown/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken class-name>ShutdownToken/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> worker_fn/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken class-name>F/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>->/span>span classtoken plain> /span>span classtoken class-name>QueueSummary/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>where/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken class-name>P/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken class-name>Send/span>span classtoken plain> /span>span classtoken operator>+/span>span classtoken plain> /span>span classtoken class-name>Clone/span>span classtoken plain> /span>span classtoken operator>+/span>span classtoken plain> /span>span classtoken lifetime-annotation symbol stylecolor:rgb(248, 248, 242)>'static/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken class-name>R/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken class-name>Send/span>span classtoken plain> /span>span classtoken operator>+/span>span classtoken plain> /span>span classtoken lifetime-annotation symbol stylecolor:rgb(248, 248, 242)>'static/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken class-name>F/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken class-name>Fn/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken class-name>TeamContext/span>span classtoken operator></span>span classtoken class-name>P/span>span classtoken operator>>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken class-name>WorkerTask/span>span classtoken operator></span>span classtoken class-name>P/span>span classtoken operator>>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>->/span>span classtoken plain> /span>span classtoken class-name>Fut/span>span classtoken plain> /span>span classtoken operator>+/span>span classtoken plain> /span>span classtoken class-name>Send/span>span classtoken plain> /span>span classtoken operator>+/span>span classtoken plain> /span>span classtoken class-name>Sync/span>span classtoken plain> /span>span classtoken operator>+/span>span classtoken plain> /span>span classtoken class-name>Clone/span>span classtoken plain> /span>span classtoken operator>+/span>span classtoken plain> /span>span classtoken lifetime-annotation symbol stylecolor:rgb(248, 248, 242)>'static/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken class-name>Fut/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken namespace>std/span>span classtoken namespace punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken namespace>future/span>span classtoken namespace punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken class-name>Future/span>span classtoken operator></span>span classtoken class-name>Output/span>span classtoken plain> /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken namespace>anyhow/span>span classtoken namespace punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken class-name>Result/span>span classtoken operator></span>span classtoken class-name>R/span>span classtoken operator>>>/span>span classtoken plain> /span>span classtoken operator>+/span>span classtoken plain> /span>span classtoken class-name>Send/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>br>/span>/code>/pre>/div>/div>p>Each worker loop checks shutdown, claims tasks, invokes the worker closure, and handles success or failure. When idle, workers wait on a code>Notify/code> handle rather than busy-polling:/p>div classlanguage-rust codeBlockContainer_Yv7m theme-code-block style--prism-color:#F8F8F2;--prism-background-color:#282A36>div classcodeBlockContent_RrKf>pre tabindex0 classprism-code language-rust codeBlock_bNmq thin-scrollbar stylecolor:#F8F8F2;background-color:#282A36>code classcodeBlockLines_bZid>span classtoken-line stylecolor:#F8F8F2>span classtoken comment stylecolor:rgb(98, 114, 164)>// research/src/team.rs — worker loop inside TeamLead::run/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>loop/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>if/span>span classtoken plain> shutdown/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>is_cancelled/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken macro property>info!/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>worker /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken operator>%/span>span classtoken plain>worker_id/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken string stylecolor:rgb(255, 121, 198)>"Shutdown requested — exiting"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>break/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain styledisplay:inline-block>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>match/span>span classtoken plain> queue/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>claim/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken operator>&/span>span classtoken plain>worker_id/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>await/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken class-name>Some/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>id/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> name/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> payload/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain> /span>span classtoken operator>>/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken macro property>info!/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>worker /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken operator>%/span>span classtoken plain>worker_id/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> task /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken operator>%/span>span classtoken plain>name/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken string stylecolor:rgb(255, 121, 198)>"Claimed task"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> ctx /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken class-name>TeamContext/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> worker_id/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> worker_id/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>clone/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> peer_ids/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> peer_ids/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>clone/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> queue/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> queue/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>clone/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> mailbox/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> mailbox/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>clone/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> shutdown/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> shutdown/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>clone/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> task /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken class-name>WorkerTask/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain> id/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> name/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> name/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>clone/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> payload /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>match/span>span classtoken plain> /span>span classtoken function stylecolor:rgb(80, 250, 123)>worker_fn/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>ctx/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> task/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>await/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken class-name>Ok/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>_/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain> /span>span classtoken operator>>/span>span classtoken plain> queue/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>complete/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>id/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>await/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken class-name>Err/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>e/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain> /span>span classtoken operator>>/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken namespace>tracing/span>span classtoken namespace punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken macro property>error!/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>worker /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken operator>%/span>span classtoken plain>worker_id/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> task /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken operator>%/span>span classtoken plain>name/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken string stylecolor:rgb(255, 121, 198)>"Task failed: {e}"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> queue/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>fail/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>id/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>await/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken class-name>None/span>span classtoken plain> /span>span classtoken operator>>/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>if/span>span classtoken plain> queue/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>all_done/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>await/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken macro property>info!/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>worker /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken operator>%/span>span classtoken plain>worker_id/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken string stylecolor:rgb(255, 121, 198)>"All tasks done — idle"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>break/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> notify /span>span classtoken operator>/span>span classtoken plain> queue/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>notify_handle/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken namespace>tokio/span>span classtoken namespace punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken macro property>select!/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> _ /span>span classtoken operator>/span>span classtoken plain> notify/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>notified/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain> /span>span classtoken operator>>/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> _ /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken namespace>tokio/span>span classtoken namespace punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken namespace>time/span>span classtoken namespace punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken function stylecolor:rgb(80, 250, 123)>sleep/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken class-name>Duration/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken function stylecolor:rgb(80, 250, 123)>from_millis/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>idle_poll_ms/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain> /span>span classtoken operator>>/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain styledisplay:inline-block>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken comment stylecolor:rgb(98, 114, 164)>// Idle notification — mirrors agent-teams: "teammates notify the lead when they finish"/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>mailbox/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>send/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken operator>&/span>span classtoken plain>worker_id/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken string stylecolor:rgb(255, 121, 198)>"team-lead"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken string stylecolor:rgb(255, 121, 198)>"idle"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken macro property>format!/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken string stylecolor:rgb(255, 121, 198)>"{worker_id} idle — queue: {} pending, ..."/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> summary_snapshot/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>pending/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>await/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>br>/span>/code>/pre>/div>/div>p>Workers send an "idle" message to the code>"team-lead"/code> inbox on exit. This mirrors the agent-teams behavior where teammates automatically notify the lead when they finish./p>h3 classanchor anchorTargetStickyNavbar_eHHq idpeer-discovery-via-teamcontext>Peer Discovery via TeamContexta href#peer-discovery-via-teamcontext classhash-link aria-labelDirect link to Peer Discovery via TeamContext titleDirect link to Peer Discovery via TeamContext translateno>/a>/h3>p>Each worker receives a code>TeamContext/code> containing its own ID, the list of all peer IDs, the shared queue, the shared mailbox, and the shutdown token:/p>div classlanguage-rust codeBlockContainer_Yv7m theme-code-block style--prism-color:#F8F8F2;--prism-background-color:#282A36>div classcodeBlockContent_RrKf>pre tabindex0 classprism-code language-rust codeBlock_bNmq thin-scrollbar stylecolor:#F8F8F2;background-color:#282A36>code classcodeBlockLines_bZid>span classtoken-line stylecolor:#F8F8F2>span classtoken comment stylecolor:rgb(98, 114, 164)>// research/src/team.rs/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>pub/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>struct/span>span classtoken plain> /span>span classtoken type-definition class-name>TeamContext/span>span classtoken operator></span>span classtoken class-name>P/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken class-name>Clone/span>span classtoken plain> /span>span classtoken operator>+/span>span classtoken plain> /span>span classtoken class-name>Send/span>span classtoken plain> /span>span classtoken operator>+/span>span classtoken plain> /span>span classtoken lifetime-annotation symbol stylecolor:rgb(248, 248, 242)>'static/span>span classtoken operator>>/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>pub/span>span classtoken plain> worker_id/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken class-name>String/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken comment stylecolor:rgb(98, 114, 164)>/// IDs of all other active workers — mirrors agent-teams members array./span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>pub/span>span classtoken plain> peer_ids/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken class-name>Vec/span>span classtoken operator></span>span classtoken class-name>String/span>span classtoken operator>>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>pub/span>span classtoken plain> queue/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken class-name>TaskQueue/span>span classtoken operator></span>span classtoken class-name>P/span>span classtoken operator>>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>pub/span>span classtoken plain> mailbox/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken class-name>Mailbox/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>pub/span>span classtoken plain> shutdown/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken class-name>ShutdownToken/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>br>/span>/code>/pre>/div>/div>p>code>peer_ids/code> is computed by code>TeamLead::run()/code> before spawning. Each worker gets all IDs except its own:/p>div classlanguage-rust codeBlockContainer_Yv7m theme-code-block style--prism-color:#F8F8F2;--prism-background-color:#282A36>div classcodeBlockContent_RrKf>pre tabindex0 classprism-code language-rust codeBlock_bNmq thin-scrollbar stylecolor:#F8F8F2;background-color:#282A36>code classcodeBlockLines_bZid>span classtoken-line stylecolor:#F8F8F2>span classtoken comment stylecolor:rgb(98, 114, 164)>// research/src/team.rs — inside TeamLead::run/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> all_ids/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken class-name>Vec/span>span classtoken operator></span>span classtoken class-name>String/span>span classtoken operator>>/span>span classtoken plain> /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken number>1/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>../span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>self/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>worker_count/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>map/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken closure-params closure-punctuation punctuation stylecolor:rgb(248, 248, 242)>|/span>span classtoken closure-params>i/span>span classtoken closure-params closure-punctuation punctuation stylecolor:rgb(248, 248, 242)>|/span>span classtoken plain> /span>span classtoken macro property>format!/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken string stylecolor:rgb(255, 121, 198)>"worker-{:02}"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> i/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>collect/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain styledisplay:inline-block>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken comment stylecolor:rgb(98, 114, 164)>// per-worker:/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> peer_ids/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken class-name>Vec/span>span classtoken operator></span>span classtoken class-name>String/span>span classtoken operator>>/span>span classtoken plain> /span>span classtoken operator>/span>span classtoken plain> all_ids/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>iter/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>filter/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken closure-params closure-punctuation punctuation stylecolor:rgb(248, 248, 242)>|/span>span classtoken closure-params>id/span>span classtoken closure-params closure-punctuation punctuation stylecolor:rgb(248, 248, 242)>|/span>span classtoken plain> /span>span classtoken operator>*/span>span classtoken plain>id /span>span classtoken operator>!/span>span classtoken plain> /span>span classtoken operator>&/span>span classtoken plain>worker_id/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>cloned/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>collect/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>br>/span>/code>/pre>/div>/div>p>Workers can address each other directly via code>ctx.mailbox.send(&ctx.worker_id, peer_id, ...)/code> using code>ctx.peer_ids/code> as the address book — the exact same model as the agent-teams code>members/code> array./p>h3 classanchor anchorTargetStickyNavbar_eHHq idcooperative-shutdown-via-shutdowntoken>Cooperative Shutdown via ShutdownTokena href#cooperative-shutdown-via-shutdowntoken classhash-link aria-labelDirect link to Cooperative Shutdown via ShutdownToken titleDirect link to Cooperative Shutdown via ShutdownToken translateno>/a>/h3>p>The code>ShutdownToken/code> uses a code>watch::channel/code> — the lead's sender writes code>true/code> to signal shutdown, and each worker checks the value between task iterations, never inside task execution:/p>div classlanguage-rust codeBlockContainer_Yv7m theme-code-block style--prism-color:#F8F8F2;--prism-background-color:#282A36>div classcodeBlockContent_RrKf>pre tabindex0 classprism-code language-rust codeBlock_bNmq thin-scrollbar stylecolor:#F8F8F2;background-color:#282A36>code classcodeBlockLines_bZid>span classtoken-line stylecolor:#F8F8F2>span classtoken comment stylecolor:rgb(98, 114, 164)>// research/src/team.rs/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken attribute attr-name stylecolor:rgb(241, 250, 140)>#derive(Clone)/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>pub/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>struct/span>span classtoken plain> /span>span classtoken type-definition class-name>ShutdownToken/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken namespace>watch/span>span classtoken namespace punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken class-name>Receiver/span>span classtoken operator></span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>bool/span>span classtoken operator>>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain styledisplay:inline-block>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>impl/span>span classtoken plain> /span>span classtoken class-name>ShutdownToken/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>pub/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>fn/span>span classtoken plain> /span>span classtoken function-definition function stylecolor:rgb(80, 250, 123)>is_cancelled/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken operator>&/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>self/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>->/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>bool/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain> /span>span classtoken operator>*/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>self/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken number>0/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>borrow/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain styledisplay:inline-block>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>pub/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>struct/span>span classtoken plain> /span>span classtoken type-definition class-name>ShutdownSender/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken namespace>watch/span>span classtoken namespace punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken class-name>Sender/span>span classtoken operator></span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>bool/span>span classtoken operator>>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain styledisplay:inline-block>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>impl/span>span classtoken plain> /span>span classtoken class-name>ShutdownSender/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>pub/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>fn/span>span classtoken plain> /span>span classtoken function-definition function stylecolor:rgb(80, 250, 123)>shutdown/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken operator>&/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>self/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> _ /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>self/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken number>0/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>send/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken boolean>true/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain styledisplay:inline-block>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>pub/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>fn/span>span classtoken plain> /span>span classtoken function-definition function stylecolor:rgb(80, 250, 123)>shutdown_pair/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>->/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken class-name>ShutdownSender/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken class-name>ShutdownToken/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>tx/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> rx/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain> /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken namespace>watch/span>span classtoken namespace punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken function stylecolor:rgb(80, 250, 123)>channel/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken boolean>false/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken class-name>ShutdownSender/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>tx/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken class-name>ShutdownToken/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>rx/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>br>/span>/code>/pre>/div>/div>p>From the doc comment: "Workers poll code>is_cancelled()/code> between task iterations. They always finish their current task before checking — matching the agent-teams behaviour: 'teammates finish their current request before shutting down'." Workers are never cancelled mid-flight; the shutdown is cooperative./p>h3 classanchor anchorTargetStickyNavbar_eHHq idplangate--plan-approval-gate>PlanGate — Plan Approval Gatea href#plangate--plan-approval-gate classhash-link aria-labelDirect link to PlanGate — Plan Approval Gate titleDirect link to PlanGate — Plan Approval Gate translateno>/a>/h3>p>code>PlanGate/code> is the Rust equivalent of Claude Code's plan approval flow. Workers call code>submit_and_wait()/code> and block on a code>oneshot::Receiver/code>. The lead calls code>approve()/code> or code>reject()/code>, which sends on the code>oneshot::Sender/code> and unblocks the worker:/p>div classlanguage-rust codeBlockContainer_Yv7m theme-code-block style--prism-color:#F8F8F2;--prism-background-color:#282A36>div classcodeBlockContent_RrKf>pre tabindex0 classprism-code language-rust codeBlock_bNmq thin-scrollbar stylecolor:#F8F8F2;background-color:#282A36>code classcodeBlockLines_bZid>span classtoken-line stylecolor:#F8F8F2>span classtoken comment stylecolor:rgb(98, 114, 164)>// research/src/team.rs — PlanGate/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>pub/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>async/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>fn/span>span classtoken plain> /span>span classtoken function-definition function stylecolor:rgb(80, 250, 123)>submit_and_wait/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken operator>&/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>self/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> worker_id/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken operator>&/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>str/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> plan/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken operator>&/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>str/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>->/span>span classtoken plain> /span>span classtoken class-name>PlanDecision/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>tx/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> rx/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain> /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken namespace>tokio/span>span classtoken namespace punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken namespace>sync/span>span classtoken namespace punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken namespace>oneshot/span>span classtoken namespace punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken function stylecolor:rgb(80, 250, 123)>channel/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken macro property>info!/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>worker /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken operator>%/span>span classtoken plain>worker_id/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken string stylecolor:rgb(255, 121, 198)>"Plan submitted, awaiting approval"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>self/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>pending/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>lock/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>await/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>insert/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> worker_id/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>into/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken class-name>PlanEntry/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain> plan/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> plan/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>into/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> tx /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>self/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>notify/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>notify_waiters/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> rx/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>await/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>unwrap_or/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken class-name>PlanDecision/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken class-name>Rejected/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain> feedback/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken string stylecolor:rgb(255, 121, 198)>"Gate dropped"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>into/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain styledisplay:inline-block>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>pub/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>async/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>fn/span>span classtoken plain> /span>span classtoken function-definition function stylecolor:rgb(80, 250, 123)>approve/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken operator>&/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>self/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> worker_id/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken operator>&/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>str/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>if/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> /span>span classtoken class-name>Some/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>e/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain> /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>self/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>pending/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>lock/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>await/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>remove/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>worker_id/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken macro property>info!/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>worker /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken operator>%/span>span classtoken plain>worker_id/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken string stylecolor:rgb(255, 121, 198)>"Plan approved"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> _ /span>span classtoken operator>/span>span classtoken plain> e/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>tx/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>send/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken class-name>PlanDecision/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken class-name>Approved/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain styledisplay:inline-block>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>pub/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>async/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>fn/span>span classtoken plain> /span>span classtoken function-definition function stylecolor:rgb(80, 250, 123)>reject/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken operator>&/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>self/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> worker_id/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken operator>&/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>str/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> feedback/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken operator>&/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>str/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>if/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> /span>span classtoken class-name>Some/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>e/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain> /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>self/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>pending/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>lock/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>await/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>remove/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>worker_id/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken macro property>warn!/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>worker /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken operator>%/span>span classtoken plain>worker_id/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken string stylecolor:rgb(255, 121, 198)>"Plan rejected"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> _ /span>span classtoken operator>/span>span classtoken plain> e/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>tx/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>send/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken class-name>PlanDecision/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken class-name>Rejected/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain> feedback/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> feedback/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>into/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>br>/span>/code>/pre>/div>/div>p>The minimal example from the module's doc comment shows the full API surface in a dozen lines:/p>div classlanguage-rust codeBlockContainer_Yv7m theme-code-block style--prism-color:#F8F8F2;--prism-background-color:#282A36>div classcodeBlockContent_RrKf>pre tabindex0 classprism-code language-rust codeBlock_bNmq thin-scrollbar stylecolor:#F8F8F2;background-color:#282A36>code classcodeBlockLines_bZid>span classtoken-line stylecolor:#F8F8F2>span classtoken comment stylecolor:rgb(98, 114, 164)>// research/src/team.rs — doc example/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> queue/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken class-name>TaskQueue/span>span classtoken operator></span>span classtoken class-name>String/span>span classtoken operator>>/span>span classtoken plain> /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken class-name>TaskQueue/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken function stylecolor:rgb(80, 250, 123)>new/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>queue/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>push/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken string stylecolor:rgb(255, 121, 198)>"greet"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken string stylecolor:rgb(255, 121, 198)>"hello"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>into/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken macro property>vec!/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken number>2/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>await/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain styledisplay:inline-block>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> mailbox /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken class-name>Mailbox/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken function stylecolor:rgb(80, 250, 123)>new/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>_sd_tx/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> shutdown/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain> /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken function stylecolor:rgb(80, 250, 123)>shutdown_pair/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain styledisplay:inline-block>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> summary /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken class-name>TeamLead/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken function stylecolor:rgb(80, 250, 123)>new/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken number>2/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>run/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>queue/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> mailbox/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> shutdown/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken closure-params closure-punctuation punctuation stylecolor:rgb(248, 248, 242)>|/span>span classtoken closure-params>_ctx/span>span classtoken closure-params punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken closure-params> task/span>span classtoken closure-params closure-punctuation punctuation stylecolor:rgb(248, 248, 242)>|/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>async/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>move/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken macro property>println!/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken string stylecolor:rgb(255, 121, 198)>"{}: {}"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> task/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>name/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> task/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>payload/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken class-name>Ok/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken operator></span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken namespace>anyhow/span>span classtoken namespace punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken class-name>Error/span>span classtoken operator>>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>await/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain styledisplay:inline-block>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken macro property>assert_eq!/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>summary/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>completed/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken number>1/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>br>/span>/code>/pre>/div>/div>h2 classanchor anchorTargetStickyNavbar_eHHq idthe-2-step-mailbox-pipeline-searchwrite-via-mailbox>The 2-Step Mailbox Pipeline: search→write via Mailboxa href#the-2-step-mailbox-pipeline-searchwrite-via-mailbox classhash-link aria-labelDirect link to The 2-Step Mailbox Pipeline: search→write via Mailbox titleDirect link to The 2-Step Mailbox Pipeline: search→write via Mailbox translateno>/a>/h2>p>The code>study/code> pipeline is where code>team.rs/code> coordination replaces the old static fan-out. For each of the 20 agentic-coding topics, the pipeline queues two dependent tasks: a code>Search/code> task that queries Semantic Scholar and deposits findings into the mailbox, and a code>Write/code> task that reads those findings and generates the study guide./p>h3 classanchor anchorTargetStickyNavbar_eHHq idthe-researchtask-enum>The ResearchTask Enuma href#the-researchtask-enum classhash-link aria-labelDirect link to The ResearchTask Enum titleDirect link to The ResearchTask Enum translateno>/a>/h3>div classlanguage-rust codeBlockContainer_Yv7m theme-code-block style--prism-color:#F8F8F2;--prism-background-color:#282A36>div classcodeBlockContent_RrKf>pre tabindex0 classprism-code language-rust codeBlock_bNmq thin-scrollbar stylecolor:#F8F8F2;background-color:#282A36>code classcodeBlockLines_bZid>span classtoken-line stylecolor:#F8F8F2>span classtoken comment stylecolor:rgb(98, 114, 164)>// research/src/study.rs/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken attribute attr-name stylecolor:rgb(241, 250, 140)>#derive(Clone)/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>enum/span>span classtoken plain> /span>span classtoken type-definition class-name>ResearchTask/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken class-name>Search/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken class-name>TopicDef/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken class-name>Write/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain> topic/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken class-name>TopicDef/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> category/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken operator>&/span>span classtoken lifetime-annotation symbol stylecolor:rgb(248, 248, 242)>'static/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>str/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>br>/span>/code>/pre>/div>/div>p>The old code>run_single_agent()/code> function — which handled the full research-and-write pipeline in one agent — has been replaced by two phase-specific functions: code>search_topic_papers()/code> (runs the tool-use agent with code>SearchPapers/code> and code>GetPaperDetail/code> tools, returns raw findings as markdown) and code>write_study_guide()/code> (pure-completion agent, no tools, receives findings string, returns a code>StudyTopicRow/code>). Only the search phase needs the Semantic Scholar API; the write phase is deterministic given the findings./p>h3 classanchor anchorTargetStickyNavbar_eHHq idqueuing-paired-tasks-with-dependencies>Queuing Paired Tasks with Dependenciesa href#queuing-paired-tasks-with-dependencies classhash-link aria-labelDirect link to Queuing Paired Tasks with Dependencies titleDirect link to Queuing Paired Tasks with Dependencies translateno>/a>/h3>p>For each topic, code>run_topics()/code> pushes two tasks. The code>write:{slug}/code> task carries the search task's ID in its code>depends_on/code> list, so code>TaskQueue::claim/code> cannot return it until the paired search task is completed:/p>div classlanguage-rust codeBlockContainer_Yv7m theme-code-block style--prism-color:#F8F8F2;--prism-background-color:#282A36>div classcodeBlockContent_RrKf>pre tabindex0 classprism-code language-rust codeBlock_bNmq thin-scrollbar stylecolor:#F8F8F2;background-color:#282A36>code classcodeBlockLines_bZid>span classtoken-line stylecolor:#F8F8F2>span classtoken comment stylecolor:rgb(98, 114, 164)>// research/src/study.rs — run_topics()/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> queue/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken class-name>TaskQueue/span>span classtoken operator></span>span classtoken class-name>ResearchTask/span>span classtoken operator>>/span>span classtoken plain> /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken class-name>TaskQueue/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken function stylecolor:rgb(80, 250, 123)>new/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>for/span>span classtoken plain> topic_def /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>in/span>span classtoken plain> topics /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> search_id /span>span classtoken operator>/span>span classtoken plain> queue/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>push/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken macro property>format!/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken string stylecolor:rgb(255, 121, 198)>"search:{}"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> topic_def/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>slug/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken class-name>ResearchTask/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken class-name>Search/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken operator>*/span>span classtoken plain>topic_def/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken macro property>vec!/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken comment stylecolor:rgb(98, 114, 164)>// no dependencies/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken number>2/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken comment stylecolor:rgb(98, 114, 164)>// max 2 attempts/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>await/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> queue/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>push/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken macro property>format!/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken string stylecolor:rgb(255, 121, 198)>"write:{}"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> topic_def/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>slug/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken class-name>ResearchTask/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken class-name>Write/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain> topic/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>:/span>span classtoken plain> /span>span classtoken operator>*/span>span classtoken plain>topic_def/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> category /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken macro property>vec!/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>/span>span classtoken plain>search_id/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken comment stylecolor:rgb(98, 114, 164)>// blocked until search completes/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken number>2/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>await/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>br>/span>/code>/pre>/div>/div>p>For 20 topics, this pushes 40 tasks total. The queue enforces that no code>write:{slug}/code> task can be claimed until its paired code>search:{slug}/code> is completed./p>h3 classanchor anchorTargetStickyNavbar_eHHq idthe-teamleadrun-call>The TeamLead::run() Calla href#the-teamleadrun-call classhash-link aria-labelDirect link to The TeamLead::run() Call titleDirect link to The TeamLead::run() Call translateno>/a>/h3>p>The old bare code>tokio::spawn/code> loop is replaced by code>TeamLead::new(topics.len()).run(...)/code>. The number of workers equals the number of topics, so search and write tasks for different topics can overlap even while write tasks within one topic block on their own search:/p>div classlanguage-rust codeBlockContainer_Yv7m theme-code-block style--prism-color:#F8F8F2;--prism-background-color:#282A36>div classcodeBlockContent_RrKf>pre tabindex0 classprism-code language-rust codeBlock_bNmq thin-scrollbar stylecolor:#F8F8F2;background-color:#282A36>code classcodeBlockLines_bZid>span classtoken-line stylecolor:#F8F8F2>span classtoken comment stylecolor:rgb(98, 114, 164)>// research/src/study.rs — run_topics()/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> mailbox /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken class-name>Mailbox/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken function stylecolor:rgb(80, 250, 123)>new/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>_shutdown_tx/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> shutdown/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain> /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken function stylecolor:rgb(80, 250, 123)>shutdown_pair/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> summary /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken class-name>TeamLead/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken function stylecolor:rgb(80, 250, 123)>new/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>topics/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>len/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>run/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>queue/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> mailbox/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> shutdown/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>move/span>span classtoken plain> /span>span classtoken closure-params closure-punctuation punctuation stylecolor:rgb(248, 248, 242)>|/span>span classtoken closure-params>ctx/span>span classtoken closure-params punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken closure-params> task/span>span classtoken closure-params closure-punctuation punctuation stylecolor:rgb(248, 248, 242)>|/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> api_key /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken class-name>Arc/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken function stylecolor:rgb(80, 250, 123)>clone/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken operator>&/span>span classtoken plain>api_key/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> scholar /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken class-name>Arc/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken function stylecolor:rgb(80, 250, 123)>clone/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken operator>&/span>span classtoken plain>scholar/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> d1 /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken class-name>Arc/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken function stylecolor:rgb(80, 250, 123)>clone/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken operator>&/span>span classtoken plain>d1/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>async/span>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>move/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>match/span>span classtoken plain> task/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>payload /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken class-name>ResearchTask/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken class-name>Search/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>topic/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain> /span>span classtoken operator>>/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken macro property>info!/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>worker /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken operator>%/span>span classtoken plain>ctx/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>worker_id/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> topic /span>span classtoken operator>/span>span classtoken plain> topic/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>slug/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken string stylecolor:rgb(255, 121, 198)>"Search phase starting"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> findings /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken function stylecolor:rgb(80, 250, 123)>search_topic_papers/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>topic/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken operator>&/span>span classtoken plain>scholar/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken operator>&/span>span classtoken plain>api_key/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>await/span>span classtoken operator>?/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> ctx/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>mailbox/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>send/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken operator>&/span>span classtoken plain>ctx/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>worker_id/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken macro property>format!/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken string stylecolor:rgb(255, 121, 198)>"findings:{}"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> topic/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>slug/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken string stylecolor:rgb(255, 121, 198)>"paper-findings"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> findings/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>await/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken macro property>info!/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>worker /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken operator>%/span>span classtoken plain>ctx/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>worker_id/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> topic /span>span classtoken operator>/span>span classtoken plain> topic/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>slug/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken string stylecolor:rgb(255, 121, 198)>"Search phase done, findings in mailbox"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken class-name>ResearchTask/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken class-name>Write/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain> topic/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> category /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken plain> /span>span classtoken operator>>/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken macro property>info!/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>worker /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken operator>%/span>span classtoken plain>ctx/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>worker_id/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> topic /span>span classtoken operator>/span>span classtoken plain> topic/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>slug/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken string stylecolor:rgb(255, 121, 198)>"Write phase starting"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> env /span>span classtoken operator>/span>span classtoken plain> ctx/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>mailbox/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>recv_wait/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken operator>&/span>span classtoken macro property>format!/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken string stylecolor:rgb(255, 121, 198)>"findings:{}"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> topic/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>slug/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>await/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>let/span>span classtoken plain> row /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken function stylecolor:rgb(80, 250, 123)>write_study_guide/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>topic/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> category/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken operator>&/span>span classtoken plain>env/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>body/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken operator>&/span>span classtoken plain>api_key/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>await/span>span classtoken operator>?/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> d1/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>insert_study_topic/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken operator>&/span>span classtoken plain>row/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>await/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken function stylecolor:rgb(80, 250, 123)>with_context/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken closure-params closure-punctuation punctuation stylecolor:rgb(248, 248, 242)>|/span>span classtoken closure-params closure-punctuation punctuation stylecolor:rgb(248, 248, 242)>|/span>span classtoken plain> /span>span classtoken macro property>format!/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken string stylecolor:rgb(255, 121, 198)>"D1 insert failed for {}"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> topic/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>slug/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken operator>?/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken macro property>info!/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken plain>worker /span>span classtoken operator>/span>span classtoken plain> /span>span classtoken operator>%/span>span classtoken plain>ctx/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>worker_id/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> topic /span>span classtoken operator>/span>span classtoken plain> topic/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken plain>slug/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken string stylecolor:rgb(255, 121, 198)>"Saved to D1"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken class-name>Ok/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken operator></span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken namespace>anyhow/span>span classtoken namespace punctuation stylecolor:rgb(248, 248, 242)>::/span>span classtoken class-name>Error/span>span classtoken operator>>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>(/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>)/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>./span>span classtoken keyword stylecolor:rgb(189, 147, 249);font-style:italic>await/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>;/span>br>/span>/code>/pre>/div>/div>p>The mailbox inbox name convention is code>findings:{slug}/code>. The search worker sends to that inbox; the write worker calls code>recv_wait(&format!("findings:{slug}"))/code>, blocking until the message is available. Task dependency in the queue guarantees the code>Write/code> task cannot even be claimed until code>Search/code> completes, so code>recv_wait/code> unblocks quickly in practice — but the mailbox blocking provides a safety net if the dependency graph and the mailbox arrive slightly out of sync./p>p>This is what the code>study.rs/code> pipeline looked like before code>team.rs/code> existed: isolated agents, no inter-worker communication, outputs collected after-the-fact from D1. Adding the mailbox turned it from independent parallel agents into a coordinated pipeline where one worker's output is another's input — exactly the pattern the Claude Code agent-teams code>SendMessage/code> primitive enables./p>h2 classanchor anchorTargetStickyNavbar_eHHq idparadigm-2-platform-managed-agent-teams--the-claude-code-approach>Paradigm 2: Platform-Managed Agent Teams — The Claude Code Approacha href#paradigm-2-platform-managed-agent-teams--the-claude-code-approach classhash-link aria-labelDirect link to Paradigm 2: Platform-Managed Agent Teams — The Claude Code Approach titleDirect link to Paradigm 2: Platform-Managed Agent Teams — The Claude Code Approach translateno>/a>/h2>p>Claude Code's experimental agent teams feature inverts every architectural assumption of static fan-out. Where the Rust system owns its concurrency at the OS level, Claude teams delegate coordination to the platform. Where Rust pre-assigns tasks via a queue, Claude teams use a shared task list with file-locked claiming at runtime. Where the flat Rust fan-out has isolated agents, Claude teammates send messages to each other directly./p>p>The feature is enabled in the a hrefhttps://github.com/nicolad/nomadically.work target_blank relnoopener noreferrer class>nomadically.work repo/a> via code>.claude/settings.json/code>:/p>div classlanguage-json codeBlockContainer_Yv7m theme-code-block style--prism-color:#F8F8F2;--prism-background-color:#282A36>div classcodeBlockContent_RrKf>pre tabindex0 classprism-code language-json codeBlock_bNmq thin-scrollbar stylecolor:#F8F8F2;background-color:#282A36>code classcodeBlockLines_bZid>span classtoken-line stylecolor:#F8F8F2>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken property>"env"/span>span classtoken operator>:/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken property>"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS"/span>span classtoken operator>:/span>span classtoken plain> /span>span classtoken string stylecolor:rgb(255, 121, 198)>"1"/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>br>/span>/code>/pre>/div>/div>p>That one line unlocks five coordination primitives: code>TeamCreate/code>, code>TaskCreate/code>, code>TaskUpdate/code>, code>TaskList/code>, and code>SendMessage/code>. Each teammate is a full, independent Claude Code session — a separate process with its own context window, its own file system access, and its own ability to write and run code./p>h2 classanchor anchorTargetStickyNavbar_eHHq idhow-claude-code-agent-teams-self-organize>How Claude Code Agent Teams Self-Organizea href#how-claude-code-agent-teams-self-organize classhash-link aria-labelDirect link to How Claude Code Agent Teams Self-Organize titleDirect link to How Claude Code Agent Teams Self-Organize translateno>/a>/h2>p>The team lead creates a shared task list stored in code>~/.claude/tasks/{team-name}//code>. Teammates discover available tasks by calling code>TaskList/code>, claim work by calling code>TaskUpdate/code> (setting themselves as owner), and the platform uses file locking to prevent two teammates from claiming the same task simultaneously. When a teammate finds something unexpected, they send a direct message to the relevant peer via code>SendMessage/code> — the lead does not need to relay it./p>p>The a hrefhttps://github.com/nicolad/nomadically.work target_blank relnoopener noreferrer class>nomadically.work repo/a> uses Claude agent teams in its SDD (Spec-Driven Development) orchestrator. The code>/sdd:ff/code> command spawns a team where spec-writing and design run in parallel — two teammates working simultaneously, each producing artifacts the other may need to reference. The key point is that these phases are not fully independent: a spec decision can change a design constraint. If that happens, the teammates can tell each other directly./p>p>Teammate display cycles through sessions via Shift+Down in-process, or splits into panes in tmux or iTerm2. The team lead's conversation history does not carry to teammates — each starts fresh from the shared CLAUDE.md project context and the task description. Context contamination is a real overhead: a teammate may re-investigate something the lead already resolved, spending tokens to rediscover context the lead has but could not transfer./p>p>Known limitations apply: no session resumption, task status can lag under contention, no nested teams (teammates cannot spawn sub-teams), and the lead is fixed for the team's lifetime. These are experimental constraints, not permanent design decisions — but they are real constraints today./p>h2 classanchor anchorTargetStickyNavbar_eHHq idcomparing-the-three-positions-a-decision-framework>Comparing the Three Positions: A Decision Frameworka href#comparing-the-three-positions-a-decision-framework classhash-link aria-labelDirect link to Comparing the Three Positions: A Decision Framework titleDirect link to Comparing the Three Positions: A Decision Framework translateno>/a>/h2>p>These are not competing patterns converging toward the same solution. They occupy distinct positions on a coordination spectrum, each optimal for a different class of work./p>p>The sharpest question to ask before choosing is: strong>do your agents need to talk to each other?/strong>/p>p>If the answer is no — if you can define all tasks before the run starts, if each agent's output is independent, if a failure in one agent should not affect the scope of another — then flat fan-out is the right call. The code>run_prep()/code> path in code>study.rs/code> demonstrates this with code>TeamLead/code> providing retry and shutdown for free, but no mailbox communication./p>p>If the answer is yes — and you own your infrastructure, need deterministic concurrency control, or operate under WASM or cost constraints that make full Claude sessions per task unviable — then code>team.rs/code> is the answer. You get the full coordination model (messaging, dependency graphs, plan gates, cooperative shutdown) at Tokio cost, not Claude token cost./p>p>If the answer is yes — and you want the coordination model without writing it, prefer natural-language task definitions, need human-in-the-loop steering mid-run, or cannot afford the maintenance overhead of a custom coordination library — then Claude Code agent teams are the answer./p>table>thead>tr>th>Dimension/th>th>Rust flat fan-out/th>th>Rust with code>team.rs/code>/th>th>Claude Code agent teams/th>/tr>/thead>tbody>tr>td>Task assignment/td>td>Static, pre-queued/td>td>Dynamic, atomic code>claim()/code>/td>td>Dynamic, file-locked claiming/td>/tr>tr>td>Inter-agent communication/td>td>None/td>td>code>Mailbox::send/code> / code>broadcast/code>/td>td>Full bidirectional via code>SendMessage/code>/td>/tr>tr>td>Task dependency support/td>td>None/td>td>code>depends_on: Vec<TaskId>/code>/td>td>Blocked/unblocked dependency graph/td>/tr>tr>td>Task retry/td>td>Manual/td>td>code>max_attempts/code> + re-queue/td>td>Platform-managed/td>/tr>tr>td>Human-in-the-loop/td>td>Fire-and-forget/td>td>code>PlanGate::submit_and_wait/code>/td>td>Direct message injection to any teammate/td>/tr>tr>td>Cooperative shutdown/td>td>None/td>td>code>ShutdownToken/code> / code>watch/code> channel/td>td>Platform-managed/td>/tr>tr>td>Concurrency overhead/td>td>~64 bytes + sub-μs spawn/td>td>Same — code>TeamLead/code> uses code>tokio::spawn/code> internally/td>td>Full context window per teammate; token-linear scaling/td>/tr>tr>td>Partial failure handling/td>td>Counter; peers continue/td>td>code>fail()/code> re-queues within code>max_attempts/code>/td>td>Failed teammate replaceable without aborting team/td>/tr>tr>td>Task dynamism/td>td>Zero/td>td>Re-queue on failure; dependency graph changes effective availability/td>td>Tasks can be created, re-assigned, or cancelled at runtime/td>/tr>tr>td>Observability/td>td>Structured logs (code>tracing/code>)/td>td>Structured logs + code>QueueSummary/code> + mailbox inbox counts/td>td>Teammate display modes (in-process, tmux, iTerm2)/td>/tr>tr>td>Infrastructure ownership/td>td>Full/td>td>Full/td>td>Platform-managed/td>/tr>/tbody>/table>h2 classanchor anchorTargetStickyNavbar_eHHq idcost-latency-and-observability-tradeoffs>Cost, Latency, and Observability Tradeoffsa href#cost-latency-and-observability-tradeoffs classhash-link aria-labelDirect link to Cost, Latency, and Observability Tradeoffs titleDirect link to Cost, Latency, and Observability Tradeoffs translateno>/a>/h2>p>The Rust crate's cost model is transparent regardless of which coordination layer you use. Workers make independent API calls to DeepSeek. Each call consumes tokens proportional to the agent's preamble, context, and tool results. Total cost is roughly N times the cost of a single agent — no platform overhead, no coordination messages, no duplicate context. The code>team.rs/code> coordination layer is in-process Rust with zero token cost./p>p>Claude agent teams cost more per the official documentation, though no specific multiplier is published. Each teammate carries its own full context window. Broadcast messages sent to all teammates multiply by team size. The official recommendation is 3–5 teammates with 5–6 tasks each — beyond that, coordination overhead accumulates faster than parallelism saves./p>p>Latency follows the opposite pattern. The Rust system's wall-clock time is bounded by the slowest agent plus network latency — typically 30–90 seconds for 20 agents running fully parallel. The code>team.rs/code> 2-step pipeline adds the mailbox handoff latency (sub-millisecond, in-process), which is negligible compared to LLM inference time. A Claude team doing the same breadth of work sequentially within a single session would take proportionally longer./p>p>The engineering category is well-compensated precisely because operating these systems at production scale requires understanding these tradeoffs, not just knowing the API./p>h2 classanchor anchorTargetStickyNavbar_eHHq idwhen-to-build-your-own-vs-use-claude-code-agent-teams>When to Build Your Own vs Use Claude Code Agent Teamsa href#when-to-build-your-own-vs-use-claude-code-agent-teams classhash-link aria-labelDirect link to When to Build Your Own vs Use Claude Code Agent Teams titleDirect link to When to Build Your Own vs Use Claude Code Agent Teams translateno>/a>/h2>p>Build infrastructure-owned concurrency (Rust code>team.rs/code>, Python asyncio, TypeScript Promise.all) when:/p>ul>li class>Task structure is fully or partially known before execution starts/li>li class>You need deterministic concurrency control with predictable retry behavior/li>li class>You are running on constrained infrastructure (Cloudflare Workers, WASM) where a full agent session per task is not viable/li>li class>Per-token cost matters at scale — flat API cost per agent, no platform overhead/li>li class>Inter-agent communication is needed but full Claude sessions per worker are too expensive/li>li class>You want compile-time type safety over agent payload shapes/li>/ul>p>Use Claude Code agent teams when:/p>ul>li class>The task is exploratory — agents may discover things that change the plan/li>li class>Agents need to challenge or build on each other's reasoning in natural language/li>li class>Task dependencies are dynamic — you cannot know the full task graph upfront/li>li class>You want human steering capability mid-run without aborting the whole run/li>li class>Orchestration code itself is a maintenance burden you want to avoid writing/li>li class>Task definitions benefit from natural language rather than typed enum variants/li>/ul>p>The code>run_prep()/code> path is an example of flat fan-out. The code>run_topics()/code> pipeline is an example of code>team.rs/code> coordination. The SDD orchestrator is an example of Claude agent teams. All three exist in the a hrefhttps://github.com/nicolad/nomadically.work target_blank relnoopener noreferrer class>same codebase/a> because the tasks they handle are structurally different — not because one pattern supersedes the others./p>p>One nuance worth stating plainly: the static fan-out pattern is not Rust-specific. Python's code>asyncio.gather()/code> and TypeScript's code>Promise.all()/code> implement the same model. The Rust implementation is a hook into the a hrefhttps://github.com/nicolad/nomadically.work target_blank relnoopener noreferrer class>nomadically.work codebase/a>, not an argument for Rust as the only language for this problem. The DeepSeek API is OpenAI-compatible; the tool-use loop in code>agent.rs/code> could be ported to Python in an afternoon. The Rust choice reflects specific constraints — WASM compilation targets, type-safe JSON handling, and zero-cost abstractions for a system intended for Cloudflare Worker environments. Those are valid reasons; they are also not universal./p>h2 classanchor anchorTargetStickyNavbar_eHHq idwhat-this-means-for-the-future-of-ai-powered-software-development>What This Means for the Future of AI-Powered Software Developmenta href#what-this-means-for-the-future-of-ai-powered-software-development classhash-link aria-labelDirect link to What This Means for the Future of AI-Powered Software Development titleDirect link to What This Means for the Future of AI-Powered Software Development translateno>/a>/h2>p>The three positions now occupy distinct points on a coordination spectrum that will remain relevant regardless of how individual frameworks evolve./p>p>At one end: static fan-out, owned concurrency, zero coordination overhead, compile-time task structure. Maximally efficient for embarrassingly parallel work where the task graph is known. Gets faster as inference costs fall and async runtimes improve./p>p>In the middle: owned-infrastructure coordination (code>team.rs/code> or equivalent), dynamic task claiming, in-process messaging, cooperative shutdown, plan gates. Maximally efficient when you need coordination semantics but cannot pay full-session cost per worker. Gets easier to build as the primitives become better understood./p>p>At the other end: platform-managed coordination, dynamic teams, full messaging infrastructure, runtime task discovery in natural language. Maximally flexible for exploratory work where the task graph emerges during execution. Gets cheaper as context window costs fall and team-size recommendations increase./p>p>The emerging challenge — genuinely unsolved — is automated task structure detection: given a goal, should the system fan-out statically, build a code>team.rs/code>-style queue, or stand up a full agent team? The agentic frameworks (Claude Agent SDK, OpenAI Agents SDK, LangGraph) are converging on common primitives for describing tasks and dependencies. But the decision of which concurrency model to use still requires human judgment about the nature of the work./p>p>That judgment is increasingly a senior engineering skill — and it is what separates engineers who can operate these systems at production scale from those who merely know the API./p>hr>p>strong>FAQ/strong>/p>p>strong>What is the Rust equivalent of Claude Code agent teams?/strong>The code>team.rs/code> module in the a hrefhttps://github.com/nicolad/nomadically.work target_blank relnoopener noreferrer class>nomadically.work research crate/a> implements full parity: code>TaskQueue/code> replaces the shared task list, code>TaskQueue::claim/code> handles atomic claiming, code>Mailbox::send/code> and code>Mailbox::broadcast/code> replace code>SendMessage/code>, code>PlanGate/code> implements the plan approval gate, and code>ShutdownToken/code> (via code>tokio::sync::watch/code>) handles cooperative shutdown. Every agent-teams primitive has a direct Rust/Tokio equivalent./p>p>strong>What is the difference between multi-agent orchestration and agent swarms?/strong>Orchestration implies a coordinator that assigns tasks to workers based on a defined structure — the coordinator knows the plan. Swarms imply emergent coordination where agents self-organize without a central planner. Claude Code agent teams are closer to orchestration (a lead agent coordinates); the code>team.rs/code> library is also orchestration (a code>TeamLead/code> drives the queue); the bare code>tokio::spawn/code> fan-out is neither — it is static parallelism without ongoing coordination of any kind./p>p>strong>How does Claude Code agent teams pricing work?/strong>Each teammate is a full Claude session consuming its own token budget. The official documentation describes cost as higher than a single session, scaling linearly with team size. Broadcast messages multiply by team size. Targeted teammate-to-teammate messages add tokens to both sending and receiving contexts. No specific multiplier is published./p>p>strong>Can I run AI agents in parallel with Rust?/strong>Yes. For flat fan-out (no inter-agent communication needed), the code>tokio::spawn/code> + code>Arc<T>/code> pattern is idiomatic. Wrap shared clients in code>Arc/code>, clone into each spawned task, collect code>JoinHandle/code>s, await results. For coordination (dynamic claiming, messaging, dependencies, retry), use code>TeamLead::new(n).run(queue, mailbox, shutdown, worker_fn)/code> from a hrefhttps://github.com/nicolad/nomadically.work/blob/main/research/src/team.rs target_blank relnoopener noreferrer class>code>research/src/team.rs/code>/a>. The overhead for either is approximately 64 bytes per task and sub-microsecond spawn latency — the code>team.rs/code> coordination layer is in-process Rust with no additional cost./p>p>strong>How do I implement inter-agent messaging in Rust?/strong>Use a shared code>Mailbox/code>: a code>Mutex<HashMap<String, VecDeque<Envelope>>>/code> with a code>Notify/code> for wake-up. Workers call code>mailbox.send(from, to, subject, body)/code> to deposit messages into named inboxes; receivers call code>recv_wait(inbox)/code> to block until a message arrives. For broadcast (send to all peers simultaneously), pass code>&ctx.peer_ids/code> as recipients. Worker addresses (code>peer_ids/code>) are pre-computed by code>TeamLead::run()/code> so every worker can address peers directly without going through the lead./p>p>strong>What is cooperative shutdown in Tokio async Rust?/strong>Cooperative shutdown means workers finish their current task before stopping — they are never cancelled mid-flight. In Tokio, implement with code>watch::channel(false)/code>: the lead calls code>sender.send(true)/code> to signal shutdown; each worker checks code>*receiver.borrow()/code> between task iterations (not inside task execution). This matches the Claude Code agent-teams behavior where "teammates finish their current request before shutting down." The code>ShutdownToken/code> / code>shutdown_pair()/code> pattern in code>team.rs/code> is a direct implementation of this./p>p>strong>How do I implement task dependencies in an async task queue?/strong>Store tasks as code>HashMap<TaskId, TaskEntry>/code> behind a code>Mutex/code>. Each code>TaskEntry/code> has a code>depends_on: Vec<TaskId>/code> field. code>claim()/code> locks the queue, computes the set of completed IDs, and picks the lowest-ID pending task whose all dependencies are in that set. On code>complete()/code> or code>fail()/code>, call code>notify.notify_waiters()/code> to wake idle workers blocked on code>queue.notify_handle().notified().await/code>. Workers that go idle call code>tokio::select!/code> on the notify handle and a poll timeout, then re-attempt code>claim()/code> on wake./p>p>strong>What is a plan approval gate in multi-agent systems?/strong>A plan gate is a synchronization point where a worker submits its plan and blocks until the lead approves or rejects it — used to give a human or lead agent a chance to review before the worker makes irreversible changes. In Rust, implement with code>Mutex<HashMap<worker_id, oneshot::Sender<PlanDecision>>>/code>: the worker calls code>submit_and_wait(plan)/code> which inserts a code>oneshot/code> channel sender and awaits the receiver. The lead calls code>approve(worker_id)/code> or code>reject(worker_id, feedback)/code>, which sends on the channel and unblocks the worker. code>PlanGate/code> in code>team.rs/code> is a direct implementation./p>p>strong>What is DeepSeek's tool use API?/strong>DeepSeek's tool use (function calling) is an OpenAI-compatible API feature where the model returns structured code>tool_calls/code> JSON when it needs external data. The caller executes the requested function, appends the result as a code>tool/code> message, and calls the API again. This repeats until code>finish_reason "stop"/code>. The a hrefhttps://github.com/nicolad/nomadically.work/blob/main/research/src/agent.rs target_blank relnoopener noreferrer class>code>agent.rs/code>/a> loop implements this directly in Rust without a framework dependency./p>p>strong>When should I use a multi-agent system instead of a single agent?/strong>When the task exceeds what a single context window can reliably hold, when subtasks can be parallelized for speed, or when different subtasks benefit from different system prompts or tool sets. Multi-agent overhead is only justified when the task structure genuinely benefits from it — for single-context tasks, a well-prompted single agent is faster and cheaper./p>p>strong>What Rust crates support async LLM agents?/strong>The code>rig/code> crate from 0xPlaygrounds is the most actively maintained Rust LLM agent framework (supports OpenAI, Anthropic, Cohere, and others). code>async_openai/code> provides lower-level async bindings. The a hrefhttps://github.com/nicolad/nomadically.work/tree/main/research target_blank relnoopener noreferrer class>research crate/a> implements its own thin client (a hrefhttps://github.com/nicolad/nomadically.work/blob/main/research/src/agent.rs target_blank relnoopener noreferrer class>code>agent.rs/code>/a>) against the DeepSeek API directly, plus a full coordination layer (a hrefhttps://github.com/nicolad/nomadically.work/blob/main/research/src/team.rs target_blank relnoopener noreferrer class>code>team.rs/code>/a>) — a valid approach when framework overhead outweighs the convenience./p>hr>p>em>Code samples are taken from a hrefhttps://github.com/nicolad/nomadically.work/blob/main/research/src/agent.rs target_blank relnoopener noreferrer class>code>research/src/agent.rs/code>/a>, a hrefhttps://github.com/nicolad/nomadically.work/blob/main/research/src/study.rs target_blank relnoopener noreferrer class>code>research/src/study.rs/code>/a>, and a hrefhttps://github.com/nicolad/nomadically.work/blob/main/research/src/team.rs target_blank relnoopener noreferrer class>code>research/src/team.rs/code>/a> and lightly condensed for readability; no logic has been altered./em>/p>/div>footer classrow docusaurus-mt-lg>div classcol>b>Tags:/b>ul classtags_eMma padding--none margin-left--sm>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/rust>rust/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/rust-async>rust-async/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/tokio>tokio/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/deepseek>deepseek/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/claude-code>claude-code/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/agent-teams>agent-teams/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/agent-coordination>agent-coordination/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/task-coordination>task-coordination/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/inter-agent-messaging>inter-agent-messaging/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/cooperative-shutdown>cooperative-shutdown/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/multi-agent-ai>multi-agent-ai/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/agentic-ai>agentic-ai/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/ai-architecture>ai-architecture/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/parallel-agents>parallel-agents/a>/li>/ul>/div>/footer>/article>article classmargin-bottom--xl>header>h2 classtitle_dNhx>a href/ai-sdlc-meta-approaches>The Two-Layer Model That Separates AI Teams That Ship from Those That Demo/a>/h2>div classcontainer_doFt margin-vert--md>time datetime2026-02-25T00:00:00.000Z>February 25, 2026/time> · !-- -->53 min read/div>div classmargin-top--md margin-bottom--sm row>div classcol col--12 authorCol_hjHn>div classavatar margin-bottom--sm>a classavatar__photo-link href/authors/nicolad>img classavatar__photo authorImage_kUwH srchttps://github.com/nicolad.png altVadim Nicolai>/a>div classavatar__intro authorDetails_ToDN>div classavatar__name>a href/authors/nicolad>span classauthorName_MPGl translateno>Vadim Nicolai/span>/a>/div>small classauthorTitle_d5ss titleSenior Software Engineer>Senior Software Engineer/small>div classauthorSocials_OyCQ>a hrefhttps://github.com/nicolad target_blank relnoopener noreferrer classauthorSocialLink_gxZK titleGitHub>svg xmlnshttp://www.w3.org/2000/svg width1em height1em viewBox0 0 256 250 preserveAspectRatioxMidYMid style--dark:#000;--light:#fff classauthorSocialIcon_b4L1 githubSvg_uT5Q>path dM128.001 0C57.317 0 0 57.307 0 128.001c0 56.554 36.676 104.535 87.535 121.46 6.397 1.185 8.746-2.777 8.746-6.158 0-3.052-.12-13.135-.174-23.83-35.61 7.742-43.124-15.103-43.124-15.103-5.823-14.795-14.213-18.73-14.213-18.73-11.613-7.944.876-7.78.876-7.78 12.853.902 19.621 13.19 19.621 13.19 11.417 19.568 29.945 13.911 37.249 10.64 1.149-8.272 4.466-13.92 8.127-17.116-28.431-3.236-58.318-14.212-58.318-63.258 0-13.975 5-25.394 13.188-34.358-1.329-3.224-5.71-16.242 1.24-33.874 0 0 10.749-3.44 35.21 13.121 10.21-2.836 21.16-4.258 32.038-4.307 10.878.049 21.837 1.47 32.066 4.307 24.431-16.56 35.165-13.12 35.165-13.12 6.967 17.63 2.584 30.65 1.255 33.873 8.207 8.964 13.173 20.383 13.173 34.358 0 49.163-29.944 59.988-58.447 63.157 4.591 3.972 8.682 11.762 8.682 23.704 0 17.126-.148 30.91-.148 35.126 0 3.407 2.304 7.398 8.792 6.14C219.37 232.5 256 184.537 256 128.002 256 57.307 198.691 0 128.001 0Zm-80.06 182.34c-.282.636-1.283.827-2.194.39-.929-.417-1.45-1.284-1.15-1.922.276-.655 1.279-.838 2.205-.399.93.418 1.46 1.293 1.139 1.931Zm6.296 5.618c-.61.566-1.804.303-2.614-.591-.837-.892-.994-2.086-.375-2.66.63-.566 1.787-.301 2.626.591.838.903 1 2.088.363 2.66Zm4.32 7.188c-.785.545-2.067.034-2.86-1.104-.784-1.138-.784-2.503.017-3.05.795-.547 2.058-.055 2.861 1.075.782 1.157.782 2.522-.019 3.08Zm7.304 8.325c-.701.774-2.196.566-3.29-.49-1.119-1.032-1.43-2.496-.726-3.27.71-.776 2.213-.558 3.315.49 1.11 1.03 1.45 2.505.701 3.27Zm9.442 2.81c-.31 1.003-1.75 1.459-3.199 1.033-1.448-.439-2.395-1.613-2.103-2.626.301-1.01 1.747-1.484 3.207-1.028 1.446.436 2.396 1.602 2.095 2.622Zm10.744 1.193c.036 1.055-1.193 1.93-2.715 1.95-1.53.034-2.769-.82-2.786-1.86 0-1.065 1.202-1.932 2.733-1.958 1.522-.03 2.768.818 2.768 1.868Zm10.555-.405c.182 1.03-.875 2.088-2.387 2.37-1.485.271-2.861-.365-3.05-1.386-.184-1.056.893-2.114 2.376-2.387 1.514-.263 2.868.356 3.061 1.403Z>/path>/svg>/a>a hrefhttps://www.linkedin.com/in/vadimnicolai/ target_blank relnoopener noreferrer classauthorSocialLink_gxZK titleLinkedIn>svg xmlnshttp://www.w3.org/2000/svg width1em height1em preserveAspectRatioxMidYMid viewBox0 0 256 256 style--dark:#0a66c2;--light:#ffffffe6 classauthorSocialIcon_b4L1 linkedinSvg_nq_B>path dM218.123 218.127h-37.931v-59.403c0-14.165-.253-32.4-19.728-32.4-19.756 0-22.779 15.434-22.779 31.369v60.43h-37.93V95.967h36.413v16.694h.51a39.907 39.907 0 0 1 35.928-19.733c38.445 0 45.533 25.288 45.533 58.186l-.016 67.013ZM56.955 79.27c-12.157.002-22.014-9.852-22.016-22.009-.002-12.157 9.851-22.014 22.008-22.016 12.157-.003 22.014 9.851 22.016 22.008A22.013 22.013 0 0 1 56.955 79.27m18.966 138.858H37.95V95.967h37.97v122.16ZM237.033.018H18.89C8.58-.098.125 8.161-.001 18.471v219.053c.122 10.315 8.576 18.582 18.89 18.474h218.144c10.336.128 18.823-8.139 18.966-18.474V18.454c-.147-10.33-8.635-18.588-18.966-18.453>/path>/svg>/a>/div>/div>/div>/div>/div>/header>div classmarkdown>p>In February 2024, a Canadian court ruled that Air Canada was liable for a refund policy its chatbot had invented. The policy did not exist in any document. The bot generated it from parametric memory, presented it as fact, a passenger relied on it, and the airline refused to honor it. The tribunal concluded it did not matter whether the policy came from a static page or a chatbot — it was on Air Canada's website and Air Canada was responsible. The chatbot was removed. Total cost: legal proceedings, compensation, reputational damage, and the permanent loss of customer trust in a support channel the company had invested in building./p>p>This was not a model failure. GPT-class models producing plausible-sounding but false information is a known, documented behavior. It was a strong>process failure/strong>: the team built a customer-facing system without a grounding policy, without an abstain path, and without any mechanism to verify that the bot's outputs corresponded to real company policy. Every one of those gaps maps directly to a meta approach this article covers./p>p>In 2025, a multi-agent LangChain setup entered a recursive loop and made 47,000 API calls in six hours. Cost: $47,000+. There were no rate limits, no cost alerts, no circuit breakers. The team discovered the problem by checking their billing dashboard./p>p>These are not edge cases. A January 2025 Mount Sinai study found leading AI chatbots hallucinated on 50–82.7% of fictional medical scenarios — GPT-4o's best-case error rate was 53%. Forty-seven percent of enterprise AI users admitted making at least one major business decision based on hallucinated content in 2024. Gartner estimates only 5% of GenAI pilots achieve rapid revenue acceleration. MIT research puts the fraction of enterprise AI demos that reach production-grade reliability at approximately 5%. The average prototype-to-production gap: eight months of engineering effort that often ends in rollback or permanent demo-mode operation./p>p>The gap between a working demo and a production-grade AI system is not a technical gap. It is a strategic one. Teams that ship adopt a coherent set of strong>meta approaches/strong> — architectural postures that define what the system fundamentally guarantees — before they choose frameworks, models, or methods. Teams that demo have the methods without the meta approaches./p>p>This article gives you both layers, how they map to each other, the real-world failures that happen when each is ignored, and exactly how to start activating strong>eval-first development/strong> and each other approach in your system today./p>div classtheme-admonition theme-admonition-note admonition_pzgI alert alert--secondary>div classadmonitionHeading_mFfB>span classadmonitionIcon_jqV3>svg viewBox0 0 14 16>path fill-ruleevenodd dM6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z>/path>/svg>/span>Industry Context (2025)/div>div classadmonitionContent_Xy4E>p>McKinsey reports strong>78% of organizations/strong> now use AI in at least one business function — up from 55% twelve months prior. Databricks found organizations put strong>11x more models into production/strong> year-over-year. Yet MIT research finds only strong>5% of GenAI pilots/strong> achieve rapid revenue acceleration. The gap is almost always strategic, not technical. Enterprise LLM spend reached strong>$8.4 billion/strong> in H1 2025 alone, with approximately 40% of enterprises now spending $250,000+ per year on LLM infrastructure./p>/div>/div>/div>footer classrow docusaurus-mt-lg>div classcol col--9>b>Tags:/b>ul classtags_eMma padding--none margin-left--sm>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/ai>ai/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/sdlc>sdlc/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/strategy>strategy/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/llm>llm/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/agents>agents/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/rag>rag/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/evals>evals/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/llmops>llmops/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/grounding>grounding/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/spec-driven>spec-driven/a>/li>/ul>/div>div classcol text--right col--3>a aria-labelRead more about The Two-Layer Model That Separates AI Teams That Ship from Those That Demo href/ai-sdlc-meta-approaches>b>Read more/b>/a>/div>/footer>/article>article classmargin-bottom--xl>header>h2 classtitle_dNhx>a href/code-improver-research-to-practice>5 Meta-Tools, 0 Ad-Hoc Edits: Structured Code Repair with AI Agents/a>/h2>div classcontainer_doFt margin-vert--md>time datetime2026-02-25T00:00:00.000Z>February 25, 2026/time> · !-- -->9 min read/div>div classmargin-top--md margin-bottom--sm row>div classcol col--12 authorCol_hjHn>div classavatar margin-bottom--sm>a classavatar__photo-link href/authors/nicolad>img classavatar__photo authorImage_kUwH srchttps://github.com/nicolad.png altVadim Nicolai>/a>div classavatar__intro authorDetails_ToDN>div classavatar__name>a href/authors/nicolad>span classauthorName_MPGl translateno>Vadim Nicolai/span>/a>/div>small classauthorTitle_d5ss titleSenior Software Engineer>Senior Software Engineer/small>div classauthorSocials_OyCQ>a hrefhttps://github.com/nicolad target_blank relnoopener noreferrer classauthorSocialLink_gxZK titleGitHub>svg xmlnshttp://www.w3.org/2000/svg width1em height1em viewBox0 0 256 250 preserveAspectRatioxMidYMid style--dark:#000;--light:#fff classauthorSocialIcon_b4L1 githubSvg_uT5Q>path dM128.001 0C57.317 0 0 57.307 0 128.001c0 56.554 36.676 104.535 87.535 121.46 6.397 1.185 8.746-2.777 8.746-6.158 0-3.052-.12-13.135-.174-23.83-35.61 7.742-43.124-15.103-43.124-15.103-5.823-14.795-14.213-18.73-14.213-18.73-11.613-7.944.876-7.78.876-7.78 12.853.902 19.621 13.19 19.621 13.19 11.417 19.568 29.945 13.911 37.249 10.64 1.149-8.272 4.466-13.92 8.127-17.116-28.431-3.236-58.318-14.212-58.318-63.258 0-13.975 5-25.394 13.188-34.358-1.329-3.224-5.71-16.242 1.24-33.874 0 0 10.749-3.44 35.21 13.121 10.21-2.836 21.16-4.258 32.038-4.307 10.878.049 21.837 1.47 32.066 4.307 24.431-16.56 35.165-13.12 35.165-13.12 6.967 17.63 2.584 30.65 1.255 33.873 8.207 8.964 13.173 20.383 13.173 34.358 0 49.163-29.944 59.988-58.447 63.157 4.591 3.972 8.682 11.762 8.682 23.704 0 17.126-.148 30.91-.148 35.126 0 3.407 2.304 7.398 8.792 6.14C219.37 232.5 256 184.537 256 128.002 256 57.307 198.691 0 128.001 0Zm-80.06 182.34c-.282.636-1.283.827-2.194.39-.929-.417-1.45-1.284-1.15-1.922.276-.655 1.279-.838 2.205-.399.93.418 1.46 1.293 1.139 1.931Zm6.296 5.618c-.61.566-1.804.303-2.614-.591-.837-.892-.994-2.086-.375-2.66.63-.566 1.787-.301 2.626.591.838.903 1 2.088.363 2.66Zm4.32 7.188c-.785.545-2.067.034-2.86-1.104-.784-1.138-.784-2.503.017-3.05.795-.547 2.058-.055 2.861 1.075.782 1.157.782 2.522-.019 3.08Zm7.304 8.325c-.701.774-2.196.566-3.29-.49-1.119-1.032-1.43-2.496-.726-3.27.71-.776 2.213-.558 3.315.49 1.11 1.03 1.45 2.505.701 3.27Zm9.442 2.81c-.31 1.003-1.75 1.459-3.199 1.033-1.448-.439-2.395-1.613-2.103-2.626.301-1.01 1.747-1.484 3.207-1.028 1.446.436 2.396 1.602 2.095 2.622Zm10.744 1.193c.036 1.055-1.193 1.93-2.715 1.95-1.53.034-2.769-.82-2.786-1.86 0-1.065 1.202-1.932 2.733-1.958 1.522-.03 2.768.818 2.768 1.868Zm10.555-.405c.182 1.03-.875 2.088-2.387 2.37-1.485.271-2.861-.365-3.05-1.386-.184-1.056.893-2.114 2.376-2.387 1.514-.263 2.868.356 3.061 1.403Z>/path>/svg>/a>a hrefhttps://www.linkedin.com/in/vadimnicolai/ target_blank relnoopener noreferrer classauthorSocialLink_gxZK titleLinkedIn>svg xmlnshttp://www.w3.org/2000/svg width1em height1em preserveAspectRatioxMidYMid viewBox0 0 256 256 style--dark:#0a66c2;--light:#ffffffe6 classauthorSocialIcon_b4L1 linkedinSvg_nq_B>path dM218.123 218.127h-37.931v-59.403c0-14.165-.253-32.4-19.728-32.4-19.756 0-22.779 15.434-22.779 31.369v60.43h-37.93V95.967h36.413v16.694h.51a39.907 39.907 0 0 1 35.928-19.733c38.445 0 45.533 25.288 45.533 58.186l-.016 67.013ZM56.955 79.27c-12.157.002-22.014-9.852-22.016-22.009-.002-12.157 9.851-22.014 22.008-22.016 12.157-.003 22.014 9.851 22.016 22.008A22.013 22.013 0 0 1 56.955 79.27m18.966 138.858H37.95V95.967h37.97v122.16ZM237.033.018H18.89C8.58-.098.125 8.161-.001 18.471v219.053c.122 10.315 8.576 18.582 18.89 18.474h218.144c10.336.128 18.823-8.139 18.966-18.474V18.454c-.147-10.33-8.635-18.588-18.966-18.453>/path>/svg>/a>/div>/div>/div>/div>/div>/header>div classmarkdown>p>There's a difference between an AI that can edit code and an AI that can repair code. Editing is mechanical — find a string, replace it. Repair requires understanding what's broken, why it's broken, and what the minimal fix looks like within the constraints of an existing codebase./p>p>The Code Improver is the fourth agent in our six-agent autonomous self-improvement pipeline for a hrefhttps://nomadically.work target_blank relnoopener noreferrer class>nomadically.work/a>. It's the only agent that writes application code. The Trajectory Miner finds patterns, the Codebase Auditor diagnoses issues, and the Skill Evolver improves instructions — but the Code Improver is the one that actually opens files and changes them./p>p>Five research papers informed its design, curated from the a hrefhttps://github.com/VoltAgent/awesome-ai-agent-papers target_blank relnoopener noreferrer class>VoltAgent/awesome-ai-agent-papers/a> collection. The central insight across all of them: structured repair workflows outperform ad-hoc fixing./p>blockquote>p>strong>Note:/strong> The implementation has since evolved from a generic code improver into a goal-driven "Skill Optimizer" focused on AI/ML skill taxonomy, extraction, and matching for the job search pipeline. The research principles described here still underpin the architecture. The meta-tools and scope constraints below reflect the original design that these papers informed./p>/blockquote>h2 classanchor anchorTargetStickyNavbar_eHHq idthe-difference-between-editing-and-repairing-code>The Difference Between Editing and Repairing Codea href#the-difference-between-editing-and-repairing-code classhash-link aria-labelDirect link to The Difference Between Editing and Repairing Code titleDirect link to The Difference Between Editing and Repairing Code translateno>/a>/h2>p>Ask any AI coding agent to "fix the N+1 query in this resolver" and you'll get an edit. Maybe it's correct. Maybe it breaks the DataLoader contract. Maybe it fixes the symptom but introduces a new query pattern that's worse. The SWE-bench benchmark shows even the best agents resolve only 21% of real-world software engineering tasks — and that's with well-defined problem statements./p>p>The issue isn't capability. It's methodology. An ad-hoc edit is a guess informed by context. A structured repair is a workflow: observe the code, analyze the pattern, apply a proven fix template, verify the result. The difference is the same as between a developer who "tries stuff until it works" and one who follows a diagnostic procedure./p>h2 classanchor anchorTargetStickyNavbar_eHHq idfive-papers-one-principle-structured-workflows-outperform-ad-hoc-fixing>Five Papers, One Principle: Structured Workflows Outperform Ad-Hoc Fixinga href#five-papers-one-principle-structured-workflows-outperform-ad-hoc-fixing classhash-link aria-labelDirect link to Five Papers, One Principle: Structured Workflows Outperform Ad-Hoc Fixing titleDirect link to Five Papers, One Principle: Structured Workflows Outperform Ad-Hoc Fixing translateno>/a>/h2>h3 classanchor anchorTargetStickyNavbar_eHHq idagyn-team-based-autonomous-software-engineering>Agyn: Team-Based Autonomous Software Engineeringa href#agyn-team-based-autonomous-software-engineering classhash-link aria-labelDirect link to Agyn: Team-Based Autonomous Software Engineering titleDirect link to Agyn: Team-Based Autonomous Software Engineering translateno>/a>/h3>p>Agyn (Wu et al., 2025) demonstrates that decomposing software engineering into specialized agent roles improves outcomes compared to a single monolithic agent. The paper defines roles like architect, developer, tester, and reviewer, each with distinct responsibilities and communication protocols./p>p>strong>How we used it:/strong> The Code Improver exists because of Agyn's principle of role specialization. In our pipeline, the roles are distributed across six agents. The Code Improver has a precisely defined scope:/p>p>strong>CAN edit:/strong> Application source code (code>src//code>, code>workers//code>, code>scripts//code>), GraphQL schema files, database schema, tests, worker code./p>p>strong>CANNOT edit:/strong> Skill files, commands, hooks, CLAUDE.md, optimization strategy — that's the Skill Evolver's job./p>p>This boundary prevents role confusion. When the Code Improver encounters an issue rooted in bad instructions rather than bad code, it skips it with an explanation rather than trying to fix both. The audit report's code>fix_strategy/code> field tells it whether a finding belongs to code>improve-apply/code> (code) or code>improve-evolve/code> (skills)./p>h3 classanchor anchorTargetStickyNavbar_eHHq idteam-of-rivals-specialized-roles-with-code-executor>Team of Rivals: Specialized Roles with Code Executora href#team-of-rivals-specialized-roles-with-code-executor classhash-link aria-labelDirect link to Team of Rivals: Specialized Roles with Code Executor titleDirect link to Team of Rivals: Specialized Roles with Code Executor translateno>/a>/h3>p>Team of Rivals (Liang et al., 2025) extends the multi-agent approach by introducing adversarial dynamics. Rather than agents cooperating blindly, they challenge each other's approaches. A code executor validates proposals by actually running them, creating a tight feedback loop between proposal and verification./p>p>strong>How we used it:/strong> While we don't implement adversarial dynamics within the Code Improver itself, the pipeline structure achieves the same effect. The Code Improver proposes fixes. The Verification Gate challenges them — running code>pnpm lint/code>, code>pnpm build/code>, checking conventions, looking for regressions. If the Verification Gate rejects a change, the Meta-Optimizer investigates. The "rivalry" is structural rather than within a single agent./p>h3 classanchor anchorTargetStickyNavbar_eHHq idtracecoder-observe-analyze-repair>TraceCoder: Observe-Analyze-Repaira href#tracecoder-observe-analyze-repair classhash-link aria-labelDirect link to TraceCoder: Observe-Analyze-Repair titleDirect link to TraceCoder: Observe-Analyze-Repair translateno>/a>/h3>p>TraceCoder (He et al., 2025) formalizes the three-phase approach to code debugging. The Codebase Auditor already implements the observe and analyze phases. The Code Improver completes the loop with the repair phase./p>p>strong>How we used it:/strong> The Code Improver's process explicitly follows Observe-Analyze-Repair:/p>p>strong>Observe:/strong> For every finding, read the audit report entry, read the affected files, read related files (imports, callers, tests), and understand the existing pattern./p>p>strong>Analyze:/strong> Determine the minimal change. Does it need a new function or can existing code be modified? Does it affect the public API? Are there tests that need updating?/p>p>strong>Repair:/strong> Implement the fix following all CLAUDE.md conventions./p>p>The "read before write" rule (Rule 1: "NEVER implement a finding without reading the code first") directly encodes TraceCoder's insight that agents produce better repairs when they observe thoroughly before acting./p>h3 classanchor anchorTargetStickyNavbar_eHHq idoptimizing-agentic-workflows-meta-tools-for-recurring-patterns>Optimizing Agentic Workflows: Meta-Tools for Recurring Patternsa href#optimizing-agentic-workflows-meta-tools-for-recurring-patterns classhash-link aria-labelDirect link to Optimizing Agentic Workflows: Meta-Tools for Recurring Patterns titleDirect link to Optimizing Agentic Workflows: Meta-Tools for Recurring Patterns translateno>/a>/h3>p>"Optimizing Agentic Workflows" (Chen et al., 2025) proposes meta-tools — reusable workflow templates for common agent operations. Rather than having agents figure out each task from scratch, meta-tools provide step-by-step procedures for recurring patterns./p>p>strong>How we used it:/strong> This paper directly inspired the five Workflow Meta-Tools — standardized repair procedures for the most common fix types:/p>h4 classanchor anchorTargetStickyNavbar_eHHq idfix-n1-query>Fix N+1 Querya href#fix-n1-query classhash-link aria-labelDirect link to Fix N+1 Query titleDirect link to Fix N+1 Query translateno>/a>/h4>ol>li class>Read the resolver making per-item DB calls/li>li class>Check if a DataLoader exists in code>context.loaders/code>/li>li class>If not, create a batch-loading DataLoader/li>li class>Replace direct DB call with code>context.loaders.X.load(id)/code>/li>/ol>p>In our codebase, N+1 queries are a known issue — skills, company, and ATS board sub-fields all lack DataLoaders. This meta-tool standardizes the fix pattern./p>h4 classanchor anchorTargetStickyNavbar_eHHq idfix-type-safety>Fix Type Safetya href#fix-type-safety classhash-link aria-labelDirect link to Fix Type Safety titleDirect link to Fix Type Safety translateno>/a>/h4>ol>li class>Find the code>any/code> type usage/li>li class>Trace the actual type (from schema, DB, or generated types)/li>li class>Replace code>any/code> with the correct type/li>li class>Fix downstream type errors/li>/ol>p>With 283+ code>any/code> types in resolvers, this is a high-frequency repair. The meta-tool ensures each fix follows the same approach: trace the type from code>@/__generated__/resolvers-types.ts/code> rather than guessing./p>h4 classanchor anchorTargetStickyNavbar_eHHq idfix-performance-full-table-scan>Fix Performance (Full Table Scan)a href#fix-performance-full-table-scan classhash-link aria-labelDirect link to Fix Performance (Full Table Scan) titleDirect link to Fix Performance (Full Table Scan) translateno>/a>/h4>ol>li class>Read the query/li>li class>Add appropriate WHERE clause or index/li>li class>Verify with the correct Drizzle filter/li>li class>Check with EXPLAIN if possible/li>/ol>p>The code>enhance-job.ts/code> resolver that fetches all jobs to find one by code>external_id/code> is the canonical example./p>h4 classanchor anchorTargetStickyNavbar_eHHq idfix-dead-code>Fix Dead Codea href#fix-dead-code classhash-link aria-labelDirect link to Fix Dead Code titleDirect link to Fix Dead Code translateno>/a>/h4>ol>li class>Verify it's truly unused (Grep for imports/references)/li>li class>Remove the code/li>li class>Remove now-unused imports/li>li class>Don't leave "removed" comments/li>/ol>p>The code>@libsql/client/code> and code>pg/code> dependencies after the D1 migration are prime candidates./p>h4 classanchor anchorTargetStickyNavbar_eHHq idfix-security>Fix Securitya href#fix-security classhash-link aria-labelDirect link to Fix Security titleDirect link to Fix Security translateno>/a>/h4>ol>li class>Add admin guard if missing (code>isAdminEmail()/code> from code>src/lib/admin.ts/code>)/li>li class>Replace raw SQL with Drizzle ORM/li>li class>Add input validation at system boundaries/li>li class>Never log secrets/li>/ol>h3 classanchor anchorTargetStickyNavbar_eHHq idpatchisland-diverse-llm-agent-ensemble-for-repair>PatchIsland: Diverse LLM Agent Ensemble for Repaira href#patchisland-diverse-llm-agent-ensemble-for-repair classhash-link aria-labelDirect link to PatchIsland: Diverse LLM Agent Ensemble for Repair titleDirect link to PatchIsland: Diverse LLM Agent Ensemble for Repair translateno>/a>/h3>p>PatchIsland (Chen et al., 2025) uses multiple LLM agents with different strategies to generate diverse repair candidates, then selects the best one. The insight is that different models and prompting strategies produce different types of fixes, and an ensemble approach catches issues that any single approach would miss./p>p>strong>How we used it:/strong> While we don't run multiple models in parallel (cost constraints), the PatchIsland principle shows up in two ways. First, the confidence score (0.0-1.0) on each implementation reflects the agent's self-assessed certainty — findings with confidence below 0.7 get flagged for human review, acknowledging that a single agent's fix might not be optimal. Second, the meta-tool approach itself provides "strategy diversity" — the same agent uses different repair procedures for different fix types rather than applying a one-size-fits-all approach./p>h2 classanchor anchorTargetStickyNavbar_eHHq idpost-implementation-discipline>Post-Implementation Disciplinea href#post-implementation-discipline classhash-link aria-labelDirect link to Post-Implementation Discipline titleDirect link to Post-Implementation Discipline translateno>/a>/h2>p>The Code Improver doesn't just write code and move on. After making changes:/p>ol>li class>If GraphQL schema was modified → run code>pnpm codegen/code>/li>li class>If DB schema was modified → run code>pnpm db:generate/code>/li>li class>Run code>pnpm lint/code> for every change/li>li class>Run code>pnpm build/code> for significant changes/li>li class>Re-read modified files to confirm correctness/li>li class>Check that imports are valid and no regressions exist in nearby code/li>/ol>p>This post-implementation checklist exists because early versions of the agent would make correct edits that broke unrelated code through import changes or type propagation. The checklist catches these cascade failures before the Verification Gate even sees the changes./p>h2 classanchor anchorTargetStickyNavbar_eHHq idwhy-zero-ad-hoc-edits-matters>Why Zero Ad-Hoc Edits Mattersa href#why-zero-ad-hoc-edits-matters classhash-link aria-labelDirect link to Why Zero Ad-Hoc Edits Matters titleDirect link to Why Zero Ad-Hoc Edits Matters translateno>/a>/h2>p>The Code Improver's maximum of 10 findings per run isn't a limitation — it's a design choice. Quality over quantity. Each fix must be traceable to an audit finding, implemented with a standardized meta-tool when applicable, verified by the agent itself, and then verified again by the Verification Gate./p>p>This structured approach produces something that ad-hoc AI code editing cannot: confidence. When the Code Improver reports a fix with confidence 0.95, it means the finding was diagnosed by the Codebase Auditor, the fix follows a proven meta-tool pattern, the lint passed, and the agent re-read its own output and confirmed correctness. That's not perfection, but it's a lot closer to how senior engineers work than "ask GPT to fix it."/p>h2 classanchor anchorTargetStickyNavbar_eHHq idreferences>Referencesa href#references classhash-link aria-labelDirect link to References titleDirect link to References translateno>/a>/h2>ol>li class>p>Benkovich, N. and Valkov, V. "Agyn: A Multi-Agent System for Team-Based Autonomous Software Engineering." arXiv preprint, 2026. a hrefhttps://arxiv.org/abs/2602.01465 target_blank relnoopener noreferrer class>https://arxiv.org/abs/2602.01465/a>/p>/li>li class>p>Vijayaraghavan, G., et al. "If You Want Coherence, Orchestrate a Team of Rivals: Multi-Agent Models of Organizational Intelligence." arXiv preprint, 2026. a hrefhttps://arxiv.org/abs/2601.14351 target_blank relnoopener noreferrer class>https://arxiv.org/abs/2601.14351/a>/p>/li>li class>p>Huang, J., et al. "TraceCoder: A Trace-Driven Multi-Agent Framework for Automated Debugging of LLM-Generated Code." ICSE 2026. a hrefhttps://conf.researchr.org/details/icse-2026/icse-2026-research-track/145/ target_blank relnoopener noreferrer class>https://conf.researchr.org/details/icse-2026/icse-2026-research-track/145//a>/p>/li>li class>p>"Optimizing Agentic Workflows using Meta-tools." arXiv preprint, 2026. a hrefhttps://arxiv.org/abs/2601.22037 target_blank relnoopener noreferrer class>https://arxiv.org/abs/2601.22037/a>/p>/li>li class>p>"PatchIsland: Orchestration of LLM Agents for Continuous Vulnerability Repair." arXiv preprint, 2026. a hrefhttps://arxiv.org/abs/2601.17471 target_blank relnoopener noreferrer class>https://arxiv.org/abs/2601.17471/a>/p>/li>/ol>hr>p>em>This article is part of a six-part series on building autonomous self-improvement agents, grounded in research from a hrefhttps://github.com/VoltAgent/awesome-ai-agent-papers target_blank relnoopener noreferrer class>VoltAgent/awesome-ai-agent-papers/a>. Data and implementation details from a hrefhttps://nomadically.work target_blank relnoopener noreferrer class>nomadically.work/a>./em>/p>/div>footer classrow docusaurus-mt-lg>div classcol>b>Tags:/b>ul classtags_eMma padding--none margin-left--sm>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/autonomous-agents>autonomous-agents/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/automated-repair>automated-repair/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/self-improvement>self-improvement/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/software-engineering>software-engineering/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/ai-code-repair>AI-code-repair/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/ai-agents>ai-agents/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/nomadically>nomadically/a>/li>/ul>/div>/footer>/article>article classmargin-bottom--xl>header>h2 classtitle_dNhx>a href/codebase-auditor-research-to-practice>Your Linter Can't Trace Execution Paths. This Agent Can./a>/h2>div classcontainer_doFt margin-vert--md>time datetime2026-02-25T00:00:00.000Z>February 25, 2026/time> · !-- -->9 min read/div>div classmargin-top--md margin-bottom--sm row>div classcol col--12 authorCol_hjHn>div classavatar margin-bottom--sm>a classavatar__photo-link href/authors/nicolad>img classavatar__photo authorImage_kUwH srchttps://github.com/nicolad.png altVadim Nicolai>/a>div classavatar__intro authorDetails_ToDN>div classavatar__name>a href/authors/nicolad>span classauthorName_MPGl translateno>Vadim Nicolai/span>/a>/div>small classauthorTitle_d5ss titleSenior Software Engineer>Senior Software Engineer/small>div classauthorSocials_OyCQ>a hrefhttps://github.com/nicolad target_blank relnoopener noreferrer classauthorSocialLink_gxZK titleGitHub>svg xmlnshttp://www.w3.org/2000/svg width1em height1em viewBox0 0 256 250 preserveAspectRatioxMidYMid style--dark:#000;--light:#fff classauthorSocialIcon_b4L1 githubSvg_uT5Q>path dM128.001 0C57.317 0 0 57.307 0 128.001c0 56.554 36.676 104.535 87.535 121.46 6.397 1.185 8.746-2.777 8.746-6.158 0-3.052-.12-13.135-.174-23.83-35.61 7.742-43.124-15.103-43.124-15.103-5.823-14.795-14.213-18.73-14.213-18.73-11.613-7.944.876-7.78.876-7.78 12.853.902 19.621 13.19 19.621 13.19 11.417 19.568 29.945 13.911 37.249 10.64 1.149-8.272 4.466-13.92 8.127-17.116-28.431-3.236-58.318-14.212-58.318-63.258 0-13.975 5-25.394 13.188-34.358-1.329-3.224-5.71-16.242 1.24-33.874 0 0 10.749-3.44 35.21 13.121 10.21-2.836 21.16-4.258 32.038-4.307 10.878.049 21.837 1.47 32.066 4.307 24.431-16.56 35.165-13.12 35.165-13.12 6.967 17.63 2.584 30.65 1.255 33.873 8.207 8.964 13.173 20.383 13.173 34.358 0 49.163-29.944 59.988-58.447 63.157 4.591 3.972 8.682 11.762 8.682 23.704 0 17.126-.148 30.91-.148 35.126 0 3.407 2.304 7.398 8.792 6.14C219.37 232.5 256 184.537 256 128.002 256 57.307 198.691 0 128.001 0Zm-80.06 182.34c-.282.636-1.283.827-2.194.39-.929-.417-1.45-1.284-1.15-1.922.276-.655 1.279-.838 2.205-.399.93.418 1.46 1.293 1.139 1.931Zm6.296 5.618c-.61.566-1.804.303-2.614-.591-.837-.892-.994-2.086-.375-2.66.63-.566 1.787-.301 2.626.591.838.903 1 2.088.363 2.66Zm4.32 7.188c-.785.545-2.067.034-2.86-1.104-.784-1.138-.784-2.503.017-3.05.795-.547 2.058-.055 2.861 1.075.782 1.157.782 2.522-.019 3.08Zm7.304 8.325c-.701.774-2.196.566-3.29-.49-1.119-1.032-1.43-2.496-.726-3.27.71-.776 2.213-.558 3.315.49 1.11 1.03 1.45 2.505.701 3.27Zm9.442 2.81c-.31 1.003-1.75 1.459-3.199 1.033-1.448-.439-2.395-1.613-2.103-2.626.301-1.01 1.747-1.484 3.207-1.028 1.446.436 2.396 1.602 2.095 2.622Zm10.744 1.193c.036 1.055-1.193 1.93-2.715 1.95-1.53.034-2.769-.82-2.786-1.86 0-1.065 1.202-1.932 2.733-1.958 1.522-.03 2.768.818 2.768 1.868Zm10.555-.405c.182 1.03-.875 2.088-2.387 2.37-1.485.271-2.861-.365-3.05-1.386-.184-1.056.893-2.114 2.376-2.387 1.514-.263 2.868.356 3.061 1.403Z>/path>/svg>/a>a hrefhttps://www.linkedin.com/in/vadimnicolai/ target_blank relnoopener noreferrer classauthorSocialLink_gxZK titleLinkedIn>svg xmlnshttp://www.w3.org/2000/svg width1em height1em preserveAspectRatioxMidYMid viewBox0 0 256 256 style--dark:#0a66c2;--light:#ffffffe6 classauthorSocialIcon_b4L1 linkedinSvg_nq_B>path dM218.123 218.127h-37.931v-59.403c0-14.165-.253-32.4-19.728-32.4-19.756 0-22.779 15.434-22.779 31.369v60.43h-37.93V95.967h36.413v16.694h.51a39.907 39.907 0 0 1 35.928-19.733c38.445 0 45.533 25.288 45.533 58.186l-.016 67.013ZM56.955 79.27c-12.157.002-22.014-9.852-22.016-22.009-.002-12.157 9.851-22.014 22.008-22.016 12.157-.003 22.014 9.851 22.016 22.008A22.013 22.013 0 0 1 56.955 79.27m18.966 138.858H37.95V95.967h37.97v122.16ZM237.033.018H18.89C8.58-.098.125 8.161-.001 18.471v219.053c.122 10.315 8.576 18.582 18.89 18.474h218.144c10.336.128 18.823-8.139 18.966-18.474V18.454c-.147-10.33-8.635-18.588-18.966-18.453>/path>/svg>/a>/div>/div>/div>/div>/div>/header>div classmarkdown>p>Static analysis tools find pattern violations. Linters catch style issues. But neither traces an N+1 query from a GraphQL resolver through a DataLoader absence to a frontend performance degradation. That requires understanding execution paths — and that's what the Codebase Auditor does./p>p>The Codebase Auditor is the second agent in our six-agent autonomous self-improvement pipeline for a hrefhttps://nomadically.work target_blank relnoopener noreferrer class>nomadically.work/a>. It receives pattern IDs from the Trajectory Miner, investigates the actual code exhaustively, and produces findings with exact code>file:line/code> references. It never modifies code — it only reads and reports./p>p>Four research papers shaped its design, curated from the a hrefhttps://github.com/VoltAgent/awesome-ai-agent-papers target_blank relnoopener noreferrer class>VoltAgent/awesome-ai-agent-papers/a> collection. Here is how each one translated into practice./p>blockquote>p>strong>Note:/strong> The implementation has since evolved from a generic codebase auditor into a goal-driven "Discovery Expander" focused on finding more AI engineering companies and job boards. The research principles described here still underpin the architecture. The playbooks and data structures below reflect the original design that these papers informed./p>/blockquote>h2 classanchor anchorTargetStickyNavbar_eHHq idwhat-linters-miss>What Linters Missa href#what-linters-miss classhash-link aria-labelDirect link to What Linters Miss titleDirect link to What Linters Miss translateno>/a>/h2>p>ESLint will tell you about an unused variable. SonarQube will flag a code smell. Neither will tell you that your code>enhance-job.ts/code> resolver fetches every job in the database to find one by code>external_id/code> — a full table scan that degrades with every job you add. Neither will trace a missing admin guard from mutation definition through resolver to production exposure. The gap between pattern matching and execution path tracing is where real bugs live./p>p>Google's 2025 DORA Report found that 90% AI adoption increase correlates with a 91% increase in code review time. More AI-generated code means more code to review — and linters aren't scaling to meet the need. What's needed isn't a faster linter. It's an agent that investigates like a senior engineer: following imports, reading callers, tracing data flow across layers./p>h2 classanchor anchorTargetStickyNavbar_eHHq idfour-papers-one-auditor>Four Papers, One Auditora href#four-papers-one-auditor classhash-link aria-labelDirect link to Four Papers, One Auditor titleDirect link to Four Papers, One Auditor translateno>/a>/h2>h3 classanchor anchorTargetStickyNavbar_eHHq idtracecoder-observe-analyze-repair>TraceCoder: Observe-Analyze-Repaira href#tracecoder-observe-analyze-repair classhash-link aria-labelDirect link to TraceCoder: Observe-Analyze-Repair titleDirect link to TraceCoder: Observe-Analyze-Repair translateno>/a>/h3>p>TraceCoder (He et al., 2025) introduces a three-phase loop for LLM-based code debugging: observe the code and its runtime behavior, analyze what's wrong, and propose a repair. The paper demonstrates that separating observation from analysis significantly improves debugging accuracy — agents that jump to conclusions before thoroughly reading the code produce worse fixes./p>p>The critical insight is that LLM agents tend to pattern-match on surface-level code features rather than tracing actual execution paths. TraceCoder forces a structured observation phase that must complete before analysis begins./p>p>strong>How we used it:/strong> The Codebase Auditor's first two phases directly implement TraceCoder's observe-analyze loop (we omit the repair phase — that's the Code Improver's job):/p>p>strong>Observe Phase:/strong> For each target area, the agent systematically reads the primary files, traces imports and dependencies, reads related tests, checks the schema and types that constrain the code, and looks for TODO/FIXME/HACK comments. This isn't a keyword search — it's following the call chain./p>p>strong>Analyze Phase:/strong> Each observation gets classified into a structured finding with type, severity, location, evidence (the actual code snippet), root cause, impact, fix strategy, and a confidence score from 0.0 to 1.0./p>p>The separation matters. In early prototypes without this structure, the agent would read a file, spot an code>any/code> type, immediately suggest a fix, and miss that the code>any/code> was masking a deeper schema mismatch three files away./p>h3 classanchor anchorTargetStickyNavbar_eHHq idtrajad-trajectory-anomaly-detection>TrajAD: Trajectory Anomaly Detectiona href#trajad-trajectory-anomaly-detection classhash-link aria-labelDirect link to TrajAD: Trajectory Anomaly Detection titleDirect link to TrajAD: Trajectory Anomaly Detection translateno>/a>/h3>p>TrajAD (Li et al., 2025) is a specialized verifier that detects errors in LLM agent trajectories — sequences of actions that went wrong. Rather than evaluating individual actions, it evaluates the trajectory as a whole, catching errors that look reasonable in isolation but form a problematic pattern in sequence./p>p>strong>How we used it:/strong> TrajAD's approach directly maps to the Analyze Phase's classification system. Each finding is not just a point-in-time observation but includes links to mining report patterns (code>related_patterns: "P-xxx"/code>), creating a trajectory view. The confidence score (0.0-1.0) is a direct application of TrajAD's anomaly scoring — findings below 0.7 confidence must be flagged as "needs verification."/p>p>This prevents the auditor from reporting false positives with false certainty. When the agent reads code and isn't sure whether something is actually a bug or an intentional design choice, it says so./p>h3 classanchor anchorTargetStickyNavbar_eHHq idgraph-rag-for-codebases-ast-derived-navigation>Graph-RAG for Codebases: AST-Derived Navigationa href#graph-rag-for-codebases-ast-derived-navigation classhash-link aria-labelDirect link to Graph-RAG for Codebases: AST-Derived Navigation titleDirect link to Graph-RAG for Codebases: AST-Derived Navigation translateno>/a>/h3>p>"Reliable Graph-RAG for Codebases" (Zhang et al., 2025) proposes using AST-derived knowledge graphs for code understanding. Instead of treating code as flat text, it builds a graph of relationships — function calls, imports, type hierarchies, data flow — and uses this graph to navigate the codebase intelligently./p>p>strong>How we used it:/strong> While we don't build an explicit AST graph, the Observe Phase implements the same principle through structured code navigation. The agent doesn't grep for keywords — it follows imports, reads callers, checks type definitions, and traces data flow through resolvers. In a GraphQL codebase like ours, this means following the path from schema definition → resolver → Drizzle query → D1 database./p>h3 classanchor anchorTargetStickyNavbar_eHHq idarchitecture-aware-evaluation>Architecture-Aware Evaluationa href#architecture-aware-evaluation classhash-link aria-labelDirect link to Architecture-Aware Evaluation titleDirect link to Architecture-Aware Evaluation translateno>/a>/h3>p>Architecture-Aware Evaluation (Wang et al., 2025) links code findings to architectural components, answering not just "what's wrong" but "which layer is affected and what cascades." A bug in a database query might seem isolated, but if it's in a resolver called by every frontend page, the blast radius is the entire application./p>p>strong>How we used it:/strong> The auditor's Architecture Trace phase maps every finding to the project's layers:/p>div classlanguage-json codeBlockContainer_Yv7m theme-code-block style--prism-color:#F8F8F2;--prism-background-color:#282A36>div classcodeBlockContent_RrKf>pre tabindex0 classprism-code language-json codeBlock_bNmq thin-scrollbar stylecolor:#F8F8F2;background-color:#282A36>code classcodeBlockLines_bZid>span classtoken-line stylecolor:#F8F8F2>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken property>"architecture_map"/span>span classtoken operator>:/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken property>"affected_layers"/span>span classtoken operator>:/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>/span>span classtoken string stylecolor:rgb(255, 121, 198)>"db"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken string stylecolor:rgb(255, 121, 198)>"api"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken string stylecolor:rgb(255, 121, 198)>"resolver"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken string stylecolor:rgb(255, 121, 198)>"frontend"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken string stylecolor:rgb(255, 121, 198)>"worker"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain> /span>span classtoken string stylecolor:rgb(255, 121, 198)>"agent"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken property>"cascade_risks"/span>span classtoken operator>:/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>/span>span classtoken string stylecolor:rgb(255, 121, 198)>"Finding F-001 in resolver affects F-003 in frontend"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken property>"systemic_issues"/span>span classtoken operator>:/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>/span>span classtoken string stylecolor:rgb(255, 121, 198)>"Issues that appear across multiple files"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>br>/span>/code>/pre>/div>/div>p>This is especially valuable in our architecture where data flows through multiple layers: code>D1 Database → Gateway Worker → Drizzle ORM → Apollo Resolver → GraphQL → React Frontend/code>. A type mismatch at the database layer cascades through every layer above it./p>h2 classanchor anchorTargetStickyNavbar_eHHq idthe-four-playbooks>The Four Playbooksa href#the-four-playbooks classhash-link aria-labelDirect link to The Four Playbooks titleDirect link to The Four Playbooks translateno>/a>/h2>p>The Codebase Auditor includes four investigation playbooks — standardized checklists for common audit types. Each playbook is grounded in real issues we've encountered in the nomadically.work codebase./p>h3 classanchor anchorTargetStickyNavbar_eHHq idperformance-playbook>Performance Playbooka href#performance-playbook classhash-link aria-labelDirect link to Performance Playbook titleDirect link to Performance Playbook translateno>/a>/h3>ol>li class>Search for N+1 query patterns — resolvers calling the database inside field resolvers without DataLoaders/li>li class>Check for missing indexes on frequently-queried columns/li>li class>Look for full table scans — code>SELECT */code> without code>WHERE/code>/li>li class>Find unbounded queries — no code>LIMIT/code>/li>li class>Check for synchronous operations that could be parallel/li>/ol>p>strong>Real example:/strong> The code>enhance-job.ts/code> resolver fetches all jobs to find one by code>external_id/code> — a full table scan documented in CLAUDE.md's known issues. The playbook catches this systematically rather than stumbling on it./p>h3 classanchor anchorTargetStickyNavbar_eHHq idtype-safety-playbook>Type Safety Playbooka href#type-safety-playbook classhash-link aria-labelDirect link to Type Safety Playbook titleDirect link to Type Safety Playbook translateno>/a>/h3>ol>li class>Grep for code>any/code> type usage in resolvers and agents/li>li class>Check for missing null checks on nullable DB columns/li>li class>Verify GraphQL resolver return types match schema/li>li class>Look for unchecked code>JSON.parse/code> calls/li>li class>Check for D1 boolean coercion issues (0/1 vs true/false)/li>/ol>p>strong>Real example:/strong> The project has 283+ code>any/code> types in resolvers. D1 returns code>0/code>/code>1/code> for SQLite integers while GraphQL expects code>true/code>/code>false/code> — the playbook specifically checks for this D1-specific gotcha./p>h3 classanchor anchorTargetStickyNavbar_eHHq idsecurity-playbook>Security Playbooka href#security-playbook classhash-link aria-labelDirect link to Security Playbook titleDirect link to Security Playbook translateno>/a>/h3>ol>li class>Verify admin guards on all mutations/li>li class>Check for SQL injection vectors (raw SQL strings)/li>li class>Look for exposed secrets or API keys in code/li>li class>Check CORS configuration/li>li class>Verify input validation on API routes/li>/ol>p>strong>Real example:/strong> The D1 Gateway Worker has code>CORS: */code> — a known issue. The playbook ensures every mutation includes the code>isAdminEmail()/code> guard from code>src/lib/admin.ts/code>./p>h3 classanchor anchorTargetStickyNavbar_eHHq iddead-code-playbook>Dead Code Playbooka href#dead-code-playbook classhash-link aria-labelDirect link to Dead Code Playbook titleDirect link to Dead Code Playbook translateno>/a>/h3>ol>li class>Find exports with no importers/li>li class>Find files with no references/li>li class>Check for unused dependencies in code>package.json/code>/li>li class>Look for commented-out code blocks/li>li class>Find TODO comments older than current patterns/li>/ol>p>strong>Real example:/strong> code>@libsql/client/code> and code>pg/code> dependencies remain in code>package.json/code> after the D1 migration — likely unused. The code>insert-jobs/code> worker still references Turso in its help text. The playbook catches stale code that humans overlook because it doesn't break anything./p>h2 classanchor anchorTargetStickyNavbar_eHHq idcross-referencing-known-issues>Cross-Referencing Known Issuesa href#cross-referencing-known-issues classhash-link aria-labelDirect link to Cross-Referencing Known Issues titleDirect link to Cross-Referencing Known Issues translateno>/a>/h2>p>A subtle but important feature: the auditor reads CLAUDE.md's "Known issues" section before reporting. It won't re-report issues that are already documented unless it has new information — such as discovering the issue is worse than documented or finding the root cause of a known symptom./p>p>This prevents the improvement pipeline from generating redundant work. The team already knows about CORS code>*/code> on the gateway. The auditor's job is to find what the team doesn't know./p>h2 classanchor anchorTargetStickyNavbar_eHHq idread-only-by-design>Read-Only by Designa href#read-only-by-design classhash-link aria-labelDirect link to Read-Only by Design titleDirect link to Read-Only by Design translateno>/a>/h2>p>Traditional static analysis operates at the syntax level. Code review by humans operates at the understanding level but doesn't scale. The Codebase Auditor sits between these — it traces execution paths like a human reviewer but does so systematically across the entire codebase, guided by playbooks that encode institutional knowledge about what to look for./p>p>The read-only constraint is fundamental. By never modifying code, the auditor can be aggressive in its investigation without risk. It can report 20 findings per audit (its configured limit), each with confidence scores, and let the downstream Code Improver decide which ones to actually fix. This separation of diagnosis from treatment mirrors how senior engineers work: the person who identifies the problem isn't always the person who fixes it./p>p>Your linter will keep catching semicolons. This agent will keep tracing the execution paths where the real problems hide./p>h2 classanchor anchorTargetStickyNavbar_eHHq idreferences>Referencesa href#references classhash-link aria-labelDirect link to References titleDirect link to References translateno>/a>/h2>ol>li class>p>Huang, J., et al. "TraceCoder: A Trace-Driven Multi-Agent Framework for Automated Debugging of LLM-Generated Code." ICSE 2026. a hrefhttps://conf.researchr.org/details/icse-2026/icse-2026-research-track/145/ target_blank relnoopener noreferrer class>https://conf.researchr.org/details/icse-2026/icse-2026-research-track/145//a>/p>/li>li class>p>Pathak, D., et al. "Detecting Silent Failures in Multi-Agentic AI Trajectories." arXiv preprint, 2025. a hrefhttps://arxiv.org/abs/2511.04032 target_blank relnoopener noreferrer class>https://arxiv.org/abs/2511.04032/a>/p>/li>li class>p>"Reliable Graph-RAG for Codebases: AST-Derived Graphs vs LLM-Extracted Knowledge Graphs." arXiv preprint, 2026. a hrefhttps://arxiv.org/abs/2601.08773 target_blank relnoopener noreferrer class>https://arxiv.org/abs/2601.08773/a>/p>/li>li class>p>"Toward Architecture-Aware Evaluation Metrics for LLM Agents." arXiv preprint, 2026. a hrefhttps://arxiv.org/abs/2601.19583 target_blank relnoopener noreferrer class>https://arxiv.org/abs/2601.19583/a>/p>/li>/ol>hr>p>em>This article is part of a six-part series on building autonomous self-improvement agents, grounded in research from a hrefhttps://github.com/VoltAgent/awesome-ai-agent-papers target_blank relnoopener noreferrer class>VoltAgent/awesome-ai-agent-papers/a>. Data and implementation details from a hrefhttps://nomadically.work target_blank relnoopener noreferrer class>nomadically.work/a>./em>/p>/div>footer classrow docusaurus-mt-lg>div classcol>b>Tags:/b>ul classtags_eMma padding--none margin-left--sm>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/autonomous-agents>autonomous-agents/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/code-auditing>code-auditing/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/self-improvement>self-improvement/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/software-quality>software-quality/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/ai-code-review>AI-code-review/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/ai-agents>ai-agents/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/nomadically>nomadically/a>/li>/ul>/div>/footer>/article>article classmargin-bottom--xl>header>h2 classtitle_dNhx>a href/meta-optimizer-research-to-practice>We Built a Strategic Brain for Our AI Pipeline. Here's What It Learned./a>/h2>div classcontainer_doFt margin-vert--md>time datetime2026-02-25T00:00:00.000Z>February 25, 2026/time> · !-- -->10 min read/div>div classmargin-top--md margin-bottom--sm row>div classcol col--12 authorCol_hjHn>div classavatar margin-bottom--sm>a classavatar__photo-link href/authors/nicolad>img classavatar__photo authorImage_kUwH srchttps://github.com/nicolad.png altVadim Nicolai>/a>div classavatar__intro authorDetails_ToDN>div classavatar__name>a href/authors/nicolad>span classauthorName_MPGl translateno>Vadim Nicolai/span>/a>/div>small classauthorTitle_d5ss titleSenior Software Engineer>Senior Software Engineer/small>div classauthorSocials_OyCQ>a hrefhttps://github.com/nicolad target_blank relnoopener noreferrer classauthorSocialLink_gxZK titleGitHub>svg xmlnshttp://www.w3.org/2000/svg width1em height1em viewBox0 0 256 250 preserveAspectRatioxMidYMid style--dark:#000;--light:#fff classauthorSocialIcon_b4L1 githubSvg_uT5Q>path dM128.001 0C57.317 0 0 57.307 0 128.001c0 56.554 36.676 104.535 87.535 121.46 6.397 1.185 8.746-2.777 8.746-6.158 0-3.052-.12-13.135-.174-23.83-35.61 7.742-43.124-15.103-43.124-15.103-5.823-14.795-14.213-18.73-14.213-18.73-11.613-7.944.876-7.78.876-7.78 12.853.902 19.621 13.19 19.621 13.19 11.417 19.568 29.945 13.911 37.249 10.64 1.149-8.272 4.466-13.92 8.127-17.116-28.431-3.236-58.318-14.212-58.318-63.258 0-13.975 5-25.394 13.188-34.358-1.329-3.224-5.71-16.242 1.24-33.874 0 0 10.749-3.44 35.21 13.121 10.21-2.836 21.16-4.258 32.038-4.307 10.878.049 21.837 1.47 32.066 4.307 24.431-16.56 35.165-13.12 35.165-13.12 6.967 17.63 2.584 30.65 1.255 33.873 8.207 8.964 13.173 20.383 13.173 34.358 0 49.163-29.944 59.988-58.447 63.157 4.591 3.972 8.682 11.762 8.682 23.704 0 17.126-.148 30.91-.148 35.126 0 3.407 2.304 7.398 8.792 6.14C219.37 232.5 256 184.537 256 128.002 256 57.307 198.691 0 128.001 0Zm-80.06 182.34c-.282.636-1.283.827-2.194.39-.929-.417-1.45-1.284-1.15-1.922.276-.655 1.279-.838 2.205-.399.93.418 1.46 1.293 1.139 1.931Zm6.296 5.618c-.61.566-1.804.303-2.614-.591-.837-.892-.994-2.086-.375-2.66.63-.566 1.787-.301 2.626.591.838.903 1 2.088.363 2.66Zm4.32 7.188c-.785.545-2.067.034-2.86-1.104-.784-1.138-.784-2.503.017-3.05.795-.547 2.058-.055 2.861 1.075.782 1.157.782 2.522-.019 3.08Zm7.304 8.325c-.701.774-2.196.566-3.29-.49-1.119-1.032-1.43-2.496-.726-3.27.71-.776 2.213-.558 3.315.49 1.11 1.03 1.45 2.505.701 3.27Zm9.442 2.81c-.31 1.003-1.75 1.459-3.199 1.033-1.448-.439-2.395-1.613-2.103-2.626.301-1.01 1.747-1.484 3.207-1.028 1.446.436 2.396 1.602 2.095 2.622Zm10.744 1.193c.036 1.055-1.193 1.93-2.715 1.95-1.53.034-2.769-.82-2.786-1.86 0-1.065 1.202-1.932 2.733-1.958 1.522-.03 2.768.818 2.768 1.868Zm10.555-.405c.182 1.03-.875 2.088-2.387 2.37-1.485.271-2.861-.365-3.05-1.386-.184-1.056.893-2.114 2.376-2.387 1.514-.263 2.868.356 3.061 1.403Z>/path>/svg>/a>a hrefhttps://www.linkedin.com/in/vadimnicolai/ target_blank relnoopener noreferrer classauthorSocialLink_gxZK titleLinkedIn>svg xmlnshttp://www.w3.org/2000/svg width1em height1em preserveAspectRatioxMidYMid viewBox0 0 256 256 style--dark:#0a66c2;--light:#ffffffe6 classauthorSocialIcon_b4L1 linkedinSvg_nq_B>path dM218.123 218.127h-37.931v-59.403c0-14.165-.253-32.4-19.728-32.4-19.756 0-22.779 15.434-22.779 31.369v60.43h-37.93V95.967h36.413v16.694h.51a39.907 39.907 0 0 1 35.928-19.733c38.445 0 45.533 25.288 45.533 58.186l-.016 67.013ZM56.955 79.27c-12.157.002-22.014-9.852-22.016-22.009-.002-12.157 9.851-22.014 22.008-22.016 12.157-.003 22.014 9.851 22.016 22.008A22.013 22.013 0 0 1 56.955 79.27m18.966 138.858H37.95V95.967h37.97v122.16ZM237.033.018H18.89C8.58-.098.125 8.161-.001 18.471v219.053c.122 10.315 8.576 18.582 18.89 18.474h218.144c10.336.128 18.823-8.139 18.966-18.474V18.454c-.147-10.33-8.635-18.588-18.966-18.453>/path>/svg>/a>/div>/div>/div>/div>/div>/header>div classmarkdown>p>Five agents in our pipeline know how to mine patterns, audit code, evolve skills, fix bugs, and verify changes. None of them knows em>when/em> to do any of those things. That is the Meta-Optimizer's job./p>p>The Meta-Optimizer is the sixth and final agent in our autonomous self-improvement pipeline for a hrefhttps://nomadically.work target_blank relnoopener noreferrer class>nomadically.work/a>. It is the strategic brain: it reads all reports from other agents, determines the current phase of the system, creates prioritized action plans, and enforces safety constraints. It never edits code or skills directly. It only decides what should happen next./p>p>Six research papers shaped its design. Together, they address the hardest problem in autonomous improvement: knowing when to improve, when to stop, and when to call for help./p>blockquote>p>strong>Note:/strong> The implementation has since evolved from a generic code-improvement coordinator into a goal-driven job-search optimizer ("Strategy Brain"). The research principles described here still underpin the architecture, but the phase names, decision tables, and state schema have changed to reflect domain-specific priorities. The code snippets below reflect the original design that these papers informed./p>/blockquote>h2 classanchor anchorTargetStickyNavbar_eHHq idfive-agents-zero-coordination>Five Agents, Zero Coordinationa href#five-agents-zero-coordination classhash-link aria-labelDirect link to Five Agents, Zero Coordination titleDirect link to Five Agents, Zero Coordination translateno>/a>/h2>p>Gartner reported a 1,445% surge in multi-agent system inquiries from Q1 2024 to Q2 2025. Everyone is building multi-agent systems. Almost nobody is building the coordinator. The result: agent pipelines that run every agent on every cycle, regardless of what the system actually needs. Mining reports pile up unread. Audits repeat areas already audited. Fixes conflict with other fixes. The agents are individually capable but collectively aimless./p>p>The Meta-Optimizer exists because five specialist agents without coordination produce churn, not improvement. By February 2026, frontier models crossed 14.5 hours of autonomous work — but autonomy without strategy is just expensive compute./p>h2 classanchor anchorTargetStickyNavbar_eHHq idsix-papers-that-shaped-the-strategic-brain>Six Papers That Shaped the Strategic Braina href#six-papers-that-shaped-the-strategic-brain classhash-link aria-labelDirect link to Six Papers That Shaped the Strategic Brain titleDirect link to Six Papers That Shaped the Strategic Brain translateno>/a>/h2>h3 classanchor anchorTargetStickyNavbar_eHHq idroma-recursive-task-decomposition>ROMA: Recursive Task Decompositiona href#roma-recursive-task-decomposition classhash-link aria-labelDirect link to ROMA: Recursive Task Decomposition titleDirect link to ROMA: Recursive Task Decomposition translateno>/a>/h3>p>a hrefhttps://arxiv.org/abs/2602.01848 target_blank relnoopener noreferrer class>ROMA/a> (Li et al., 2026) proposes a recursive framework for decomposing complex tasks into parallel subtrees that multiple agents can work on simultaneously. The key insight: not all subtasks have equal priority or dependencies. ROMA's recursive decomposition respects these constraints while maximizing parallelism./p>p>strong>How we used it:/strong> The Meta-Optimizer's action plan is a ROMA-style decomposition:/p>div classlanguage-text codeBlockContainer_Yv7m theme-code-block style--prism-color:#F8F8F2;--prism-background-color:#282A36>div classcodeBlockContent_RrKf>pre tabindex0 classprism-code language-text codeBlock_bNmq thin-scrollbar stylecolor:#F8F8F2;background-color:#282A36>code classcodeBlockLines_bZid>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>ACTION_PLAN: {/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> phase: "IMPROVEMENT|SATURATION|COLLAPSE_RISK",/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> actions: /span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> {/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> priority: 1,/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> agent: "improve-mine|improve-audit|improve-evolve|improve-apply|improve-verify",/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> task: "Specific task description",/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> inputs: { ... },/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> expected_outcome: "...",/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> cost_estimate: "low|medium|high",/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> risk_level: "low|medium|high"/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> }/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> ,/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> deferred: ...,/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> meta_actions: .../span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>}/span>br>/span>/code>/pre>/div>/div>p>Actions are prioritized, and the orchestrator executes them respecting dependencies. Mining and auditing run in parallel (both are read-only). Evolution and code improvement run in parallel (they target different file scopes). Verification runs after both. The Meta-Optimizer encodes these dependencies in the action plan./p>h3 classanchor anchorTargetStickyNavbar_eHHq iddytopo-dynamic-topology-rewiring>DyTopo: Dynamic Topology Rewiringa href#dytopo-dynamic-topology-rewiring classhash-link aria-labelDirect link to DyTopo: Dynamic Topology Rewiring titleDirect link to DyTopo: Dynamic Topology Rewiring translateno>/a>/h3>p>a hrefhttps://arxiv.org/abs/2602.06039 target_blank relnoopener noreferrer class>DyTopo/a> (Zhang et al., 2026) introduces dynamic topology rewiring in multi-agent systems. Instead of fixed agent-to-agent connections, DyTopo adjusts which agents communicate with which others based on the current task. Some tasks need deep collaboration; others need isolation./p>p>strong>How we used it:/strong> The Meta-Optimizer implements DyTopo through selective routing. Not every cycle uses every agent. The Decision Framework encodes this:/p>table>thead>tr>th>Situation/th>th>Action/th>/tr>/thead>tbody>tr>td>No mining report exists/td>td>Run improve-mine first/td>/tr>tr>td>Mining report exists, no audit/td>td>Run improve-audit on top patterns/td>/tr>tr>td>Audit exists, no implementation/td>td>Route findings to improve-evolve or improve-apply/td>/tr>tr>td>Changes made, no verification/td>td>Run improve-verify/td>/tr>tr>td>Verification REJECT/td>td>Investigate rejection, fix or revert/td>/tr>tr>td>Verification ACCEPT/td>td>Update meta-state, plan next cycle/td>/tr>tr>td>Same pattern recurring 3+ times/td>td>Escalate -- the fix is not working/td>/tr>tr>td>No improvement files exist/td>td>Cold start -- wait for sessions to accumulate/td>/tr>tr>td>Score collapse detected/td>td>HALT everything, recommend human review/td>/tr>/tbody>/table>p>This is dynamic routing: the topology of agent communication changes based on what state files exist and what their contents show. A cycle might involve all six agents or just two, depending on what the system needs./p>h3 classanchor anchorTargetStickyNavbar_eHHq idcaster-self-optimization-via-negative-feedback>CASTER: Self-Optimization via Negative Feedbacka href#caster-self-optimization-via-negative-feedback classhash-link aria-labelDirect link to CASTER: Self-Optimization via Negative Feedback titleDirect link to CASTER: Self-Optimization via Negative Feedback translateno>/a>/h3>p>a hrefhttps://arxiv.org/abs/2601.19793 target_blank relnoopener noreferrer class>CASTER/a> (Liu et al., 2026) builds a self-optimizing router that improves its routing decisions based on failure signals. When a routed task fails, CASTER adjusts routing weights to avoid similar failures in the future./p>p>strong>How we used it:/strong> The Meta-Optimizer tracks pattern recurrence. If pattern P-003 was identified, a fix was applied, and the same pattern appears again in a later mining report, the routing strategy failed. The Meta-Optimizer records this and adjusts: the fix should target architecture instead of code, or the finding needs a Skill Evolver edit instead of a Code Improver fix./p>p>After three recurrences of the same pattern, the Meta-Optimizer escalates with a "need different approach" flag. This prevents the pipeline from applying the same ineffective fix repeatedly -- CASTER's negative feedback applied to the improvement pipeline itself./p>h3 classanchor anchorTargetStickyNavbar_eHHq idmonoscale-safe-scaling-with-non-decreasing-performance>MonoScale: Safe Scaling with Non-Decreasing Performancea href#monoscale-safe-scaling-with-non-decreasing-performance classhash-link aria-labelDirect link to MonoScale: Safe Scaling with Non-Decreasing Performance titleDirect link to MonoScale: Safe Scaling with Non-Decreasing Performance translateno>/a>/h3>p>a hrefhttps://arxiv.org/abs/2601.23219 target_blank relnoopener noreferrer class>MonoScale/a> (Wang et al., 2026) addresses a persistent problem in scaling multi-agent systems: adding more agents or more iterations does not always improve performance. Sometimes it degrades it. MonoScale provides guarantees that scaling operations produce non-decreasing performance./p>p>strong>How we used it:/strong> MonoScale's principle maps directly to our safety constraints:/p>ul>li class>strong>Maximum three code changes per cycle/strong> -- prevents churn from excessive modifications/li>li class>strong>Maximum two skill evolutions per cycle/strong> -- prevents instruction drift/li>li class>strong>Mandatory verification after any write operation/strong> -- catches degradation immediately/li>li class>strong>10+ files modified without human review triggers a pause/strong> -- cumulative change threshold/li>li class>strong>Score collapse (3+ dimensions dropping) halts everything/strong> -- the last-resort safeguard/li>/ul>p>These are not arbitrary limits. They are MonoScale-style bounds that ensure each cycle produces non-negative improvement. A cycle that makes three changes and verifies them is safer than a cycle that makes 20 changes and hopes for the best./p>h3 classanchor anchorTargetStickyNavbar_eHHq idphase-transition-theory-for-multi-agent-systems>Phase Transition Theory for Multi-Agent Systemsa href#phase-transition-theory-for-multi-agent-systems classhash-link aria-labelDirect link to Phase Transition Theory for Multi-Agent Systems titleDirect link to Phase Transition Theory for Multi-Agent Systems translateno>/a>/h3>p>a hrefhttps://arxiv.org/abs/2601.17311 target_blank relnoopener noreferrer class>Phase Transition research/a> (Chen et al., 2026) studies how multi-agent systems move between distinct operating regimes. The key finding: systems exhibit three phases -- improvement, saturation, and collapse -- and the transitions between them are predictable from score trends./p>p>strong>How we used it:/strong> Phase Detection is the most consequential decision the Meta-Optimizer makes:/p>p>strong>IMPROVEMENT phase:/strong> Scores are trending up. The system is working. Keep making changes, focusing on high-impact patterns. This is the normal operating mode./p>p>strong>SATURATION phase:/strong> Scores are stable. The easy wins are done. Switch to diminishing-returns awareness: focus on untouched areas or architectural improvements. Do not force changes for the sake of activity./p>p>strong>COLLAPSE RISK phase:/strong> Scores are dropping after recent changes. Something went wrong. Stop making changes immediately. Investigate regressions. Consider reverting recent changes. Recommend human review./p>p>The phase determines everything downstream. In IMPROVEMENT, the Meta-Optimizer routes aggressively -- mine, audit, evolve, apply, verify. In SATURATION, it routes conservatively -- mine and audit only, looking for new areas to explore. In COLLAPSE RISK, it routes defensively -- verify only, no new changes./p>h3 classanchor anchorTargetStickyNavbar_eHHq idbayesian-orchestration-cost-aware-decision-making>Bayesian Orchestration: Cost-Aware Decision Makinga href#bayesian-orchestration-cost-aware-decision-making classhash-link aria-labelDirect link to Bayesian Orchestration: Cost-Aware Decision Making titleDirect link to Bayesian Orchestration: Cost-Aware Decision Making translateno>/a>/h3>p>a hrefhttps://arxiv.org/abs/2601.01522 target_blank relnoopener noreferrer class>Bayesian Orchestration/a> (Kim et al., 2026) applies cost-aware sequential decision-making to multi-LLM workflows. The insight: not all operations cost the same, and an orchestrator should prefer cheaper operations when the expected benefit is small./p>p>strong>How we used it:/strong> The Meta-Optimizer maintains a cost hierarchy:/p>table>thead>tr>th>Operation/th>th>Cost/th>th>Tools Used/th>/tr>/thead>tbody>tr>td>Mining, auditing/td>td>Low/td>td>Glob, Grep, Read/td>/tr>tr>td>Skill evolution/td>td>Medium/td>td>Read, Edit/td>/tr>tr>td>Code improvement/td>td>High/td>td>Read, Edit, Bash (builds)/td>/tr>tr>td>Verification/td>td>High/td>td>Bash (lint, build)/td>/tr>/tbody>/table>p>The Meta-Optimizer prefers cheaper actions when the expected improvement is small. A pattern with severity "low" and effort "large" gets deferred in favor of a "high" severity, "small" effort pattern -- even if the large-effort pattern would produce bigger improvement eventually. This prevents the pipeline from spending API tokens on marginal improvements./p>h2 classanchor anchorTargetStickyNavbar_eHHq idpersistent-state>Persistent Statea href#persistent-state classhash-link aria-labelDirect link to Persistent State titleDirect link to Persistent State translateno>/a>/h2>p>Unlike other agents that produce one-off reports, the Meta-Optimizer maintains persistent state across cycles:/p>div classlanguage-json codeBlockContainer_Yv7m theme-code-block style--prism-color:#F8F8F2;--prism-background-color:#282A36>div classcodeBlockContent_RrKf>pre tabindex0 classprism-code language-json codeBlock_bNmq thin-scrollbar stylecolor:#F8F8F2;background-color:#282A36>code classcodeBlockLines_bZid>span classtoken-line stylecolor:#F8F8F2>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken property>"last_updated"/span>span classtoken operator>:/span>span classtoken plain> /span>span classtoken string stylecolor:rgb(255, 121, 198)>"ISO timestamp"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken property>"cycle_count"/span>span classtoken operator>:/span>span classtoken plain> /span>span classtoken number>0/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken property>"phase"/span>span classtoken operator>:/span>span classtoken plain> /span>span classtoken string stylecolor:rgb(255, 121, 198)>"IMPROVEMENT|SATURATION|COLLAPSE_RISK"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken property>"score_history"/span>span classtoken operator>:/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken property>"patterns_resolved"/span>span classtoken operator>:/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>/span>span classtoken string stylecolor:rgb(255, 121, 198)>"P-001"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken property>"patterns_recurring"/span>span classtoken operator>:/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>/span>span classtoken string stylecolor:rgb(255, 121, 198)>"P-003"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken property>"files_under_improvement"/span>span classtoken operator>:/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken property>"total_files_modified"/span>span classtoken operator>:/span>span classtoken plain> /span>span classtoken number>0/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken property>"human_review_needed"/span>span classtoken operator>:/span>span classtoken plain> /span>span classtoken boolean>false/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken property>"next_action"/span>span classtoken operator>:/span>span classtoken plain> /span>span classtoken string stylecolor:rgb(255, 121, 198)>"What to do in the next cycle"/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>br>/span>/code>/pre>/div>/div>p>This state accumulates across sessions. When a new improvement cycle starts, the Meta-Optimizer reads its own history before planning. This prevents it from re-auditing areas that were just audited, re-mining data that was just mined, or applying fixes to files already under active improvement./p>h2 classanchor anchorTargetStickyNavbar_eHHq idwhen-to-ask-for-help>When to Ask for Helpa href#when-to-ask-for-help classhash-link aria-labelDirect link to When to Ask for Help titleDirect link to When to Ask for Help translateno>/a>/h2>p>The Meta-Optimizer has a code>human_attention_needed/code> field in its output. It activates when:/p>ul>li class>Score collapse is detected (3+ dimensions dropping)/li>li class>The same pattern has recurred three or more times despite fixes/li>li class>10 or more cumulative files have been modified without human review/li>li class>The Meta-Optimizer's own action plans keep leading to REJECT verdicts/li>li class>The improvement pipeline itself appears to be degrading/li>/ul>p>This is the most important feature. An autonomous system that does not know when to stop being autonomous is not safe -- it is unmonitored. The Meta-Optimizer's final rule: "Be conservative -- a stable system is better than a constantly-changing one."/p>h2 classanchor anchorTargetStickyNavbar_eHHq idheres-what-it-learned>Here's What It Learneda href#heres-what-it-learned classhash-link aria-labelDirect link to Here's What It Learned titleDirect link to Here's What It Learned translateno>/a>/h2>p>The Meta-Optimizer addresses the recursive control problem: who controls the controllers? In our pipeline, five agents do work, and the Meta-Optimizer decides what work to do. But who decides if the Meta-Optimizer is making good decisions? The answer is the Meta-Optimizer itself -- through phase detection, score tracking, and the willingness to request human review when its own strategies fail./p>p>This is not a solved problem. The Meta-Optimizer cannot distinguish between "my action plan was wrong" and "the downstream agents executed poorly." But by tracking score trends across cycles rather than evaluating individual cycles, it detects systemic issues: if five consecutive cycles improve scores, the strategy is working. If three consecutive cycles degrade scores, something is wrong at the strategic level./p>p>The improvement pipeline is only as good as its coordinator. An aggressive Meta-Optimizer that routes every finding to immediate fixing produces churn. A passive one that defers everything produces stagnation. The right balance -- informed by Phase Transition theory, constrained by MonoScale bounds, guided by CASTER's negative feedback -- is what makes autonomous self-improvement work in practice./p>p>That's what the strategic brain learned: the hardest decision in an autonomous system isn't what to improve. It's when to stop./p>h2 classanchor anchorTargetStickyNavbar_eHHq idreferences>Referencesa href#references classhash-link aria-labelDirect link to References titleDirect link to References translateno>/a>/h2>ol>li class>p>Li, H., et al. "ROMA: Recursive Open Meta-Agent Framework for Multi-Agent Systems." arXiv preprint, 2026. a hrefhttps://arxiv.org/abs/2602.01848 target_blank relnoopener noreferrer class>https://arxiv.org/abs/2602.01848/a>/p>/li>li class>p>Zhang, Y., et al. "DyTopo: Dynamic Topology Routing via Semantic Matching for Multi-Agent Systems." arXiv preprint, 2026. a hrefhttps://arxiv.org/abs/2602.06039 target_blank relnoopener noreferrer class>https://arxiv.org/abs/2602.06039/a>/p>/li>li class>p>Liu, Y., et al. "CASTER: Context-Aware Strategy for Task Efficient Routing." arXiv preprint, 2026. a hrefhttps://arxiv.org/abs/2601.19793 target_blank relnoopener noreferrer class>https://arxiv.org/abs/2601.19793/a>/p>/li>li class>p>Wang, J., et al. "MonoScale: Scaling Multi-Agent Systems with Monotonic Improvement Guarantees." arXiv preprint, 2026. a hrefhttps://arxiv.org/abs/2601.23219 target_blank relnoopener noreferrer class>https://arxiv.org/abs/2601.23219/a>/p>/li>li class>p>Chen, Z., et al. "Phase Transition for Budgeted Multi-Agent Synergy." arXiv preprint, 2026. a hrefhttps://arxiv.org/abs/2601.17311 target_blank relnoopener noreferrer class>https://arxiv.org/abs/2601.17311/a>/p>/li>li class>p>Kim, S., et al. "Bayesian Orchestration: Cost-Aware Sequential Decision-Making for Multi-LLM Workflows." arXiv preprint, 2026. a hrefhttps://arxiv.org/abs/2601.01522 target_blank relnoopener noreferrer class>https://arxiv.org/abs/2601.01522/a>/p>/li>/ol>hr>p>em>This article is part of a six-part series on building autonomous self-improvement agents, grounded in research from a hrefhttps://github.com/VoltAgent/awesome-ai-agent-papers target_blank relnoopener noreferrer class>VoltAgent/awesome-ai-agent-papers/a>. Data and implementation details from a hrefhttps://nomadically.work target_blank relnoopener noreferrer class>nomadically.work/a>./em>/p>/div>footer classrow docusaurus-mt-lg>div classcol>b>Tags:/b>ul classtags_eMma padding--none margin-left--sm>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/autonomous-agents>autonomous-agents/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/meta-optimization>meta-optimization/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/self-improvement>self-improvement/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/multi-agent-systems>multi-agent-systems/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/ai-orchestration>AI-orchestration/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/ai-agents>ai-agents/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/nomadically>nomadically/a>/li>/ul>/div>/footer>/article>article classmargin-bottom--xl>header>h2 classtitle_dNhx>a href/skill-evolver-research-to-practice>How We Built an Agent That Edits Its Own Instructions/a>/h2>div classcontainer_doFt margin-vert--md>time datetime2026-02-25T00:00:00.000Z>February 25, 2026/time> · !-- -->9 min read/div>div classmargin-top--md margin-bottom--sm row>div classcol col--12 authorCol_hjHn>div classavatar margin-bottom--sm>a classavatar__photo-link href/authors/nicolad>img classavatar__photo authorImage_kUwH srchttps://github.com/nicolad.png altVadim Nicolai>/a>div classavatar__intro authorDetails_ToDN>div classavatar__name>a href/authors/nicolad>span classauthorName_MPGl translateno>Vadim Nicolai/span>/a>/div>small classauthorTitle_d5ss titleSenior Software Engineer>Senior Software Engineer/small>div classauthorSocials_OyCQ>a hrefhttps://github.com/nicolad target_blank relnoopener noreferrer classauthorSocialLink_gxZK titleGitHub>svg xmlnshttp://www.w3.org/2000/svg width1em height1em viewBox0 0 256 250 preserveAspectRatioxMidYMid style--dark:#000;--light:#fff classauthorSocialIcon_b4L1 githubSvg_uT5Q>path dM128.001 0C57.317 0 0 57.307 0 128.001c0 56.554 36.676 104.535 87.535 121.46 6.397 1.185 8.746-2.777 8.746-6.158 0-3.052-.12-13.135-.174-23.83-35.61 7.742-43.124-15.103-43.124-15.103-5.823-14.795-14.213-18.73-14.213-18.73-11.613-7.944.876-7.78.876-7.78 12.853.902 19.621 13.19 19.621 13.19 11.417 19.568 29.945 13.911 37.249 10.64 1.149-8.272 4.466-13.92 8.127-17.116-28.431-3.236-58.318-14.212-58.318-63.258 0-13.975 5-25.394 13.188-34.358-1.329-3.224-5.71-16.242 1.24-33.874 0 0 10.749-3.44 35.21 13.121 10.21-2.836 21.16-4.258 32.038-4.307 10.878.049 21.837 1.47 32.066 4.307 24.431-16.56 35.165-13.12 35.165-13.12 6.967 17.63 2.584 30.65 1.255 33.873 8.207 8.964 13.173 20.383 13.173 34.358 0 49.163-29.944 59.988-58.447 63.157 4.591 3.972 8.682 11.762 8.682 23.704 0 17.126-.148 30.91-.148 35.126 0 3.407 2.304 7.398 8.792 6.14C219.37 232.5 256 184.537 256 128.002 256 57.307 198.691 0 128.001 0Zm-80.06 182.34c-.282.636-1.283.827-2.194.39-.929-.417-1.45-1.284-1.15-1.922.276-.655 1.279-.838 2.205-.399.93.418 1.46 1.293 1.139 1.931Zm6.296 5.618c-.61.566-1.804.303-2.614-.591-.837-.892-.994-2.086-.375-2.66.63-.566 1.787-.301 2.626.591.838.903 1 2.088.363 2.66Zm4.32 7.188c-.785.545-2.067.034-2.86-1.104-.784-1.138-.784-2.503.017-3.05.795-.547 2.058-.055 2.861 1.075.782 1.157.782 2.522-.019 3.08Zm7.304 8.325c-.701.774-2.196.566-3.29-.49-1.119-1.032-1.43-2.496-.726-3.27.71-.776 2.213-.558 3.315.49 1.11 1.03 1.45 2.505.701 3.27Zm9.442 2.81c-.31 1.003-1.75 1.459-3.199 1.033-1.448-.439-2.395-1.613-2.103-2.626.301-1.01 1.747-1.484 3.207-1.028 1.446.436 2.396 1.602 2.095 2.622Zm10.744 1.193c.036 1.055-1.193 1.93-2.715 1.95-1.53.034-2.769-.82-2.786-1.86 0-1.065 1.202-1.932 2.733-1.958 1.522-.03 2.768.818 2.768 1.868Zm10.555-.405c.182 1.03-.875 2.088-2.387 2.37-1.485.271-2.861-.365-3.05-1.386-.184-1.056.893-2.114 2.376-2.387 1.514-.263 2.868.356 3.061 1.403Z>/path>/svg>/a>a hrefhttps://www.linkedin.com/in/vadimnicolai/ target_blank relnoopener noreferrer classauthorSocialLink_gxZK titleLinkedIn>svg xmlnshttp://www.w3.org/2000/svg width1em height1em preserveAspectRatioxMidYMid viewBox0 0 256 256 style--dark:#0a66c2;--light:#ffffffe6 classauthorSocialIcon_b4L1 linkedinSvg_nq_B>path dM218.123 218.127h-37.931v-59.403c0-14.165-.253-32.4-19.728-32.4-19.756 0-22.779 15.434-22.779 31.369v60.43h-37.93V95.967h36.413v16.694h.51a39.907 39.907 0 0 1 35.928-19.733c38.445 0 45.533 25.288 45.533 58.186l-.016 67.013ZM56.955 79.27c-12.157.002-22.014-9.852-22.016-22.009-.002-12.157 9.851-22.014 22.008-22.016 12.157-.003 22.014 9.851 22.016 22.008A22.013 22.013 0 0 1 56.955 79.27m18.966 138.858H37.95V95.967h37.97v122.16ZM237.033.018H18.89C8.58-.098.125 8.161-.001 18.471v219.053c.122 10.315 8.576 18.582 18.89 18.474h218.144c10.336.128 18.823-8.139 18.966-18.474V18.454c-.147-10.33-8.635-18.588-18.966-18.453>/path>/svg>/a>/div>/div>/div>/div>/div>/header>div classmarkdown>p>Most AI systems have a hard boundary between the instructions they follow and the work they do. Developers write prompts; the AI executes them. If the prompts are wrong, a human fixes them. We built an agent that fixes its own prompts./p>p>The Skill Evolver is the third agent in our six-agent autonomous self-improvement pipeline for a hrefhttps://nomadically.work target_blank relnoopener noreferrer class>nomadically.work/a>. Its scope is precisely defined: it can edit skill files, commands, hooks, CLAUDE.md, and memory files. It cannot touch application source code — that's the Code Improver's job. This agent improves the instructions that all other agents follow./p>p>Five research papers informed its design, curated from the a hrefhttps://github.com/VoltAgent/awesome-ai-agent-papers target_blank relnoopener noreferrer class>VoltAgent/awesome-ai-agent-papers/a> collection. Each one solved a different aspect of the self-modification problem./p>blockquote>p>strong>Note:/strong> The implementation has since evolved from a generic skill evolver into a goal-driven "Classifier Tuner" focused on reducing false negatives in remote EU job classification. The research principles described here still underpin the architecture. The data structures and anti-patterns below reflect the original design that these papers informed./p>/blockquote>h2 classanchor anchorTargetStickyNavbar_eHHq idthe-self-modification-problem>The Self-Modification Problema href#the-self-modification-problem classhash-link aria-labelDirect link to The Self-Modification Problem titleDirect link to The Self-Modification Problem translateno>/a>/h2>p>The idea of AI editing its own prompts sounds either brilliant or terrifying, depending on your perspective. The Awesome Self-Evolving Agents survey catalogs dozens of papers on the topic, but almost none show a working implementation with safety constraints. The gap between "agents that can self-modify" and "agents that should self-modify" is where the interesting engineering lives./p>p>The Skill Evolver's scope is deliberately narrow: it can edit Markdown skill files, commands, hooks, and memory files. It cannot touch application source code. This boundary is the single most important design decision — an agent that can modify its own instructions AND the codebase has an unbounded blast radius. An agent that can only modify Markdown files? The worst case is a bad prompt, which the Verification Gate will catch./p>h2 classanchor anchorTargetStickyNavbar_eHHq idfive-papers-that-shaped-the-design>Five Papers That Shaped the Designa href#five-papers-that-shaped-the-design classhash-link aria-labelDirect link to Five Papers That Shaped the Design titleDirect link to Five Papers That Shaped the Design translateno>/a>/h2>h3 classanchor anchorTargetStickyNavbar_eHHq idmeta-context-engineering-a-meta-agent-evolving-its-own-context>Meta Context Engineering: A Meta-Agent Evolving Its Own Contexta href#meta-context-engineering-a-meta-agent-evolving-its-own-context classhash-link aria-labelDirect link to Meta Context Engineering: A Meta-Agent Evolving Its Own Context titleDirect link to Meta Context Engineering: A Meta-Agent Evolving Its Own Context translateno>/a>/h3>p>Meta Context Engineering (Chen et al., 2025) proposes a meta-agent architecture where the agent responsible for improving the system is itself guided by structured context that it can modify. The paper demonstrates that agents with self-modifiable context outperform those with fixed instructions on long-horizon tasks, because they accumulate task-specific knowledge over time./p>p>The key contribution is formalizing the feedback loop: observe performance → diagnose root cause → modify context → observe new performance. Without this structure, self-modification tends toward either overfitting (reacting to every failure) or inertia (never changing anything)./p>p>strong>How we used it:/strong> The Skill Evolver's Evidence-Based Evolution process is a direct implementation. Every proposed change must link to evidence:/p>div classlanguage-text codeBlockContainer_Yv7m theme-code-block style--prism-color:#F8F8F2;--prism-background-color:#282A36>div classcodeBlockContent_RrKf>pre tabindex0 classprism-code language-text codeBlock_bNmq thin-scrollbar stylecolor:#F8F8F2;background-color:#282A36>code classcodeBlockLines_bZid>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>EVOLUTION: {/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> id: "E-001",/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> target_file: "path to file being modified",/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> trigger_patterns: "P-xxx",/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> trigger_findings: "F-xxx",/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> change_type: "add_instruction|clarify_instruction|remove_instruction|...",/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> before: "The exact text being replaced",/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> after: "The new text",/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> rationale: "Why this specific change addresses the root cause",/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> expected_impact: {/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> "dimensions": "which scores should improve",/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> "magnitude": "small|medium|large",/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> "regression_risk": "none|low|medium|high"/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> }/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>}/span>br>/span>/code>/pre>/div>/div>p>No evolution can happen without a code>trigger_patterns/code> or code>trigger_findings/code> reference. This prevents the agent from making "improvements" based on vibes rather than evidence./p>h3 classanchor anchorTargetStickyNavbar_eHHq idevoconfig-self-evolving-configuration>EvoConfig: Self-Evolving Configurationa href#evoconfig-self-evolving-configuration classhash-link aria-labelDirect link to EvoConfig: Self-Evolving Configuration titleDirect link to EvoConfig: Self-Evolving Configuration translateno>/a>/h3>p>EvoConfig (Park et al., 2025) addresses the configuration problem in multi-agent systems: as the system evolves, configuration parameters that were optimal at deployment become suboptimal. The paper proposes a mechanism for agents to update their own configuration based on observed performance, with guardrails to prevent catastrophic changes./p>p>strong>How we used it:/strong> The Skill Evolver's scope definition is an EvoConfig-style approach. Rather than allowing unconstrained self-modification, we define exactly what can be modified:/p>p>strong>CAN edit:/strong> code>.claude/skills/*/SKILL.md/code>, code>.claude/commands/*.md/code>, code>.claude/hooks/*.py/code>, code>CLAUDE.md/code>, code>OPTIMIZATION-STRATEGY.md/code>, auto-memory files./p>p>strong>CANNOT edit:/strong> Application source code, schema files, configuration files, generated files./p>p>This scope boundary is the most important safety feature. An agent that can modify its own instructions AND the codebase has an unbounded blast radius. By restricting the Skill Evolver to instruction files only, the worst case is a bad prompt — which the Verification Gate will catch./p>h3 classanchor anchorTargetStickyNavbar_eHHq idcaster-self-optimization-via-negative-feedback>CASTER: Self-Optimization via Negative Feedbacka href#caster-self-optimization-via-negative-feedback classhash-link aria-labelDirect link to CASTER: Self-Optimization via Negative Feedback titleDirect link to CASTER: Self-Optimization via Negative Feedback translateno>/a>/h3>p>CASTER (Liu et al., 2026) is a self-optimizing router that uses negative feedback loops to improve its task routing over time. When a routed task fails, CASTER adjusts its routing strategy based on the failure signal. The paper shows that this negative-feedback approach converges faster than positive-feedback methods because failures are more informative than successes./p>p>strong>How we used it:/strong> The Apply Changes phase implements CASTER's principle. The agent follows these priorities when editing:/p>ol>li class>strong>Minimal diff/strong> — change as little as possible/li>li class>strong>Additive over destructive/strong> — add clarifications rather than removing instructions/li>li class>strong>Specific over general/strong> — concrete examples rather than abstract rules/li>li class>strong>Testable/strong> — every instruction should be verifiable by the scoring system/li>/ol>p>The negative feedback connection: the Skill Evolver only acts when scores drop. It doesn't optimize what's already working — it fixes what's failing. Each evolution targets the specific failure mode (hallucination, wrong_tool, out_of_role) identified in the mining report./p>h3 classanchor anchorTargetStickyNavbar_eHHq idreprompt-requirements-guided-prompt-optimization>REprompt: Requirements-Guided Prompt Optimizationa href#reprompt-requirements-guided-prompt-optimization classhash-link aria-labelDirect link to REprompt: Requirements-Guided Prompt Optimization titleDirect link to REprompt: Requirements-Guided Prompt Optimization translateno>/a>/h3>p>REprompt (Zhang et al., 2025) formalizes prompt optimization as a requirements satisfaction problem. Rather than iteratively tweaking prompts, it starts with explicit requirements (what the prompt must achieve) and systematically generates prompts that satisfy them. The paper demonstrates that requirements-guided optimization produces more robust prompts than iterative refinement./p>p>strong>How we used it:/strong> Every evolution has explicit code>expected_impact.dimensions/code> — the score dimensions it should improve. This transforms prompt editing from "this sounds better" into "this should increase task_completion scores by addressing the root cause of pattern P-003." The Verification Gate later checks whether the expected improvement materialized./p>h3 classanchor anchorTargetStickyNavbar_eHHq idautonomous-question-formation>Autonomous Question Formationa href#autonomous-question-formation classhash-link aria-labelDirect link to Autonomous Question Formation titleDirect link to Autonomous Question Formation translateno>/a>/h3>p>"Autonomous Question Formation" (Wang et al., 2025) argues that agents should ask themselves targeted questions before acting, rather than relying solely on the information provided. The paper shows that self-questioning reduces errors on complex tasks by forcing the agent to make implicit assumptions explicit./p>p>strong>How we used it:/strong> The Skill Evolver includes a mandatory Self-Questioning step before any edit:/p>ul>li class>Will this change help the specific failure pattern, or is it too broad?/li>li class>Could this change cause regression in other dimensions?/li>li class>Is the root cause in the skill instructions, or in the code the skill operates on?/li>li class>Am I adding complexity that will make the skill harder to follow?/li>li class>Is there a simpler fix (e.g., one line added to CLAUDE.md)?/li>/ul>p>The last question is the most powerful. We found that early versions of the Skill Evolver would rewrite entire skill files when a single line in CLAUDE.md would have fixed the issue. The self-questioning forces it to consider the simplest intervention first./p>h2 classanchor anchorTargetStickyNavbar_eHHq idthe-five-anti-patterns>The Five Anti-Patternsa href#the-five-anti-patterns classhash-link aria-labelDirect link to The Five Anti-Patterns titleDirect link to The Five Anti-Patterns translateno>/a>/h2>p>Through iterative testing, we identified five failure modes that the Skill Evolver must avoid. These are documented in the skill file as explicit anti-patterns:/p>ol>li class>p>strong>Instruction bloat/strong> — continuously adding rules without removing old ones. Sometimes the fix is to simplify, not add. If a skill file grows past a certain size, the agents reading it may truncate or skip instructions./p>/li>li class>p>strong>Contradictory instructions/strong> — adding a new rule that conflicts with an existing one. The agent must check for conflicts before writing. "Always use DataLoaders" and "query directly for single-item lookups" coexist fine — but only if both are stated./p>/li>li class>p>strong>Over-specificity/strong> — adding rules for one-off incidents. The minimum threshold is frequency > 2 (inherited from the Trajectory Miner). A single bad session doesn't justify a permanent instruction change./p>/li>li class>p>strong>Prompt engineering theater/strong> — plastering "IMPORTANT:" and "CRITICAL:" on everything. These markers lose their meaning when overused. The skill file explicitly says: "Be precise instead."/p>/li>li class>p>strong>Cargo cult/strong> — copying patterns from research papers without understanding why they work in this specific context. A paper showing that chain-of-thought improves math reasoning doesn't mean we should add chain-of-thought to every skill file./p>/li>/ol>h2 classanchor anchorTargetStickyNavbar_eHHq idthe-feedback-loop>The Feedback Loopa href#the-feedback-loop classhash-link aria-labelDirect link to The Feedback Loop titleDirect link to The Feedback Loop translateno>/a>/h2>p>The Skill Evolver doesn't operate in isolation. Its changes are validated by the Verification Gate, which checks:/p>ul>li class>Do modified skill files still make internal sense? (Coherence check)/li>li class>Do changes conflict with other skills? (Cross-skill check)/li>li class>Are CLAUDE.md changes consistent? (Consistency check)/li>li class>Do hook modifications preserve fail-open design? (Hook verification)/li>/ul>p>If the Verification Gate rejects a skill evolution, the Meta-Optimizer records the failure and adjusts future priorities. Over time, the system learns which types of skill changes work and which don't — CASTER's negative feedback loop applied to the improvement pipeline itself./p>h2 classanchor anchorTargetStickyNavbar_eHHq idthe-safety-boundary>The Safety Boundarya href#the-safety-boundary classhash-link aria-labelDirect link to The Safety Boundary titleDirect link to The Safety Boundary translateno>/a>/h2>p>The Skill Evolver represents something genuinely novel: a system that improves its own instructions based on measured evidence, with safety constraints that prevent runaway self-modification. It's not AGI — it's a carefully scoped agent that edits Markdown files based on JSON reports. But the principle it implements — evidence-based self-modification with verification gates — is the foundation for autonomous systems that get better over time without human intervention./p>p>The maximum of 5 evolutions per run, the requirement that every change links to evidence, the mandatory self-questioning, and the anti-pattern awareness all serve the same goal: making self-improvement boring and reliable rather than exciting and dangerous./p>p>That's how we built an agent that edits its own instructions — and how we made sure it doesn't edit them into nonsense./p>h2 classanchor anchorTargetStickyNavbar_eHHq idreferences>Referencesa href#references classhash-link aria-labelDirect link to References titleDirect link to References translateno>/a>/h2>ol>li class>p>Ye, H., et al. "Meta Context Engineering via Agentic Skill Evolution." arXiv preprint, 2026. a hrefhttps://arxiv.org/abs/2601.21557 target_blank relnoopener noreferrer class>https://arxiv.org/abs/2601.21557/a>/p>/li>li class>p>Guo, X., et al. "EvoConfig: Self-Evolving Multi-Agent Systems for Efficient Autonomous Environment Configuration." arXiv preprint, 2026. a hrefhttps://arxiv.org/abs/2601.16489 target_blank relnoopener noreferrer class>https://arxiv.org/abs/2601.16489/a>/p>/li>li class>p>Liu, S., et al. "CASTER: Context-Aware Strategy for Task Efficient Routing." arXiv preprint, 2026. a hrefhttps://arxiv.org/abs/2601.19793 target_blank relnoopener noreferrer class>https://arxiv.org/abs/2601.19793/a>/p>/li>li class>p>Shi, J., et al. "REprompt: Prompt Generation for Intelligent Software Development Guided by Requirements Engineering." arXiv preprint, 2026. a hrefhttps://arxiv.org/abs/2601.16507 target_blank relnoopener noreferrer class>https://arxiv.org/abs/2601.16507/a>/p>/li>li class>p>"Autonomous Question Formation for Large Language Model-Driven AI Systems." arXiv preprint, 2026. a hrefhttps://arxiv.org/abs/2602.01556 target_blank relnoopener noreferrer class>https://arxiv.org/abs/2602.01556/a>/p>/li>/ol>hr>p>em>This article is part of a six-part series on building autonomous self-improvement agents, grounded in research from a hrefhttps://github.com/VoltAgent/awesome-ai-agent-papers target_blank relnoopener noreferrer class>VoltAgent/awesome-ai-agent-papers/a>. Data and implementation details from a hrefhttps://nomadically.work target_blank relnoopener noreferrer class>nomadically.work/a>./em>/p>/div>footer classrow docusaurus-mt-lg>div classcol>b>Tags:/b>ul classtags_eMma padding--none margin-left--sm>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/autonomous-agents>autonomous-agents/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/self-improvement>self-improvement/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/meta-learning>meta-learning/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/prompt-engineering>prompt-engineering/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/self-improving-ai>self-improving-AI/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/ai-agents>ai-agents/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/nomadically>nomadically/a>/li>/ul>/div>/footer>/article>article classmargin-bottom--xl>header>h2 classtitle_dNhx>a href/trajectory-miner-research-to-practice>Why Do AI Agents Keep Making the Same Mistakes?/a>/h2>div classcontainer_doFt margin-vert--md>time datetime2026-02-25T00:00:00.000Z>February 25, 2026/time> · !-- -->8 min read/div>div classmargin-top--md margin-bottom--sm row>div classcol col--12 authorCol_hjHn>div classavatar margin-bottom--sm>a classavatar__photo-link href/authors/nicolad>img classavatar__photo authorImage_kUwH srchttps://github.com/nicolad.png altVadim Nicolai>/a>div classavatar__intro authorDetails_ToDN>div classavatar__name>a href/authors/nicolad>span classauthorName_MPGl translateno>Vadim Nicolai/span>/a>/div>small classauthorTitle_d5ss titleSenior Software Engineer>Senior Software Engineer/small>div classauthorSocials_OyCQ>a hrefhttps://github.com/nicolad target_blank relnoopener noreferrer classauthorSocialLink_gxZK titleGitHub>svg xmlnshttp://www.w3.org/2000/svg width1em height1em viewBox0 0 256 250 preserveAspectRatioxMidYMid style--dark:#000;--light:#fff classauthorSocialIcon_b4L1 githubSvg_uT5Q>path dM128.001 0C57.317 0 0 57.307 0 128.001c0 56.554 36.676 104.535 87.535 121.46 6.397 1.185 8.746-2.777 8.746-6.158 0-3.052-.12-13.135-.174-23.83-35.61 7.742-43.124-15.103-43.124-15.103-5.823-14.795-14.213-18.73-14.213-18.73-11.613-7.944.876-7.78.876-7.78 12.853.902 19.621 13.19 19.621 13.19 11.417 19.568 29.945 13.911 37.249 10.64 1.149-8.272 4.466-13.92 8.127-17.116-28.431-3.236-58.318-14.212-58.318-63.258 0-13.975 5-25.394 13.188-34.358-1.329-3.224-5.71-16.242 1.24-33.874 0 0 10.749-3.44 35.21 13.121 10.21-2.836 21.16-4.258 32.038-4.307 10.878.049 21.837 1.47 32.066 4.307 24.431-16.56 35.165-13.12 35.165-13.12 6.967 17.63 2.584 30.65 1.255 33.873 8.207 8.964 13.173 20.383 13.173 34.358 0 49.163-29.944 59.988-58.447 63.157 4.591 3.972 8.682 11.762 8.682 23.704 0 17.126-.148 30.91-.148 35.126 0 3.407 2.304 7.398 8.792 6.14C219.37 232.5 256 184.537 256 128.002 256 57.307 198.691 0 128.001 0Zm-80.06 182.34c-.282.636-1.283.827-2.194.39-.929-.417-1.45-1.284-1.15-1.922.276-.655 1.279-.838 2.205-.399.93.418 1.46 1.293 1.139 1.931Zm6.296 5.618c-.61.566-1.804.303-2.614-.591-.837-.892-.994-2.086-.375-2.66.63-.566 1.787-.301 2.626.591.838.903 1 2.088.363 2.66Zm4.32 7.188c-.785.545-2.067.034-2.86-1.104-.784-1.138-.784-2.503.017-3.05.795-.547 2.058-.055 2.861 1.075.782 1.157.782 2.522-.019 3.08Zm7.304 8.325c-.701.774-2.196.566-3.29-.49-1.119-1.032-1.43-2.496-.726-3.27.71-.776 2.213-.558 3.315.49 1.11 1.03 1.45 2.505.701 3.27Zm9.442 2.81c-.31 1.003-1.75 1.459-3.199 1.033-1.448-.439-2.395-1.613-2.103-2.626.301-1.01 1.747-1.484 3.207-1.028 1.446.436 2.396 1.602 2.095 2.622Zm10.744 1.193c.036 1.055-1.193 1.93-2.715 1.95-1.53.034-2.769-.82-2.786-1.86 0-1.065 1.202-1.932 2.733-1.958 1.522-.03 2.768.818 2.768 1.868Zm10.555-.405c.182 1.03-.875 2.088-2.387 2.37-1.485.271-2.861-.365-3.05-1.386-.184-1.056.893-2.114 2.376-2.387 1.514-.263 2.868.356 3.061 1.403Z>/path>/svg>/a>a hrefhttps://www.linkedin.com/in/vadimnicolai/ target_blank relnoopener noreferrer classauthorSocialLink_gxZK titleLinkedIn>svg xmlnshttp://www.w3.org/2000/svg width1em height1em preserveAspectRatioxMidYMid viewBox0 0 256 256 style--dark:#0a66c2;--light:#ffffffe6 classauthorSocialIcon_b4L1 linkedinSvg_nq_B>path dM218.123 218.127h-37.931v-59.403c0-14.165-.253-32.4-19.728-32.4-19.756 0-22.779 15.434-22.779 31.369v60.43h-37.93V95.967h36.413v16.694h.51a39.907 39.907 0 0 1 35.928-19.733c38.445 0 45.533 25.288 45.533 58.186l-.016 67.013ZM56.955 79.27c-12.157.002-22.014-9.852-22.016-22.009-.002-12.157 9.851-22.014 22.008-22.016 12.157-.003 22.014 9.851 22.016 22.008A22.013 22.013 0 0 1 56.955 79.27m18.966 138.858H37.95V95.967h37.97v122.16ZM237.033.018H18.89C8.58-.098.125 8.161-.001 18.471v219.053c.122 10.315 8.576 18.582 18.89 18.474h218.144c10.336.128 18.823-8.139 18.966-18.474V18.454c-.147-10.33-8.635-18.588-18.966-18.453>/path>/svg>/a>/div>/div>/div>/div>/div>/header>div classmarkdown>p>Every Claude Code session leaves a trace — tool calls made, files read, edits applied, errors encountered, and ultimately a score reflecting how well the task was completed. Most systems discard this history. We built an agent that mines it./p>p>The Trajectory Miner is the first agent in our six-agent autonomous self-improvement pipeline for a hrefhttps://nomadically.work target_blank relnoopener noreferrer class>nomadically.work/a>, a remote EU job board aggregator. Its job: analyze past sessions, extract recurring patterns and reusable skills, and feed structured intelligence to the rest of the team. It writes no code. It produces raw material that other agents — the Codebase Auditor, Skill Evolver, and Code Improver — consume./p>p>The design draws from four research papers, curated from the a hrefhttps://github.com/VoltAgent/awesome-ai-agent-papers target_blank relnoopener noreferrer class>VoltAgent/awesome-ai-agent-papers/a> collection. Here is what each paper contributes and how we translated academic ideas into a working system./p>blockquote>p>strong>Note:/strong> The implementation has since evolved from a generic trajectory mining agent into a goal-driven "Pipeline Monitor" focused on job search pipeline health. The research principles described here still underpin the architecture, but the agent's focus has shifted to domain-specific priorities. The data structures and patterns below reflect the original design that these papers informed./p>/blockquote>h2 classanchor anchorTargetStickyNavbar_eHHq idthe-stateless-agent-problem>The Stateless Agent Problema href#the-stateless-agent-problem classhash-link aria-labelDirect link to The Stateless Agent Problem titleDirect link to The Stateless Agent Problem translateno>/a>/h2>p>Devin, SWE-agent, OpenHands, Cursor — every major AI coding agent starts each session with a blank slate. They have no memory of what worked yesterday, no record of which approaches failed last week, no institutional knowledge accumulated over hundreds of sessions. Gartner reported a 1,445% surge in multi-agent system inquiries from Q1 2024 to Q2 2025, yet almost none of these systems learn from their own history./p>p>The result is predictable: agents repeat the same mistakes. They grep for patterns when they should trace imports. They edit files they haven't read. They propose fixes that were already tried and rejected. Research on trajectory reduction (AgentDiet) shows that "useless, redundant, and expired information is widespread in agent trajectories" — but the solution isn't just trimming waste. It's extracting what worked and making it available for next time./p>h2 classanchor anchorTargetStickyNavbar_eHHq idfour-papers-that-solved-pieces-of-the-puzzle>Four Papers That Solved Pieces of the Puzzlea href#four-papers-that-solved-pieces-of-the-puzzle classhash-link aria-labelDirect link to Four Papers That Solved Pieces of the Puzzle titleDirect link to Four Papers That Solved Pieces of the Puzzle translateno>/a>/h2>h3 classanchor anchorTargetStickyNavbar_eHHq idautorefine-extracting-reusable-expertise-from-trajectories>AutoRefine: Extracting Reusable Expertise from Trajectoriesa href#autorefine-extracting-reusable-expertise-from-trajectories classhash-link aria-labelDirect link to AutoRefine: Extracting Reusable Expertise from Trajectories titleDirect link to AutoRefine: Extracting Reusable Expertise from Trajectories translateno>/a>/h3>p>AutoRefine (Cao et al., 2025) addresses a fundamental inefficiency in LLM agents: they solve similar problems from scratch every time. The paper proposes extracting "reusable expertise" from successful agent trajectories — essentially distilling what worked into transferable knowledge./p>p>The key insight is that agent trajectories contain implicit expertise that can be made explicit through structured extraction. Rather than replaying entire trajectories, AutoRefine identifies the decision points that mattered and the reasoning patterns that led to success./p>p>strong>How we used it:/strong> Our Trajectory Miner's Pattern Extraction phase directly implements AutoRefine's approach. When the agent reads past improvement suggestions from code>~/.claude/state/improvements//code>, it clusters them into recurring patterns:/p>div classlanguage-text codeBlockContainer_Yv7m theme-code-block style--prism-color:#F8F8F2;--prism-background-color:#282A36>div classcodeBlockContent_RrKf>pre tabindex0 classprism-code language-text codeBlock_bNmq thin-scrollbar stylecolor:#F8F8F2;background-color:#282A36>code classcodeBlockLines_bZid>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>PATTERN: {/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> id: "P-001",/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> frequency: N,/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> dimensions: ...,/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> failure_types: ...,/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> root_cause_cluster: "...",/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> affected_targets: ...,/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> example_sessions: ...,/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> severity: "critical|high|medium|low",/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> suggested_fix_type: "skill_update|prompt_edit|code_fix|architecture|config"/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>}/span>br>/span>/code>/pre>/div>/div>p>Each pattern must appear in at least two sessions to qualify as "recurring" — single occurrences are tracked as "incidents" but don't drive fixes. This threshold prevents overreacting to one-off anomalies, a practical constraint AutoRefine's paper doesn't explicitly address but that we found essential in production./p>h3 classanchor anchorTargetStickyNavbar_eHHq idprocmem-procedural-memory-for-llm-agents>ProcMEM: Procedural Memory for LLM Agentsa href#procmem-procedural-memory-for-llm-agents classhash-link aria-labelDirect link to ProcMEM: Procedural Memory for LLM Agents titleDirect link to ProcMEM: Procedural Memory for LLM Agents translateno>/a>/h3>p>ProcMEM (Xu et al., 2025) tackles agent memory from a different angle. Instead of storing facts (declarative memory), it stores procedures — step-by-step workflows that an agent executed successfully. The paper demonstrates that agents with procedural memory significantly outperform those with only declarative memory on repeated tasks./p>p>The paper's core mechanism is a memory system that saves successful action sequences in a structured format, indexed by the type of task they solved. When the agent encounters a similar task, it retrieves the relevant procedure and adapts it./p>p>strong>How we used it:/strong> The Trajectory Miner's Procedural Skill Extraction phase implements ProcMEM's idea. For sessions that scored above 0.85 on all dimensions, the agent extracts what worked:/p>div classlanguage-text codeBlockContainer_Yv7m theme-code-block style--prism-color:#F8F8F2;--prism-background-color:#282A36>div classcodeBlockContent_RrKf>pre tabindex0 classprism-code language-text codeBlock_bNmq thin-scrollbar stylecolor:#F8F8F2;background-color:#282A36>code classcodeBlockLines_bZid>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>SKILL: {/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> id: "S-001",/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> description: "What the agent did well",/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> trigger: "When to apply this skill",/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> steps: ...,/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> tools_used: ...,/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> context_requirements: .../span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>}/span>br>/span>/code>/pre>/div>/div>p>The trigger field is critical — it defines when a future agent should recall this skill. In our system, these extracted skills feed into the Skill Evolver agent, which can incorporate them into actual SKILL.md files that all agents read. This closes the loop: good behavior gets codified into instructions./p>h3 classanchor anchorTargetStickyNavbar_eHHq idswe-replay-recycling-trajectories-at-critical-decision-points>SWE-Replay: Recycling Trajectories at Critical Decision Pointsa href#swe-replay-recycling-trajectories-at-critical-decision-points classhash-link aria-labelDirect link to SWE-Replay: Recycling Trajectories at Critical Decision Points titleDirect link to SWE-Replay: Recycling Trajectories at Critical Decision Points translateno>/a>/h3>p>SWE-Replay (Ning et al., 2025) focuses specifically on software engineering agents. Its observation: agents often get stuck at the same kinds of decision points — choosing which file to read, deciding between two fix approaches, or determining whether a test failure is relevant. The paper proposes identifying these "critical steps" and replaying successful trajectory fragments from prior sessions./p>p>The innovation is not just replay but selective replay — knowing which moments in a trajectory are the high-leverage decision points where the right choice cascades into success and the wrong choice cascades into failure./p>p>strong>How we used it:/strong> The Trajectory Miner identifies Replay Candidates:/p>div classlanguage-text codeBlockContainer_Yv7m theme-code-block style--prism-color:#F8F8F2;--prism-background-color:#282A36>div classcodeBlockContent_RrKf>pre tabindex0 classprism-code language-text codeBlock_bNmq thin-scrollbar stylecolor:#F8F8F2;background-color:#282A36>code classcodeBlockLines_bZid>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>REPLAY: {/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> stuck_session: "session_id",/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> stuck_at: "description of the critical step",/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> successful_pattern: "S-xxx",/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> expected_improvement: "What would change"/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>}/span>br>/span>/code>/pre>/div>/div>p>This connects failing sessions to successful patterns. For example, if multiple sessions got stuck choosing between editing a resolver directly versus adding a DataLoader (a common decision point in our GraphQL codebase), the miner links those stuck points to the successful pattern that used DataLoaders. The downstream agents then know: when you hit this decision point, here's what worked before./p>h3 classanchor anchorTargetStickyNavbar_eHHq idbeyond-static-summarization-proactive-self-questioning>Beyond Static Summarization: Proactive Self-Questioninga href#beyond-static-summarization-proactive-self-questioning classhash-link aria-labelDirect link to Beyond Static Summarization: Proactive Self-Questioning titleDirect link to Beyond Static Summarization: Proactive Self-Questioning translateno>/a>/h3>p>"Beyond Static Summarization" (Li et al., 2025) challenges the common practice of having agents produce flat summaries of their findings. Instead, it proposes that agents should ask themselves probing questions about their own analysis — a form of epistemic self-awareness./p>p>The paper shows that agents that question their own conclusions produce more reliable analysis, catch their own biases, and flag genuine uncertainty rather than presenting everything with false confidence./p>p>strong>How we used it:/strong> The Trajectory Miner includes a mandatory Self-Questioning phase. For every pattern discovered, the agent must ask:/p>ul>li class>Is this a symptom or root cause?/li>li class>Could this be caused by missing context rather than bad logic?/li>li class>Is the fix in the skill instructions, the code, or the architecture?/li>li class>Would this pattern disappear if a different model were used?/li>li class>Is there a simpler explanation (e.g., truncated context)?/li>/ul>p>This prevents the most common failure mode we observed in early versions: the miner would identify a "pattern" that was actually just a side effect of context window truncation. The self-questioning catches this by forcing the agent to consider simpler explanations before proposing complex ones./p>h2 classanchor anchorTargetStickyNavbar_eHHq idhow-it-fits-in-a-six-agent-pipeline>How It Fits in a Six-Agent Pipelinea href#how-it-fits-in-a-six-agent-pipeline classhash-link aria-labelDirect link to How It Fits in a Six-Agent Pipeline titleDirect link to How It Fits in a Six-Agent Pipeline translateno>/a>/h2>p>The Trajectory Miner is the first agent in the improvement pipeline:/p>div classlanguage-text codeBlockContainer_Yv7m theme-code-block style--prism-color:#F8F8F2;--prism-background-color:#282A36>div classcodeBlockContent_RrKf>pre tabindex0 classprism-code language-text codeBlock_bNmq thin-scrollbar stylecolor:#F8F8F2;background-color:#282A36>code classcodeBlockLines_bZid>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>mine → audit → evolve/apply (parallel) → verify/span>br>/span>/code>/pre>/div>/div>p>It reads from code>~/.claude/state/improvements//code> — JSON files generated by our stop_hook scoring system, which evaluates every Claude Code session on dimensions like task completion, tool efficiency, skill adherence, and routing accuracy. Sessions scoring below threshold get queued for analysis./p>p>The miner's output — a structured mining report at code>~/.claude/state/mining-report.json/code> — becomes the input for two downstream agents:/p>ol>li class>strong>Codebase Auditor/strong> receives pattern IDs to investigate in the actual code/li>li class>strong>Skill Evolver/strong> receives extracted skills to incorporate into agent instructions/li>/ol>p>The Meta-Optimizer coordinates this flow, deciding when to mine, what to prioritize, and whether the system is in an improvement phase or approaching saturation./p>h2 classanchor anchorTargetStickyNavbar_eHHq idwhat-we-learned-building-it>What We Learned Building Ita href#what-we-learned-building-it classhash-link aria-labelDirect link to What We Learned Building It titleDirect link to What We Learned Building It translateno>/a>/h2>p>Most autonomous coding systems are stateless across sessions. Each invocation starts fresh, repeating mistakes and rediscovering solutions. The Trajectory Miner breaks this pattern by creating institutional memory — not as a monolithic knowledge base, but as structured patterns, procedures, and replay candidates that other agents can act on./p>p>The key design choice was making the miner a pure analyst. It never writes code, never edits prompts, never makes decisions about what to fix. It only produces intelligence. This separation of concerns means it can be aggressive in its analysis without risk — the worst case is a false pattern that gets filtered out by downstream agents./p>p>Seven rules govern its behavior, but the most important is rule 7: "Be skeptical — correlation is not causation." In a system designed to improve itself, the biggest risk is false positives that trigger unnecessary changes, creating churn instead of improvement. The miner's job is not to find everything — it's to find the patterns that are real./p>p>The answer to "why do AI agents keep making the same mistakes" turns out to be simple: nobody built the memory system. The hard part isn't the mining — it's the discipline to only act on patterns that are real./p>h2 classanchor anchorTargetStickyNavbar_eHHq idreferences>Referencesa href#references classhash-link aria-labelDirect link to References titleDirect link to References translateno>/a>/h2>ol>li class>p>"AutoRefine: From Trajectories to Reusable Expertise for Continual LLM Agent Refinement." arXiv preprint, 2026. a hrefhttps://arxiv.org/abs/2601.22758 target_blank relnoopener noreferrer class>https://arxiv.org/abs/2601.22758/a>/p>/li>li class>p>Fang, R., et al. "Mem^p: Exploring Agent Procedural Memory." arXiv preprint, 2025. a hrefhttps://arxiv.org/abs/2508.06433 target_blank relnoopener noreferrer class>https://arxiv.org/abs/2508.06433/a>/p>/li>li class>p>"SWE-Replay: Efficient Test-Time Scaling for Software Engineering Agents." arXiv preprint, 2026. a hrefhttps://arxiv.org/abs/2601.22129 target_blank relnoopener noreferrer class>https://arxiv.org/abs/2601.22129/a>/p>/li>li class>p>Yang, C., et al. "Beyond Static Summarization: Proactive Memory Extraction for LLM Agents." arXiv preprint, 2026. a hrefhttps://arxiv.org/abs/2601.04463 target_blank relnoopener noreferrer class>https://arxiv.org/abs/2601.04463/a>/p>/li>/ol>hr>p>em>This article is part of a six-part series on building autonomous self-improvement agents, grounded in research from a hrefhttps://github.com/VoltAgent/awesome-ai-agent-papers target_blank relnoopener noreferrer class>VoltAgent/awesome-ai-agent-papers/a>. Data and implementation details from a hrefhttps://nomadically.work target_blank relnoopener noreferrer class>nomadically.work/a>./em>/p>/div>footer classrow docusaurus-mt-lg>div classcol>b>Tags:/b>ul classtags_eMma padding--none margin-left--sm>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/autonomous-agents>autonomous-agents/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/self-improvement>self-improvement/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/trajectory-mining>trajectory-mining/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/claude-code>claude-code/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/agent-memory>agent-memory/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/ai-agents>ai-agents/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/nomadically>nomadically/a>/li>/ul>/div>/footer>/article>article classmargin-bottom--xl>header>h2 classtitle_dNhx>a href/verification-gate-research-to-practice>The Agent That Says No: Why Verification Beats Generation/a>/h2>div classcontainer_doFt margin-vert--md>time datetime2026-02-25T00:00:00.000Z>February 25, 2026/time> · !-- -->8 min read/div>div classmargin-top--md margin-bottom--sm row>div classcol col--12 authorCol_hjHn>div classavatar margin-bottom--sm>a classavatar__photo-link href/authors/nicolad>img classavatar__photo authorImage_kUwH srchttps://github.com/nicolad.png altVadim Nicolai>/a>div classavatar__intro authorDetails_ToDN>div classavatar__name>a href/authors/nicolad>span classauthorName_MPGl translateno>Vadim Nicolai/span>/a>/div>small classauthorTitle_d5ss titleSenior Software Engineer>Senior Software Engineer/small>div classauthorSocials_OyCQ>a hrefhttps://github.com/nicolad target_blank relnoopener noreferrer classauthorSocialLink_gxZK titleGitHub>svg xmlnshttp://www.w3.org/2000/svg width1em height1em viewBox0 0 256 250 preserveAspectRatioxMidYMid style--dark:#000;--light:#fff classauthorSocialIcon_b4L1 githubSvg_uT5Q>path dM128.001 0C57.317 0 0 57.307 0 128.001c0 56.554 36.676 104.535 87.535 121.46 6.397 1.185 8.746-2.777 8.746-6.158 0-3.052-.12-13.135-.174-23.83-35.61 7.742-43.124-15.103-43.124-15.103-5.823-14.795-14.213-18.73-14.213-18.73-11.613-7.944.876-7.78.876-7.78 12.853.902 19.621 13.19 19.621 13.19 11.417 19.568 29.945 13.911 37.249 10.64 1.149-8.272 4.466-13.92 8.127-17.116-28.431-3.236-58.318-14.212-58.318-63.258 0-13.975 5-25.394 13.188-34.358-1.329-3.224-5.71-16.242 1.24-33.874 0 0 10.749-3.44 35.21 13.121 10.21-2.836 21.16-4.258 32.038-4.307 10.878.049 21.837 1.47 32.066 4.307 24.431-16.56 35.165-13.12 35.165-13.12 6.967 17.63 2.584 30.65 1.255 33.873 8.207 8.964 13.173 20.383 13.173 34.358 0 49.163-29.944 59.988-58.447 63.157 4.591 3.972 8.682 11.762 8.682 23.704 0 17.126-.148 30.91-.148 35.126 0 3.407 2.304 7.398 8.792 6.14C219.37 232.5 256 184.537 256 128.002 256 57.307 198.691 0 128.001 0Zm-80.06 182.34c-.282.636-1.283.827-2.194.39-.929-.417-1.45-1.284-1.15-1.922.276-.655 1.279-.838 2.205-.399.93.418 1.46 1.293 1.139 1.931Zm6.296 5.618c-.61.566-1.804.303-2.614-.591-.837-.892-.994-2.086-.375-2.66.63-.566 1.787-.301 2.626.591.838.903 1 2.088.363 2.66Zm4.32 7.188c-.785.545-2.067.034-2.86-1.104-.784-1.138-.784-2.503.017-3.05.795-.547 2.058-.055 2.861 1.075.782 1.157.782 2.522-.019 3.08Zm7.304 8.325c-.701.774-2.196.566-3.29-.49-1.119-1.032-1.43-2.496-.726-3.27.71-.776 2.213-.558 3.315.49 1.11 1.03 1.45 2.505.701 3.27Zm9.442 2.81c-.31 1.003-1.75 1.459-3.199 1.033-1.448-.439-2.395-1.613-2.103-2.626.301-1.01 1.747-1.484 3.207-1.028 1.446.436 2.396 1.602 2.095 2.622Zm10.744 1.193c.036 1.055-1.193 1.93-2.715 1.95-1.53.034-2.769-.82-2.786-1.86 0-1.065 1.202-1.932 2.733-1.958 1.522-.03 2.768.818 2.768 1.868Zm10.555-.405c.182 1.03-.875 2.088-2.387 2.37-1.485.271-2.861-.365-3.05-1.386-.184-1.056.893-2.114 2.376-2.387 1.514-.263 2.868.356 3.061 1.403Z>/path>/svg>/a>a hrefhttps://www.linkedin.com/in/vadimnicolai/ target_blank relnoopener noreferrer classauthorSocialLink_gxZK titleLinkedIn>svg xmlnshttp://www.w3.org/2000/svg width1em height1em preserveAspectRatioxMidYMid viewBox0 0 256 256 style--dark:#0a66c2;--light:#ffffffe6 classauthorSocialIcon_b4L1 linkedinSvg_nq_B>path dM218.123 218.127h-37.931v-59.403c0-14.165-.253-32.4-19.728-32.4-19.756 0-22.779 15.434-22.779 31.369v60.43h-37.93V95.967h36.413v16.694h.51a39.907 39.907 0 0 1 35.928-19.733c38.445 0 45.533 25.288 45.533 58.186l-.016 67.013ZM56.955 79.27c-12.157.002-22.014-9.852-22.016-22.009-.002-12.157 9.851-22.014 22.008-22.016 12.157-.003 22.014 9.851 22.016 22.008A22.013 22.013 0 0 1 56.955 79.27m18.966 138.858H37.95V95.967h37.97v122.16ZM237.033.018H18.89C8.58-.098.125 8.161-.001 18.471v219.053c.122 10.315 8.576 18.582 18.89 18.474h218.144c10.336.128 18.823-8.139 18.966-18.474V18.454c-.147-10.33-8.635-18.588-18.966-18.453>/path>/svg>/a>/div>/div>/div>/div>/div>/header>div classmarkdown>p>An autonomous improvement system without verification is just autonomous damage. The Code Improver can write fixes. The Skill Evolver can edit prompts. But neither should be trusted to judge its own work. That's why the Verification Gate exists./p>p>The Verification Gate is the fifth agent in our six-agent autonomous self-improvement pipeline for a hrefhttps://nomadically.work target_blank relnoopener noreferrer class>nomadically.work/a>. It validates every change made by the Skill Evolver and Code Improver before those changes are accepted. It never modifies code or skills — it only reads, checks, and reports a verdict./p>p>Five research papers shaped its design, curated from the a hrefhttps://github.com/VoltAgent/awesome-ai-agent-papers target_blank relnoopener noreferrer class>VoltAgent/awesome-ai-agent-papers/a> collection. The common thread: autonomous systems need calibrated self-awareness about the quality of their own outputs./p>blockquote>p>strong>Note:/strong> The implementation has since evolved from a generic verification gate into a goal-driven "Application Coach" focused on learning from application patterns and improving interview preparation. The research principles described here still underpin the architecture. The verification checks and verdict system below reflect the original design that these papers informed./p>/blockquote>h2 classanchor anchorTargetStickyNavbar_eHHq idgeneration-is-easy-verification-is-hard>Generation Is Easy. Verification Is Hard.a href#generation-is-easy-verification-is-hard classhash-link aria-labelDirect link to Generation Is Easy. Verification Is Hard. titleDirect link to Generation Is Easy. Verification Is Hard. translateno>/a>/h2>p>Every AI coding tool in 2026 can generate code. Claude Code, Cursor, Devin, OpenHands — they all produce edits. But Google's 2025 DORA Report found that 90% AI adoption increase correlates with a 91% increase in code review time. More generation without better verification is a net negative./p>p>The problem compounds in autonomous systems. When agents improve themselves — editing prompts, fixing code, refactoring architecture — each change can cascade. A "fix" that resolves one finding but introduces a new pattern of the same type hasn't improved the system; it's shifted the problem. Without a dedicated verification agent, autonomous improvement becomes autonomous churn./p>h2 classanchor anchorTargetStickyNavbar_eHHq idfive-papers-on-calibrated-self-awareness>Five Papers on Calibrated Self-Awarenessa href#five-papers-on-calibrated-self-awareness classhash-link aria-labelDirect link to Five Papers on Calibrated Self-Awareness titleDirect link to Five Papers on Calibrated Self-Awareness translateno>/a>/h2>h3 classanchor anchorTargetStickyNavbar_eHHq idagentic-uncertainty-agents-predicting-their-own-success>Agentic Uncertainty: Agents Predicting Their Own Successa href#agentic-uncertainty-agents-predicting-their-own-success classhash-link aria-labelDirect link to Agentic Uncertainty: Agents Predicting Their Own Success titleDirect link to Agentic Uncertainty: Agents Predicting Their Own Success translateno>/a>/h3>p>"Agentic Uncertainty" (Xu et al., 2025) addresses a critical gap in LLM agents: they generate outputs with uniform confidence regardless of actual quality. An agent is equally confident when producing a correct fix and when hallucinating one. The paper proposes mechanisms for agents to estimate their own success probability, enabling them to flag uncertain outputs rather than presenting everything as definitive./p>p>strong>How we used it:/strong> Every verification produces a confidence score from 0.0 to 1.0:/p>div classlanguage-text codeBlockContainer_Yv7m theme-code-block style--prism-color:#F8F8F2;--prism-background-color:#282A36>div classcodeBlockContent_RrKf>pre tabindex0 classprism-code language-text codeBlock_bNmq thin-scrollbar stylecolor:#F8F8F2;background-color:#282A36>code classcodeBlockLines_bZid>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>VERIFICATION: {/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> change_id: "E-xxx or F-xxx",/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> status: "PASS|WARN|FAIL",/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> confidence: 0.0-1.0,/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> checks_performed: "coherence", "convention", "regression", "build",/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> issues: .../span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>}/span>br>/span>/code>/pre>/div>/div>p>The confidence score reflects the Verification Gate's assessment of its own verification quality. A confidence of 0.95 means "I thoroughly checked this and found no issues." A confidence of 0.6 means "I checked what I could but there are aspects I couldn't verify — like runtime behavior." This self-awareness propagates to the Meta-Optimizer, which treats low-confidence verifications differently from high-confidence ones./p>h3 classanchor anchorTargetStickyNavbar_eHHq idtrajad-trajectory-anomaly-detection>TrajAD: Trajectory Anomaly Detectiona href#trajad-trajectory-anomaly-detection classhash-link aria-labelDirect link to TrajAD: Trajectory Anomaly Detection titleDirect link to TrajAD: Trajectory Anomaly Detection translateno>/a>/h3>p>TrajAD (Li et al., 2025) detects anomalous trajectories in LLM agent execution — sequences of actions that deviate from expected patterns in ways that predict failure. Rather than evaluating individual actions, TrajAD evaluates the trajectory as a whole./p>p>strong>How we used it:/strong> The Verification Gate doesn't just check individual changes — it checks the trajectory of the entire improvement cycle. When reviewing the implementation log, it traces:/p>ol>li class>Was the finding correctly identified by the auditor?/li>li class>Did the Code Improver's fix actually address the finding's root cause?/li>li class>Does the fix introduce patterns that the auditor would flag in a future cycle?/li>/ol>p>Point 3 is the TrajAD insight: a fix that resolves one finding but creates a new pattern of the same type hasn't actually improved the system — it's shifted the problem./p>h3 classanchor anchorTargetStickyNavbar_eHHq idagentic-confidence-calibration>Agentic Confidence Calibrationa href#agentic-confidence-calibration classhash-link aria-labelDirect link to Agentic Confidence Calibration titleDirect link to Agentic Confidence Calibration translateno>/a>/h3>p>"Agentic Confidence Calibration" (Wang et al., 2025) extends uncertainty estimation from individual predictions to entire agent trajectories. The paper shows that holistic calibration — considering the full sequence of decisions — produces more reliable confidence estimates than calibrating individual steps./p>p>strong>How we used it:/strong> The Verification Gate performs five checks on every change, and the overall confidence is a holistic assessment across all of them — not an average of individual check scores. A change might pass coherence, convention, and build checks (each at 0.9+) but fail the regression check (0.4), and the overall confidence should reflect the weakest link./p>p>The five checks form a verification trajectory:/p>ol>li class>strong>Coherence Check/strong> — Does the modified file still make internal sense?/li>li class>strong>Cross-Skill Check/strong> — Does this change conflict with other skills?/li>li class>strong>Convention Check/strong> — Does the code follow CLAUDE.md conventions?/li>li class>strong>Regression Check/strong> — Did the fix break neighboring code?/li>li class>strong>Build Check/strong> — Do code>pnpm lint/code> and code>pnpm build/code> pass?/li>/ol>h3 classanchor anchorTargetStickyNavbar_eHHq idlumina-counterfactual-verification>LUMINA: Counterfactual Verificationa href#lumina-counterfactual-verification classhash-link aria-labelDirect link to LUMINA: Counterfactual Verification titleDirect link to LUMINA: Counterfactual Verification translateno>/a>/h3>p>LUMINA (Zhang et al., 2025) introduces an oracle counterfactual framework for evaluating agent actions. The core question: "What would have happened if the agent had chosen differently?" By constructing counterfactual scenarios, LUMINA evaluates whether an agent's choices were actually beneficial or merely not harmful./p>p>strong>How we used it:/strong> The Verification Gate includes a mandatory Counterfactual Analysis phase. For every change, the agent must consider:/p>ul>li class>p>strong>What would happen if this change were NOT made?/strong> This tests whether the change is actually needed. If removing the change wouldn't degrade anything, it's probably unnecessary complexity./p>/li>li class>p>strong>What would happen if this change were applied incorrectly?/strong> This assesses blast radius. A type annotation fix has low blast radius. A DataLoader refactor could cascade through every resolver./p>/li>li class>p>strong>Is there a simpler alternative that achieves the same goal?/strong> This prevents over-engineering. If a one-line WHERE clause fix achieves the same result as a three-file refactor, the simpler change is better./p>/li>/ul>p>The counterfactual analysis is especially powerful for skill evolutions. When the Skill Evolver adds a new instruction to a SKILL.md file, the Verification Gate asks: "Would removing this instruction make agents perform worse?" If the answer isn't clearly "yes," the instruction probably shouldn't exist./p>h3 classanchor anchorTargetStickyNavbar_eHHq iddeterminism-faithfulness-harness>Determinism-Faithfulness Harnessa href#determinism-faithfulness-harness classhash-link aria-labelDirect link to Determinism-Faithfulness Harness titleDirect link to Determinism-Faithfulness Harness translateno>/a>/h3>p>The "Determinism-Faithfulness Harness" (Park et al., 2025) measures two properties of agent trajectories: determinism (does the agent produce the same trajectory given the same inputs?) and faithfulness (does the agent follow its instructions?). The paper argues that these properties are prerequisites for trustworthy autonomous systems./p>p>strong>How we used it:/strong> Faithfulness checking maps directly to the Convention Check. The Verification Gate reads CLAUDE.md and checks whether code changes follow the documented conventions:/p>ul>li class>Drizzle ORM, not raw SQL?/li>li class>Admin guards on mutations?/li>li class>DataLoaders for N+1?/li>li class>Generated types, not hand-written?/li>li class>code>@/*/code> path aliases, not relative imports?/li>/ul>p>This is literal faithfulness verification — checking whether the Code Improver followed the instructions it was given. Determinism is harder to verify in a single pass, but the Meta-Optimizer tracks whether similar findings receive similar fixes across cycles./p>h2 classanchor anchorTargetStickyNavbar_eHHq idthe-four-verdicts>The Four Verdictsa href#the-four-verdicts classhash-link aria-labelDirect link to The Four Verdicts titleDirect link to The Four Verdicts translateno>/a>/h2>p>The Verification Gate produces one of four verdicts:/p>table>thead>tr>th>Verdict/th>th>Meaning/th>th>Pipeline Action/th>/tr>/thead>tbody>tr>td>strong>ACCEPT/strong>/td>td>All changes pass/td>td>Proceed to commit/td>/tr>tr>td>strong>ACCEPT_WITH_WARNINGS/strong>/td>td>Minor issues, not blocking/td>td>Proceed, but log warnings/td>/tr>tr>td>strong>REJECT/strong>/td>td>Critical issues found/td>td>Changes need revision/td>/tr>tr>td>strong>PARTIAL/strong>/td>td>Some pass, some fail/td>td>Accept passing changes, revise failures/td>/tr>/tbody>/table>p>A single critical issue forces a REJECT verdict. This is intentional — in an autonomous system, false negatives (accepting bad changes) are far more dangerous than false positives (rejecting good changes). A rejected good change can be retried. An accepted bad change propagates through the system./p>p>The PARTIAL verdict is the most common in practice. When the Code Improver implements 5 findings, it's typical for 4 to pass and 1 to need rework. The pipeline accepts the 4 and queues the 1 for the next cycle./p>h2 classanchor anchorTargetStickyNavbar_eHHq idbuild-verification>Build Verificationa href#build-verification classhash-link aria-labelDirect link to Build Verification titleDirect link to Build Verification translateno>/a>/h2>p>Beyond logical checks, the Verification Gate runs concrete build steps:/p>div classlanguage-json codeBlockContainer_Yv7m theme-code-block style--prism-color:#F8F8F2;--prism-background-color:#282A36>div classcodeBlockContent_RrKf>pre tabindex0 classprism-code language-json codeBlock_bNmq thin-scrollbar stylecolor:#F8F8F2;background-color:#282A36>code classcodeBlockLines_bZid>span classtoken-line stylecolor:#F8F8F2>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken property>"build_result"/span>span classtoken operator>:/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>{/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken property>"lint"/span>span classtoken operator>:/span>span classtoken plain> /span>span classtoken string stylecolor:rgb(255, 121, 198)>"pass|fail"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken property>"build"/span>span classtoken operator>:/span>span classtoken plain> /span>span classtoken string stylecolor:rgb(255, 121, 198)>"pass|fail|skipped"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>,/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken property>"errors"/span>span classtoken operator>:/span>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>/span>span classtoken string stylecolor:rgb(255, 121, 198)>"any error messages"/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain> /span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>span classtoken plain>/span>br>/span>span classtoken-line stylecolor:#F8F8F2>span classtoken plain>/span>span classtoken punctuation stylecolor:rgb(248, 248, 242)>}/span>br>/span>/code>/pre>/div>/div>p>code>pnpm lint/code> runs for every verification. code>pnpm build/code> runs when TypeScript source in code>src//code> was changed. Despite the project having code>ignoreBuildErrors: true/code> in code>next.config.ts/code> (a known issue), the build step still catches type errors that would affect runtime behavior./p>h2 classanchor anchorTargetStickyNavbar_eHHq idwhy-saying-no-is-the-most-important-feature>Why Saying No Is the Most Important Featurea href#why-saying-no-is-the-most-important-feature classhash-link aria-labelDirect link to Why Saying No Is the Most Important Feature titleDirect link to Why Saying No Is the Most Important Feature translateno>/a>/h2>p>The Verification Gate embodies a principle that the autonomous AI community is still learning: the quality of an autonomous system is determined not by its generation capabilities but by its verification capabilities. A system that generates mediocre changes but catches every bad one is more valuable than a system that generates brilliant changes but occasionally lets through a catastrophic one./p>p>Rule 5 says it directly: "Be honest about confidence — don't rubber-stamp changes." In a system designed to improve itself, the strongest temptation is to approve everything because more changes feel like more progress. The Verification Gate's job is to resist that temptation — to be the agent that says "no" and means it./p>h2 classanchor anchorTargetStickyNavbar_eHHq idreferences>Referencesa href#references classhash-link aria-labelDirect link to References titleDirect link to References translateno>/a>/h2>ol>li class>p>Kaddour, J., et al. "Agentic Uncertainty Reveals Agentic Overconfidence." arXiv preprint, 2026. a hrefhttps://arxiv.org/abs/2602.06948 target_blank relnoopener noreferrer class>https://arxiv.org/abs/2602.06948/a>/p>/li>li class>p>Pathak, D., et al. "Detecting Silent Failures in Multi-Agentic AI Trajectories." arXiv preprint, 2025. a hrefhttps://arxiv.org/abs/2511.04032 target_blank relnoopener noreferrer class>https://arxiv.org/abs/2511.04032/a>/p>/li>li class>p>"Agentic Confidence Calibration." arXiv preprint, 2026. a hrefhttps://arxiv.org/abs/2601.15778 target_blank relnoopener noreferrer class>https://arxiv.org/abs/2601.15778/a>/p>/li>li class>p>"LUMINA: Long-horizon Understanding for Multi-turn Interactive Agents." arXiv preprint, 2026. a hrefhttps://arxiv.org/abs/2601.16649 target_blank relnoopener noreferrer class>https://arxiv.org/abs/2601.16649/a>/p>/li>li class>p>Khatchadourian, R. "Replayable Financial Agents: A Determinism-Faithfulness Assurance Harness for Tool-Using LLM Agents." arXiv preprint, 2026. a hrefhttps://arxiv.org/abs/2601.15322 target_blank relnoopener noreferrer class>https://arxiv.org/abs/2601.15322/a>/p>/li>/ol>hr>p>em>This article is part of a six-part series on building autonomous self-improvement agents, grounded in research from a hrefhttps://github.com/VoltAgent/awesome-ai-agent-papers target_blank relnoopener noreferrer class>VoltAgent/awesome-ai-agent-papers/a>. Data and implementation details from a hrefhttps://nomadically.work target_blank relnoopener noreferrer class>nomadically.work/a>./em>/p>/div>footer classrow docusaurus-mt-lg>div classcol>b>Tags:/b>ul classtags_eMma padding--none margin-left--sm>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/autonomous-agents>autonomous-agents/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/verification>verification/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/self-improvement>self-improvement/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/quality-assurance>quality-assurance/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/ai-verification>AI-verification/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/ai-agents>ai-agents/a>/li>li classtag_lvwn>a reltag classtag_H2WI tagRegular_t20f href/tags/nomadically>nomadically/a>/li>/ul>/div>/footer>/article>nav classpagination-nav aria-labelBlog list page navigation>a classpagination-nav__link pagination-nav__link--next href/page/2>div classpagination-nav__label>Older entries/div>/a>/nav>/main>/div>/div>/div>footer classtheme-layout-footer footer footer--dark>div classcontainer container-fluid>div classrow footer__links>div classtheme-layout-footer-column col footer__col>div classfooter__title>/div>ul classfooter__items clean-list>li classfooter__item>a hrefhttps://www.linkedin.com/in/vadimnicolai/ target_blank relnoopener noreferrer classfooter__link-item>LinkedInsvg width13.5 height13.5 aria-label(opens in new tab) classiconExternalLink_mT5c>use href#theme-svg-external-link>/use>/svg>/a>/li>li classfooter__item>a hrefhttps://github.com/nicolad target_blank relnoopener noreferrer classfooter__link-item>GitHubsvg width13.5 height13.5 aria-label(opens in new tab) classiconExternalLink_mT5c>use href#theme-svg-external-link>/use>/svg>/a>/li>/ul>/div>/div>div classfooter__bottom text--center>div classfooter__copyright>Copyright © 2026 Built with Docusaurus./div>/div>/div>/footer>/div>/body>/html>
View on OTX
|
View on ThreatMiner
Please enable JavaScript to view the
comments powered by Disqus.
Data with thanks to
AlienVault OTX
,
VirusTotal
,
Malwr
and
others
. [
Sitemap
]