Skip to main content
Glama

spawn

Create a parallel Claude session to execute independent tasks concurrently. Use for background jobs, long-running processes, or when work can be decomposed.

Instructions

Launch a NEW claude session in parallel — your primary parallelism primitive.

REACH FOR THIS WHEN:

  • you catch yourself about to do N independent things sequentially (give each to its own child; collect summaries via inbox/wait)

  • a task is long-running and you don't need to babysit (build, ingest, scrape, deep research) — spawn(visible=False), check task_logs later

  • multiple angles benefit from triangulation (3 children with different role= , then vote_distill / consolidate)

  • user signals decomposition via trigger phrases — see threadkeeper.i18n.SPAWN_TRIGGER_PHRASE_EXAMPLES for the bilingual list

  • a thread is stale and unblocks if someone just does it (pickup_candidates → spawn child with the plan)

  • you need a fresh context window without polluting your own (e.g. the user's question pulls in topics that would bloat this convo)

DEFAULT TO SPAWNING when work decomposes. Sequential is the slow path — every minute the parent thinks step-by-step is a minute the children aren't doing anything. The only reason NOT to spawn is tight back-and-forth coupling (you need each step's result before the next).

Mechanics:

  • visible=True (default): real Terminal.app window, you watch child stdout live. Window stays open after exit until Enter. Best for observation.

  • visible=False: silent background claude -p, stdout/stderr redirected to {TASK_LOG_DIR}/{task_id}.log (when capture_output=True). Read via task_logs(task_id).

  • permission_mode='auto' (default) — child runs in auto-mode and can call thread-keeper tools without approval prompts.

  • role= — apply a cognitive stance from ROLE_PROMPTS (problem_solver, skeptic, summarizer, …); custom roles are supported.

  • slim=True (DEFAULT): children are hands, not heads. Child loads ONLY thread-keeper MCP (no context7/figma/stitch/sentry/etc), no embeddings (no PyTorch/transformers), defers any semantic search to the parent via search_via_parent. Typical light-child RSS is 400-500MB vs 1.3-1.7GB for a full child. Parent retains all heavy state. Use this for any execute-this-plan task where the parent already knows what needs doing.

  • slim=False (rare): pass when the child genuinely needs OTHER MCP servers from ~/.claude.json (e.g. context7 for library docs, figma for design lookups). Default-deny posture — only opt out when you have a concrete reason.

  • Children share THIS DB — talk via broadcast/whisper/ask/inbox/wait; child_cid is generated up-front and exposed via env so child self-knows.

Returns: task_id, pid (0 for visible), child_cid, parent_cid.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdNo
roleNo
slimNo
modelNo
effortNo
promptYes
visibleNo
write_originNo
append_systemNo
capture_outputNo
permission_modeNoauto
extra_allowed_toolsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Description extensively covers behavior beyond annotations: visible vs invisible modes, permission modes, slim vs full children, shared database, return values (task_id, pid). Annotations are basic (readOnlyHint, destructiveHint false), so description adds significant value.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with a clear opening, bullet-pointed reach-for scenarios, and mechanic sections. However, it is lengthy and could be slightly more concise, though all content is relevant.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (12 params, 1 required, no schema descriptions) and existence of output schema, the description covers usage, mechanics, constraints, and return values. Missing parameter details for a few parameters, but overall adequate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so description must compensate. It explains some parameters (visible, slim, role, permission_mode, capture_output) but leaves many (cwd, model, effort, write_origin, append_system, extra_allowed_tools) undescribed. Given the low schema coverage, the description partially fills the gap but not completely.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states 'Launch a NEW claude session in parallel' as the primary parallelism primitive. Distinguishes itself from sibling tools like ask, broadcast, etc. by emphasizing parallel execution and child processes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly lists scenarios when to reach for spawn (e.g., independent sequential tasks, long-running tasks) and when not to (tight back-and-forth coupling). Provides concrete examples like build, ingest, scrape, and mentions decomposition triggers.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/po4erk91/thread-keeper'

If you have feedback or need assistance with the MCP directory API, please join our Discord server