claude_reply
Resume a Claude Code session from a prior session ID to send follow-up prompts, reuse its working directory, or fork it into a new session for branching work.
Instructions
Continue a Claude Code session via claude --resume=<session_id> (runs synchronously, or as a native MCP Task when the client advertises io.modelcontextprotocol/tasks). Automatically reuses the original session's cwd/worktree when cwd is omitted. Pass fork_session=true to branch into a new session_id. For long follow-ups on non-Tasks clients, prefer claude_async(session_id=..., prompt=...) + claude_wait.
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": {
"prompt": "<prompt>",
"session_id": "<session_id>"
},
"name": "claude_reply"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Working directory for the Claude Code session. If relative, resolved against the server's cwd. On resume, defaults to the original session's cwd/worktree when omitted. | |
| bare | No | Minimal headless mode skipping hooks, plugins, CLAUDE.md discovery, and OAuth/keychain reads (passes --bare; requires API key or provider credentials). | |
| agent | No | Named agent for this session (passes --agent). | |
| model | No | Optional model alias or full model name (e.g. 'opus', 'sonnet', 'haiku', 'fable', or a full model identifier). Call claude_models to list available models, resolved IDs, and supported effort levels. | |
| tools | No | Built-in tools to expose: "" or [] for none, "default" for the default set, or comma-separated/array tool names (e.g. ["Read","Edit","Bash"]). | |
| agents | No | Custom agents definition (JSON object or file path; passes --agents). | |
| effort | No | Reasoning effort level for this session. | |
| prompt | Yes | The follow-up prompt to continue the session. | |
| add_dir | No | Additional directories Claude can access (passes repeatable --add-dir). | |
| settings | No | Extra settings to load (JSON object or file path; passes --settings). Prefer file paths over inline credentials. | |
| max_turns | No | Maximum number of agentic turns for this invocation (passes --max-turns). | |
| mcp_config | No | MCP server configurations to load (array of JSON objects or file paths/JSON strings; passes repeatable --mcp-config). | |
| session_id | Yes | The session ID (or session name) from a previous Claude call. | |
| json_schema | No | Optional JSON Schema (object or string) passed to --json-schema so Claude Code returns structuredContent.structured_output via its StructuredOutput tool. Callers should verify structured_output is present, as Claude CLI can still exit 0 without it on short-circuited CLI commands or prose fallbacks. | |
| fork_session | No | When resuming via session_id, create a new session ID instead of mutating the original session (passes --fork-session). | |
| allowed_tools | No | Tool allow rules (e.g. ["Bash(git *)", "Edit"]; passes --allowed-tools). | |
| system_prompt | No | Replace the default system prompt (passes --system-prompt). | |
| fallback_model | No | Optional fallback model(s) (comma-separated) when the primary model is busy or unavailable (passes --fallback-model). | |
| max_budget_usd | No | Maximum API spend in USD for this invocation (passes --max-budget-usd). | |
| permission_mode | No | Permission mode for tool approval (acceptEdits, auto, bypassPermissions, manual, dontAsk, plan). | |
| setting_sources | No | Comma-separated setting sources to load (e.g. "user,project,local", or "" to exclude all user/project/local settings). | |
| disallowed_tools | No | Tool deny rules (e.g. ["Bash(rm *)"]; passes --disallowed-tools). | |
| strict_mcp_config | No | Only use MCP servers from mcp_config, ignoring all other MCP configs (passes --strict-mcp-config). Explicit false overrides server default. | |
| append_system_prompt | No | Append text to the default system prompt (passes --append-system-prompt). | |
| disable_slash_commands | No | Disable all skills and slash commands (passes --disable-slash-commands). Explicit false overrides server default. | |
| no_session_persistence | No | Do not save the session transcript to disk; cannot be resumed later (passes --no-session-persistence). Explicit false overrides server default. | |
| dangerously_skip_permissions | No | Bypass all permission checks (passes --dangerously-skip-permissions). Explicit false overrides server default. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | ||
| model | No | ||
| usage | No | ||
| effort | No | ||
| status | Yes | ||
| failure | No | ||
| exit_code | No | ||
| num_turns | No | ||
| session_id | No | ||
| stop_reason | No | ||
| tool_errors | No | ||
| partial_output | No | ||
| result_subtype | No | ||
| permission_mode | No | ||
| terminal_reason | No | ||
| duration_seconds | No | ||
| structured_output | No | ||
| permission_denials | No |