claude_code_execute
Executes Claude Code synchronously with configurable prompts, working directories, models, timeouts, and output formats, returning the completed result for automation and scripted development tasks.
Instructions
Execute Claude Code synchronously with full control over parameters. Returns the result after completion. Common usage: prompt="your task", working_dir="/path/to/project"
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>"
},
"name": "claude_code_execute"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | Model to use (e.g., "sonnet", "opus", "haiku") | |
| prompt | Yes | The task prompt for Claude Code to execute | |
| timeout | No | Timeout in seconds (default: no limit) | |
| working_dir | No | Working directory for the task (default: current directory) | |
| output_format | No | Output format: "text" (default), "json", or "stream-json" | text |
| additional_args | No | Additional CLI arguments to pass to Claude Code | |
| skip_permissions | No | Skip permission checks for automation (default: true) |