fork_task

Switch the coding agent (claude/codex/opencode) for an existing task. Creates a NEW child task running on the requested runner with a bounded recent-context handoff (last few turns + assistant tail) — the parent task stays immutable. Use this instead of continue_task when the user wants a differe...

Server Yaver yaver-cli
Category Read
Risk class Low
Parameters 63 required

What fork_task does on Yaver

AI agents call fork_task to retrieve information from Yaver without modifying anything — typically the context-gathering step in research, monitoring, and reporting workflows, before the agent takes action elsewhere.

ParameterTypeRequiredDescription
mode string Optional opencode mode: 'build', 'plan', or any custom agent in the user's opencode.json. Empty = opencode defaultAgent. Other runners ignore.
input string Yes User's new prompt for the forked agent.
model string Optional model id. Empty = runner default.
runner string Yes Target runner for the child task.
task_id string Yes The parent task ID to fork from.
context_words integer Word budget for the recent-context handoff. Default 1200. Clamped to [100, 5000].

Parameters from the server's own tool schema.

Why fork_task needs a policy

Even though fork_task only reads data, uncontrolled read access leaks sensitive information and racks up API costs — an agent caught in a retry loop can make thousands of calls a minute without anyone noticing.

Questions about fork_task

What does the fork_task tool do? +

Switch the coding agent (claude/codex/opencode) for an existing task. Creates a NEW child task running on the requested runner with a bounded recent-context handoff (last few turns + assistant tail) — the parent task stays immutable. Use this instead of continue_task when the user wants a different runner/model/mode mid-conversation. Claude/Codex/OpenCode don't share session formats, so an in-place runner swap would corrupt session state. Returns the child task ID + runner + how many words of context were carried. It is categorised as a Read tool in the Yaver MCP Server, which means it retrieves data without modifying state.

What parameters does fork_task accept? +

fork_task accepts 6 parameters: mode, input, model, runner, task_id, context_words. Required: input, runner, task_id. The full parameter table on this page comes from the server's own tool schema.

How do I enforce a policy on fork_task? +

Register the Yaver MCP server in PolicyLayer and add a rule for fork_task: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Yaver. Nothing to install.

What risk level is fork_task? +

fork_task is a Read tool with low risk. Read-only tools are generally safe to allow by default.

Can I rate-limit fork_task? +

Yes. Add a rate_limit block to the fork_task rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.

How do I block fork_task completely? +

Set action: deny in the PolicyLayer policy for fork_task. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.

What MCP server provides fork_task? +

fork_task is provided by the Yaver MCP server (yaver-cli). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.

// GET IN TOUCH

Have a question or want to learn more? Send us a message.

Message sent.

We'll get back to you soon.