Skip to main content
Glama

agent_fork

Fork a same-project Claude Code or Codex worker into a new worker with a fresh identity and pane, starting from a copy of the source conversation and brief without inheriting its todo.

Instructions

Fork a same-project Claude Code or Codex worker into a new worker with a new identity and pane. The child starts from a copy of the source conversation, gets a fresh brief, and does not inherit the source todo. Claude Code process-scoped permission grants are not copied and may need approval again.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "agent_id": "<agent_id>",
      "name": "<name>"
    },
    "name": "agent_fork"
  }
}

Input Schema

NameRequiredDescriptionDefault
cwdNoChild working directory; defaults to the source worker's directory.
nameYesRequired name for the new child worker.
modelNoModel override; defaults to the source worker's model.
effortNoReasoning effort override; defaults to the source worker's effort.
layoutNo
todo_idNoExplicit todo for this new child; absent means no todo link.
agent_idYesNumeric id of the same-project worker to fork.
placementNo
read_onlyNoRead-only mode override; defaults to the source worker's mode.
project_idNoDifferent project override. Use ONLY when the user explicitly asks for another project by name; otherwise stay in the current scope, even when results are empty.

Output Schema

NameRequiredDescriptionDefault
nameYes
noteNo
tailNo
readyYes
actor_idYes
agent_idYes
session_idYes
hive_noticeNo
tmux_targetYes
permission_noteYes
forked_from_agent_idYes
forked_from_session_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.12.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare non-read-only, non-destructive, non-idempotent, closed-world, so the safety bar is lower. The description still adds real behavioral context beyond them: the child inherits a conversation copy but a fresh brief, does not inherit the source todo, and Claude Code process-scoped permission grants are not carried over and may require re-approval. It does not state whether the source worker is left untouched or what limits apply to repeated forks, keeping it below a 5.

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

Conciseness5/5

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

Three sentences, front-loaded with the action and target, then the inheritance semantics, then the permission caveat. Every sentence carries distinct information with no filler.

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?

With an output schema present, return values need not be described, and annotations plus this text cover the safety and inheritance model for a 10-parameter mutation. The remaining gap is that layout and placement are left entirely to the schema and the source worker's post-fork state is unstated.

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 description coverage is 80%, so the schema already explains agent_id, name, cwd, model, effort, todo_id, read_only, and project_id defaults. The description adds only the loose hint of 'new identity and pane,' which does not clarify the undescribed layout and placement enum parameters, so it stays at the baseline.

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?

States a specific verb (fork) and resource (a same-project Claude Code or Codex worker) plus the resulting artifact (a new worker with new identity and pane). The phrase 'starts from a copy of the source conversation' cleanly separates it from agent_spawn and agent_resume without needing to name them.

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

Usage Guidelines3/5

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

The 'same-project' scoping constraint is stated, and the description implies you use this when you want a branch of an existing conversation rather than a fresh worker. However, it never explicitly contrasts with agent_spawn or agent_resume, nor does it say when forking is the wrong choice; the agent must infer the routing.

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