Skip to main content
Glama

spawn

Launch parallel Claude sessions to run independent tasks concurrently, each with its own context, enabling faster completion by decomposing work.

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
promptYes
cwdNo
append_systemNo
modelNo
effortNo
permission_modeNoauto
extra_allowed_toolsNo
capture_outputNo
visibleNo
roleNo
write_originNo
slimNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

No annotations provided, but description thoroughly explains mechanics: visible vs invisible modes, permission_mode, slim behavior, child sharing DB, return values (task_id, pid, child_cid, parent_cid), and env exposure. No contradictions.

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 sections (reach for this, mechanics, returns) and front-loaded purpose. Every sentence adds value, but slightly verbose; could tighten some examples while maintaining clarity.

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

Completeness5/5

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

Covers all critical aspects: usage scenarios, behavioral details, parameter effects, and return values. For a complex tool with 12 params and output schema, description is sufficiently complete.

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 has 0% parameter descriptions, so description must compensate. It explains key parameters (visible, role, slim, permission_mode) but misses many others (cwd, append_system, model, effort, extra_allowed_tools, capture_output, write_origin). Partial coverage.

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 function, uses specific verb and resource, and distinguishes from sibling tools like ask or broadcast by framing it as the parallelism primitive.

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?

Provides an extensive 'REACH FOR THIS WHEN' list with concrete scenarios, explicit when-not-to-use (tight back-and-forth coupling), and mentions alternatives like wait, inbox, and search_via_parent.

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