claude_execute
Runs small/medium approved plans synchronously and unattended via local Claude Code CLI, with session continuity and returning BUSY when a workspace job is active. For longer tasks, use start/status.
Instructions
Synchronous fast path (capped at 165s, strictly under Antigravity's 180s MCP limit) to execute small/medium approved plans unattended via local Claude Code CLI (Sonnet 5.5) with automatic local continuity cache (.agents/state/plan-history.md and session-index.json). Returns BUSY immediately if another job is already running in the same workspace. For large tasks (>2 min, bulk file generation, terraform init, npm install), use claude_execute_start + claude_execute_status instead.
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": {
"workspace_dir": "<workspace_dir>"
},
"name": "claude_execute"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| plan | No | Complete approved implementation plan or fix-round instructions (optional when plan_file is provided). | |
| model | No | Claude model alias or ID (default: sonnet -> Sonnet 5.5; e.g. claude-sonnet-5-5, sonnet[1m]). | |
| effort | No | Claude CLI reasoning effort: low, medium, high, xhigh, or max (default: CLAUDE_EFFORT or high). | |
| max_turns | No | Maximum Claude CLI agentic turns (default: 40). | |
| plan_file | No | Path to the approved plan file (relative to workspace_dir or absolute). It identifies the plan content but does NOT change the warm session. | |
| session_key | No | Continuity bucket in .agents/state/session-index.json (default: 'workspace'), so sequential small updates and new plan files stay on one warm session. Pass a custom key only for unrelated subsystems. | |
| session_mode | No | 'auto' (default): resume the warm workspace session within TTL 3600s / 30 turns and inject a compact External Workspace Changes diff when files were edited outside the session, rotate otherwise; 'resume' to force resuming; 'fresh' to force a new session. | |
| allowed_files | No | Authorized file paths Claude is permitted to create or modify. | |
| extra_context | No | Optional supplementary context or constraints for the execution. | |
| workspace_dir | Yes | Absolute path to the target project workspace directory. | |
| include_history | No | Inject bounded L1 .agents/state/workspace-brief.md plus the latest 2 L2 plan-history entries on fresh/rotated/fallback runs (default: true). | |
| permission_mode | No | Claude CLI permission mode (default: bypassPermissions). | |
| timeout_seconds | No | Sync timeout in seconds (default: 150, max: 165). | |
| resume_session_id | No | Explicit Claude CLI session_id to resume directly via --resume. | |
| verification_commands | No | Commands Claude must execute to collect objective runtime evidence. |