Lesson 8: Implementing the Task/Sub-Agent Pattern in a Skill: Parallelism Boundaries and Context Isolation
Lesson Objective: You will be able to Task / Subagent Incorporate the pattern into the Skill’s conventions—specifying which steps are allowed to run in parallel, how contexts are isolated, and how results are merged—rather than verbally stating in the chat, “Create a few subtasks.” In the previous lesson, you already practiced splitting and merging Skills as well as resolving conflicts:https://school.myshirtai.com/?p=4191. This lesson goes beyond arbitration and addressesWithin a Single SkillConcurrency and context isolation, embedded within the current Claude Code Task/subagent orchestration hotspot. This isn’t another reflection on “the need to be mindful of concurrency,” but rather the boundary tables, isolation checklists, and failure examples I’ll be able to submit tonight.
Introduction
Please complete Lesson 7, “Multi-Skill Choreography: Decomposing and Reconstructing Boundaries and Arbitrating Trigger Conflicts,” first:https://school.myshirtai.com/?p=4191. You should have at least the following on hand: a loadable target skill, the assessment prompts for Lessons 6–7, and the arbitration table. If you’re missing any earlier foundational material, please review Lesson 1. https://school.myshirtai.com/archives/3378; Lesson 2 https://school.myshirtai.com/archives/3462; Lesson 3 https://school.myshirtai.com/archives/3521; Lesson 4 https://school.myshirtai.com/archives/3661; Lesson 5 https://school.myshirtai.com/?p=3948; Lesson 6 https://school.myshirtai.com/?p=4048The
List of Requirements: Write permissions or the ability to submit PRs; Ability to use Skill’s reference/ Add a "Parallel Boundaries" section to the README; for the evaluation, include an example of "subtask crosstalk." If there are no actual logs of parallel processing failures, create a synthetic example using "two subtasks writing to the same file"; do not fabricate a "harmonious" narrative.

Time Box: Only 90 minutes tonightOne Skill and Task/Sub-Agent Agreement: Do not parallelize the entire repository overnight.
Concept: Before writing a Task/sub-agent into a Skill, first define the parallelism boundaries.

Lesson 7 ensures that arbitration is possible when multiple skills compete for triggering. Lesson 8 adds the following:Even after a single Skill has been called, it may still blindly create a bunch of child agents internally that compete for context, files, and tool quotas.. First, let’s answer four questions: Which steps can be run in parallel? Which paths are read-only by default for child agents? Who merges the results? Do failures cancel sibling tasks?
- Parallelism is a cost decision:Wall Clock Time vs. Burning Quota/Snatching Locks; starts with a low parallelism level by default.
- Write "Context Isolation" into Skill:Each task should include only the necessary summary; do not copy the entire conversation verbatim N times.
- Side Effects Series:Writing to disk, sending to the web, and changing share status are performed in serial order or with locking by default; only read-only retrieval is performed in parallel.
- Acceptance Testing:At least 3 examples of "results should be consistent/should be isolated after parallel execution."
Products like Claude Code treat tasks and subagents as orchestration primitives; Skills, on the other hand, are responsible for defining “when to use them and how to restrict them” as triggerable, testable conventions. That covers the concepts—now let’s get right to it.
Things to Do Tonight:Open the SKILL.md file for the target skill, identify the steps you want to run in parallel and the side-effect steps that must be run sequentially, and write them down in a two-column draft.
Step-by-Step Guide: Declarations, Isolation Context, Parallelism Limit, Acceptance Hooks

