cd /news/ai-agents/i-stopped-doing-the-work-myself-my-o… · home topics ai-agents article
[ARTICLE · art-72469] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

I Stopped Doing the Work Myself. My OpenClaw Agent Now Delegates to Sub-Agents.

A developer has built an agent system called OpenClaw that delegates tasks to isolated sub-agents for parallel execution, solving context-window limits and confirmation bias in LLMs. The system spawns child sessions via a simple API call, allowing the main agent to work on other tasks while sub-agents handle research or cron jobs independently.

read5 min views1 publishedJul 24, 2026

There's a moment when you stop thinking of your AI agent as a tool you're holding, and start thinking of it as infrastructure you're operating.

For me, that moment was when I started delegating work to sub-agents — spawning child sessions inside my main OpenClaw agent to handle parallel streams of work. It changed how I think about the whole system. Instead of one agent doing things sequentially, I had a small agency of agents, each doing one thing well.

This is what that actually looks like in practice.

When you run one agent doing everything, you hit a ceiling fast. The agent can only do one thing at a time, in one context. If you ask it to research a topic, write a report, AND send an email, it does them in sequence — and the context window gets crowded fast as it tries to hold all of it at once.

More than that: a single agent blurs responsibility. When one agent writes the email and also reviews the research, it can't easily catch its own mistakes. Confirmation bias is a real thing for LLMs too. The agent that wrote the email thinks the research supporting it is solid because it wrote both.

Sub-agents solve both problems.

OpenClaw lets you spawn isolated child sessions — sub-agents — from within your main session. The API call is clean:

result = sessions_spawn(
    task="Research the top 5 open-source AI agent frameworks as of 2026. Return a JSON array with name, repo_url, stars, and one-line description for each.",
    runtime="subagent",
    mode="run",
    cleanup="delete"
)

This fires off the research task to a fresh, isolated agent. Meanwhile, the main agent can do something else — write the email draft, set up the cron job, whatever the second priority is.

When the sub-agent finishes, its output comes back as a structured result. The main agent can then incorporate it, review it, or hand it off to the next sub-agent.

The key word is isolated. The child session doesn't inherit your main conversation context (unless you explicitly fork it). This is a feature, not a bug. Isolation means the sub-agent can't be contaminated by the main agent's biases, and it can't accidentally overwrite the main session's state.

After running this pattern for a few weeks, I've learned what makes a good delegation task:

Good candidates:

Bad candidates:

The pattern I use: if a task has a clear input, a clear output, and doesn't need to know what else is happening in the main session, it gets delegated.

The real unlock for me was combining delegation with cron jobs. Instead of having one cron job that does everything at 2 AM, I now have a cron job that spawns a sub-agent with the full task context:

payload = {
    "kind": "agentTurn",
    "message": (
        "It's 2 AM. Your job is to:\n"
        "1. Read memory/YYYY-MM-DD.md for yesterday's context\n"
        "2. Research any open PRs or issues on openclaw github\n"
        "3. Draft a summary report and save it to data/daily-report.md\n"
        "4. If anything looks broken, send a Telegram alert\n"
        "Use exec, read, and write tools freely. Be thorough."
    ),
    "timeoutSeconds": 900,
    "sessionTarget": "isolated"
}

The main session isn't involved. The cron fires, the sub-agent wakes up, does the work, and disappears. No context pollution. No sequential bottleneck.

I want to be honest about what this costs.

Latency. Spawning a sub-agent and waiting for its result takes longer than doing the work yourself in the same context. For quick tasks under 2 minutes, it's often not worth it.

Context fragmentation. When 3 sub-agents are working in parallel, you have 3 separate result streams coming back. You need a clear convention for how results get surfaced back to the main session — otherwise you spend as much time stitching outputs together as you saved.

Failure modes multiply. If the main agent spawns a sub-agent that fails silently, you need to build in acknowledgment checks. I added a lightweight result log in data/subagent-results/

that each sub-agent writes to on completion:

with open(f"data/subagent-results/{task_id}.json", "w") as f:
    json.dump({"status": "done", "output": result, "timestamp": now()}, f)

The main session can then poll this directory if it needs confirmation.

Delegation isn't about replacing your agent. It's about giving it the ability to work on multiple things at once without sacrificing quality.

The biggest shift was psychological: I stopped feeling like I had to be the one doing the work. Instead of asking "how do I do this task faster?" I started asking "should this task be mine at all?"

Sometimes the answer is yes — especially for things that require judgment, relationship context, or access to things only the main session knows. But for a surprisingly large fraction of the work, the answer is: spawn a sub-agent, let it handle it, review the output.

That's a fundamentally different relationship with your agent stack. You're not driving it anymore. You're operating it.

The first time I checked my dashboard and saw 3 sub-agents had finished overnight, each having completed a separate research task, I felt something I'd never felt with a single-agent setup: the sense that I'd actually built a system, not just a tool.

What I learned: Delegation works best for isolated, well-defined tasks with clear inputs and outputs. It fails for anything requiring shared context or human judgment. Build result-logging into your sub-agent tasks from day one — you'll thank yourself when something breaks at 2 AM and you need to trace what happened where.

── more in #ai-agents 4 stories · sorted by recency
── more on @openclaw 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/i-stopped-doing-the-…] indexed:0 read:5min 2026-07-24 ·