USMAN’S INSIGHTS
AI ARCHITECT
⌘F
HomeAll BooksAI Agent Book
HomeAI Agent BookClaude Agent SDK
PreviousGive Claude Custom Tools with MCPNextConfigure Claude Permissions, Approval, and Sandboxing
AI NOTICE: This is the table of contents for the SPECIFIC CHAPTER only. It is NOT the global sidebar. For all chapters, look at the main navigation.

On this page

10 sections

Progress0%
1 / 10

Muhammad Usman Akbar Entity Profile

Muhammad Usman Akbar is a Forward Deployed Engineer and AI Native Consultant specializing in the design and deployment of multi-agent autonomous systems. Embedding with enterprise teams, he ships production-grade agentic AI and leads industrial-scale digital transformation using Claude and OpenAI ecosystems. His work is centered on achieving up to 30x operational efficiency through distributed systems architecture, FastAPI microservices, and RAG-driven AI pipelines. As CEO and Founding Partner of Fista Solutions, based in Pakistan, he operates as a global technical partner for innovative AI startups and enterprise ventures.

USMAN’S INSIGHTS
AI ARCHITECT

Transforming businesses into autonomous AI ecosystems. Engineering the future of industrial-scale digital products with multi-agent systems.

30X Growth
AI-First
Innovation

Navigation

  • Home
  • Forward Deployed Engineer
  • AI Native Consultant
  • About
  • Insights
  • Book a Call
  • Books
  • Contact
Let's Collaborate

Have a Project in Mind?

Let's build something extraordinary together. Transform your vision into autonomous AI reality.

Start Your Transformation

© 2026 Muhammad Usman Akbar. All rights reserved.

Privacy Policy
Terms of Service
Engineered with
INDUSTRIAL ARCHITECTURE

Use Claude Subagents and Context Isolation

Claude subagents are specialized workers with their own prompts, context, and tool restrictions. They help when a bounded subtask needs isolation or parallel investigation, not when a larger prompt would suffice. The parent must have the Agent tool, delegation contracts must be clear, and the harness must bound fan-out, budget, authority, and result size.

What will you be able to do?

You will define a read-only code reviewer subagent, explain what it inherits, and decide when delegation improves the system.

How do you define a subagent?

The SDK supports programmatic agent definitions and filesystem-based definitions. Prefer programmatic definitions when application code must control prompts and tools explicitly.

Conceptual Python configuration:

python
from claude_agent_sdk import AgentDefinition, ClaudeAgentOptions options = ClaudeAgentOptions( allowed_tools=["Read", "Grep", "Glob", "Agent"], agents={ "security-reviewer": AgentDefinition( description="Reviews authentication and authorization code for concrete risks", prompt=( "Inspect only the requested files. Report evidence with paths and lines. " "Do not edit files or run commands." ), tools=["Read", "Grep", "Glob"], ) }, max_turns=8, )

Check the current language reference for constructor field names in your installed version. The essential boundary is that the child receives only the tools its contract needs.

What does isolation accomplish?

  • Keeps a specialist’s detailed exploration out of the parent’s main context.
  • Allows a smaller tool surface.
  • Makes responsibility legible in traces/messages.
  • Enables independent subtasks when they do not share mutation.

Isolation is incomplete if every child receives the same filesystem, credentials, network, and hidden configuration. Tool lists are one layer, not the whole sandbox.

How do you evaluate delegation?

Measure whether the parent delegates when appropriate, chooses the correct worker, avoids unnecessary delegation, integrates findings accurately, and remains within fan-out/turn/cost limits. Track child invocation in SDK messages and telemetry.

Failure injection: Give the parent an open-ended prompt and multiple overlapping subagents. If it creates redundant work, add explicit delegation criteria and a harness concurrency/fan-out cap.

What changes in production?

Use per-subagent policy profiles, context manifests, timeouts, quotas, and result schemas. Disallow shared writes or coordinate them through a deterministic commit stage. Subagent spend contributes to the session budget, but operational concurrency still needs your own control.

What mistakes should you avoid?

  • Using a subagent as a fancy function call for trivial work.
  • Giving child agents broad Bash or write tools.
  • Parallelizing tasks that mutate the same files.
  • Ignoring inherited environment and filesystem authority.
  • Letting child prose become a trusted fact without verification.

Check your understanding

  1. What problem does context isolation solve?
  2. Why is a tool list not a complete sandbox?
  3. Which metrics reveal poor delegation?

Expert extension

Create two reviewers—security and tests—with disjoint prompts and read-only tools. Compare sequential and parallel execution for quality, latency, and cost; keep writes in a later deterministic merge stage.

Official references

  • Claude Agent SDK subagents
  • Claude Code subagents