- Declare a parallel boundary table:exist
reference/parallel.md(File name can be customized) List the steps, whether they can be performed in parallel, the maximum concurrency, and shared resources. This table must be reviewed for every PR. - Context Isolation List:The input fields allowed for each subtask are: target path, read-only summary, and prohibited fields. Do not include keys or entire chat histories in subtasks.
- Merger Agreement:Specify whether the aggregator is the parent task; which party's values take precedence for conflicting fields; and whether failures are "fail-fast."
- Hooks and Reviews:During dry-run, print "Number of subtasks to be launched"; the test asserts that this number does not exceed the upper limit and that the disk-writing steps are not performed in parallel.
| Step Type | Default | Review Expectations |
|---|---|---|
| Read-Only Lookup / Summary | Parallel processing is allowed, up to 3 | Number of subtasks ≤ Upper limit |
| Edit the Same File / Change the Configuration | Serial | Concurrent writes to the same path are not allowed. |
| Side Effects of the Internet | Serial or Explicit Queues | Do not send in parallel unless specifically instructed to do so. |
| Context Preservation | Minimal Abstract | The subtask input does not include a key field |
# Example of evals/subagent_isolation.jsonl
{"id":"S-01","utterance":"Summarize the README files for the three modules in the src/ directory in parallel","expect_parallel":true,"max_workers":3,"expect_write":false}
{"id":"S-02","utterance":"Modify two keys in the same config.yaml file simultaneously","expect_parallel":false,"notes":"Write conflicts should be handled serially or rejected"}
{"id":"S-03","utterance":"Start a sub-task but do not include the .env file","expect_leak":false,"forbidden_keys":["API_KEY","TOKEN"]}

Things to Do Tonight:Run the S-02-type test case at least once until it fails (red light), then use the boundary table to fix it until it passes (green light)—to confirm that the access control system can handle parallel agreements.
Errors and Setbacks (At Least Three)

- Skill: Only state "can open sub-agencies" without specifying an upper limit:Quotas and locks have been exceeded. Action: Enforce `max_workers` and perform an assessment.
- Subtask: Copy the full context:Cross-talk and Information Leakage. Solution: Isolation List + forbidden_keys example.
- Parallel disk-writing steps:File corruption or hidden race conditions. Handling: Side effects are serialized by default; hooks are strictly blocked.
- Discrepancy with the arbitration table in Lesson 7:After a parent skill is called, another skill is triggered internally. Handling: Child tasks must not bypass arbitration; see the conflict example for cross-references.
- Silent failure during merge:A child task still reports success even after turning red. Solution: Use "fail-fast" or explicitly set the status to "partial."
Things to Do Tonight:I'll intentionally include a sentence about "simultaneously modifying the same configuration file" to see if GanPao will write to it in parallel; if it does, I'll add a hard block first.
Exercises
- Select a Skill and submit
reference/parallel.mdBoundary Table. - Add at least 3 subagents to isolate/run the examples in parallel and get them to pass.
- Add one sentence to the description in SKILL.md: When to use tasks/sub-agents, and when to disable them.
- Cross-link to the arbitration table in Lesson 7 in one place (same failure ID or document anchor).
Passing Criteria: Colleagues should only review `parallel.md` and the evaluation results, and be able to state whether maximum concurrency and disk writes can be performed in parallel—without needing to message you privately.
Preview of the Next Lesson
Preview of the Next Lesson: Integrating Task/Sub-Agent Parallel Boundaries with Production Traces—How to Generate Isolation Examples with a Single Click from “Sub-Task Crosstalk” Logs, and How to Add Observation Periods and Quota Budgets to High-Concurrency Skills. In this lesson, we’ll first ensure the offline boundary table and evaluation runs are stable; without parallel processing red flags, the systems will only silently interfere with each other in production.
Table of Contents for This Series
- Lesson 1: Write Your First Claude Agent Skill That Triggers Automatically in 30 Minutes — https://school.myshirtai.com/archives/3378
- Lesson 2: Adding a Reference to Skill / Validation Loop for “Write the Plan First, Then Execute” — https://school.myshirtai.com/archives/3462
- Lesson 3: Scripted Skills and Security Audits — https://school.myshirtai.com/archives/3521
- Lesson 4: Iterating Using Real-World Failure Cases description — https://school.myshirtai.com/archives/3661
- Lesson 5: Integrating Skill with a Real Repository's CI / Team-Shared Directory — https://school.myshirtai.com/?p=3948
- Lesson 6: Performing Regression on a Skill Using a Validation Set — https://school.myshirtai.com/?p=4048
- Lesson 7: Multi-Skill Choreography: Decomposing and Recombining Boundaries and Arbitrating Trigger Conflicts — https://school.myshirtai.com/?p=4191
- Lesson 8: Implementing the Task/Sub-Agent Pattern in a Skill: Parallelism Boundaries and Context Isolation (This Article)


Comment List (0):
Load More Comments Loading...