Skip to main content
Glama

Ask Claude Code (new session)

claude_ask

Delegate large refactors and careful code reviews to Claude Code as a sub-agent in a new session; set workspace to the project directory so it can inspect the repo.

Instructions

Best for large refactors and careful reviews: Claude Code (claude -p) as a sub-agent, for hosts other than Claude Code, in a NEW session. Pass workspace=; without it the sub-agent sees no repo. Follow up with claude_continue. Uses your Claude plan login or ANTHROPIC_API_KEY. Its sandbox is agent-enforced; workspace-write edits files but runs no shell. Autonomous agent: trusted prompts only.

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_ask"
  }
}

Input Schema

NameRequiredDescriptionDefault
modelNoOptional model (`--model`): an alias such as "haiku", "sonnet", "opus", or a full model id. Omit for your Claude Code default.
watchNoIf true, open a live "watch" view streaming Claude Code's steps. Same final text is returned. Best-effort. Default false.
effortNoOptional reasoning effort (`--effort`): "low", "medium", "high", "xhigh" or "max". Omit for Claude Code's default for the model.
promptYesQuestion or instruction for Claude Code.
sandboxNoPermission policy, enforced by Claude Code itself (not an OS sandbox): "read-only" (default: reads and searches files, no edits, no shell, no web), "workspace-write" (may edit files inside the workspace, but runs NO shell commands, so it cannot run tests or builds), or "danger-full-access" (every permission check skipped — avoid).read-only
timeout_sNoMax seconds to wait for claude to complete. Default 180.
workspaceNoWorking directory for the session. Defaults to the server cwd.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.38.0
    • addedInput schema / properties / effort
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Optional reasoning effort (`--effort`): \"low\", \"medium\", \"high\",\n    \"xhigh\" or \"max\". Omit for Claude Code's default for the model."
      +}
  2. Addedv0.37.1

TDQS

A4.5/5.0
Behavior5/5

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

Goes well beyond the supplied annotations (readOnly=false, openWorld=true, idempotent=false) by disclosing the sandbox model: agent-enforced, workspace-write edits files but runs no shell, and danger-full-access should be avoided. It also documents auth requirements (Claude plan login or ANTHROPIC_API_KEY) and that the agent is autonomous and should only get trusted prompts.

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?

Dense and front-loaded with the use-case fit, then works through workspace, follow-up, auth, sandbox, and trust in order. It is a single run-on paragraph with line-wrap artifacts, so a reader must parse carefully, but essentially every clause carries information.

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 7-parameter subprocess tool with an output schema already covering return values, the description covers the risky pieces: auth, sandbox implications, mandatory workspace, and the follow-up tool. Minor omissions are the timeout behavior and any mention of how long runs behave, both left to the schema.

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 the baseline is 3, but the description adds real meaning for the key parameter: workspace must be set or "the sub-agent sees no repo", which is stronger than the schema's generic "Defaults to the server cwd". It also restates the sandbox consequence (no test/build execution) in operational terms.

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 action and resource: it runs Claude Code (`claude -p`) as a sub-agent in a NEW session, aimed at hosts other than Claude Code. It explicitly names the sibling `claude_continue` as the follow-up path, so an agent can tell the two apart 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 Guidelines4/5

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

Gives concrete when-to-use guidance ("large refactors and careful reviews", "hosts other than Claude Code") and a when-not caution ("trusted prompts only", so not for untrusted input). The explicit follow-up pointer to `claude_continue` covers the alternative, though it does not explain how to choose between this and the many other `*_ask` sub-agent tools.

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