Claude Query
queryExecute code generation, analysis, refactoring, and explanation prompts via Claude Code CLI. Supports file context, session resume, model selection, and cost control.
Instructions
Execute a prompt via Claude Code CLI with optional file context and session resume. Claude is an AI coding agent that can generate, analyze, refactor, and explain code.
Capabilities: code generation and refactoring, code analysis and explanation, file understanding (text and images), multi-turn conversations via sessionId.
Cost: Default model is Sonnet (~$0.01-0.10/call). Use effort="low" for simple tasks, effort="high" + model="opus" for complex analysis. Set maxBudgetUsd to cap per-call cost (recommended for effort="max" or model="opus").
Tips:
Set workingDirectory to the target repo for project-aware responses.
Break complex tasks into focused prompts rather than one large request.
Resume multi-turn conversations with sessionId from a previous response's metadata.
Include relevant files via the files parameter for targeted context (text files inlined in prompt, images trigger allowed-tools mode).
Use noSessionPersistence=true for stateless one-shot calls.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | The prompt to send to Claude | |
| files | No | File paths (text or images) relative to workingDirectory | |
| model | No | Model alias or full Claude model name | |
| sessionId | No | Claude session ID to resume with --resume | |
| resetSession | No | Clear stored session state before execution (use with sessionId to start fresh) | |
| noSessionPersistence | No | Disable session persistence for ephemeral print calls | |
| workingDirectory | No | Working directory for file resolution and CLI execution | |
| timeout | No | Timeout in milliseconds (default: 60000, image queries: 120000) | |
| maxResponseLength | No | Soft limit on response length in words | |
| maxBudgetUsd | No | Maximum cost budget in USD for this call (passed to --max-budget-usd) | |
| effort | No | Effort level: low, medium, high, or max (passed to --effort) |