Skip to main content
Glama

Ask Claude Code (new session)

claude_ask

Delegate large refactors and careful reviews to a Claude Code sub-agent in a new session; pass a workspace directory so it can inspect your 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.
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. Addedv0.37.1

TDQS

A4.6/5.0
Behavior4/5

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

Beyond the annotations (readOnlyHint=false, openWorldHint=true, idempotent=false), it discloses that the sandbox is agent-enforced rather than OS-enforced, that workspace-write edits files but runs no shell, that auth comes from a Claude plan login or ANTHROPIC_API_KEY, and that the agent is autonomous so only trusted prompts should be used. The only real omission is rate/timeout consequences, which the timeout_s schema field partly covers.

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?

Front-loaded with the primary use case, then constraints, then prerequisites and follow-up routing — dense but nearly every clause carries actionable information. It is slightly cluttered by stacked parentheticals and wrapping, but there is no filler sentence.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema present, annotations covering openness/mutation, and 100% parameter coverage, the description only needs to supply operational context — and it does: auth source, sandbox enforcement model, workspace requirement, follow-up path, and trust guidance. Nothing needed to invoke it safely is missing.

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, and the description does add meaningful consequence beyond the schema: omitting workspace means the sub-agent sees no repo, which the schema's 'Defaults to the server cwd' phrasing does not make operationally clear. It otherwise restates the sandbox modes already documented in the schema.

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 concrete mechanism and resource: Claude Code (`claude -p`) run as a sub-agent in a NEW session, for hosts other than Claude Code. It explicitly contrasts the new-session behavior with its sibling by telling the agent to 'Follow up with claude_continue', so the agent can choose between them without opening a 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 positive selection criteria ('Best for large refactors and careful reviews'), a host constraint ('for hosts other than Claude Code'), an explicit alternative for follow-ups (claude_continue), a prerequisite (pass workspace or the sub-agent sees no repo), and a safety warning ('trusted prompts only'). That is when-to-use, when-not, and routing in a single block.

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