Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Events
Videos
Audiobooks
Packt Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Agentic Coding with Claude Code

You're reading from   Agentic Coding with Claude Code The everyday developer's guide to agentic coding with Claude Code

Arrow left icon
Product type Paperback
Published in Mar 2026
Publisher Packt
ISBN-13 9781806022595
Length 376 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Author (1):
Arrow left icon
Eden Marco Eden Marco
Author Profile Icon Eden Marco
Eden Marco
Arrow right icon
View More author details
Toc

Table of Contents (18) Chapters Close

Preface 1. Part 1: Foundations of Context Engineering and Claude Code
2. Chapter 1: Context Engineering FREE CHAPTER 3. Chapter 2: The Gist of Claude Code 4. Chapter 3: Getting Started with Claude Code – A Tour of Essential Commands 5. Part 2: Extending Claude Code: Protocols, Automation, and Structured Workflows
6. Chapter 4: Extending Claude Code with MCP Servers and Plugins 7. Chapter 5: Automating Your Development Workflow with Claude Code and GitHub 8. Chapter 6: Claude Code Planning and Multi-agent Workflows 9. Chapter 7: Working with Claude Code Subagents 10. Chapter 8: Creating and Customizing Output Styles 11. Part 3: Advanced Agents and Deep System Design
12. Chapter 9: Understanding Agent Skills 13. Chapter 10: Using Claude Code Desktop 14. Chapter 11: Understanding Deep Agents 15. Chapter 12: Unlock Your Exclusive Benefits 16. Other Books You May Enjoy
17. Index

Context flow while using subagents

In this section, we will examine the context flow when using subagents and understand why subagents are useful here with the help of the following diagram. We start with the main agent thread, which represents the main conversation. Every message sent in this thread increases the token size of the context.

Image 8

Figure 7.8 – Context flow between the main agent and a subagent

When the main agent decides to use a subagent, it creates a new prompt. This prompt is passed to the subagent and represents the only context the subagent receives during execution. The subagent is not aware of the entire conversation that occurred previously. It only has access to the prompt generated by the main agent.

We can influence this prompt so that the main agent prompts the subagent in a way that makes the task easier to execute and produces better results. The quality of the subagent's execution depends entirely on this prompt, since it is the only context provided...

lock icon The rest of the chapter is locked
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Agentic Coding with Claude Code
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Modal Close icon
Modal Close icon