Skip to main content
Glama

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

NameRequiredDescriptionDefault
planNoComplete approved implementation plan or fix-round instructions (optional when plan_file is provided).
modelNoClaude model alias or ID (default: sonnet -> Sonnet 5.5; e.g. claude-sonnet-5-5, sonnet[1m]).
effortNoClaude CLI reasoning effort: low, medium, high, xhigh, or max (default: CLAUDE_EFFORT or high).
max_turnsNoMaximum Claude CLI agentic turns (default: 40).
plan_fileNoPath to the approved plan file (relative to workspace_dir or absolute). It identifies the plan content but does NOT change the warm session.
session_keyNoContinuity 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_modeNo'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_filesNoAuthorized file paths Claude is permitted to create or modify.
extra_contextNoOptional supplementary context or constraints for the execution.
workspace_dirYesAbsolute path to the target project workspace directory.
include_historyNoInject bounded L1 .agents/state/workspace-brief.md plus the latest 2 L2 plan-history entries on fresh/rotated/fallback runs (default: true).
permission_modeNoClaude CLI permission mode (default: bypassPermissions).
timeout_secondsNoSync timeout in seconds (default: 150, max: 165).
resume_session_idNoExplicit Claude CLI session_id to resume directly via --resume.
verification_commandsNoCommands Claude must execute to collect objective runtime evidence.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does real work: hard timeout ceiling, concurrency lock and BUSY failure mode, unattended execution, and automatic continuity cache files (.agents/state/plan-history.md, session-index.json). Gaps remain around the safety profile of an unattended run — the default bypassPermissions mode is only visible in the schema, and nothing says what a successful return looks like or what partial edits survive a timeout.

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

Conciseness4/5

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

Three sentences, front-loaded with the cap and then the routing alternative, with essentially no filler. The stacked parentheticals (the limit note, the two cache paths) make it dense to parse, which keeps it from a 5.

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?

For a 15-parameter execution tool with no annotations and no output schema, the description covers the decisions an agent must make: size threshold, timeout ceiling, concurrency contention, session continuity, and the async alternative. It leaves return-value shape and failure/partial-write semantics unexplained, which is the main residual gap given there is no output schema to fall back on.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% so parameters are already documented, but the description supplies the conceptual model that ties several of them together: the local continuity cache and warm-session notion explain why session_key, session_mode, plan_file and include_history exist and how they interact. It does not add parameter-level syntax beyond the schema, so it stops short of a 5.

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 and resource ('execute small/medium approved plans unattended via local Claude Code CLI'), names the synchronous fast path and its hard 165s cap, and explicitly contrasts itself with the async pair. An agent can distinguish it from claude_execute_start/status without opening either schema.

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

Usage Guidelines5/5

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

Gives both directions: use this for small/medium approved plans, and route to claude_execute_start + claude_execute_status for concrete large-work cases (>2 min, bulk file generation, terraform init, npm install). The 'BUSY returns immediately if another job is running in the same workspace' line also tells the agent a precondition that will make the call fail.

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