claude
Execute a coding task by sending a prompt to the CLI, then use the returned session ID to continue the conversation.
Instructions
Run a Claude Code CLI session. Executes claude -p --output-format stream-json as a subprocess and returns the result.
Use this tool to start a new coding task with Claude Code. The response includes a Session ID that can be used with the claude-reply tool to continue the conversation.
WARNING: defaults to permission mode bypassPermissions (parity with codex --full-auto). Use a safer mode (e.g. acceptEdits or auto) for sensitive workspaces.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | The prompt to send to Claude | |
| model | No | Model id or alias (e.g. "sonnet", "opus", "claude-sonnet-4-6"). Do NOT set this unless the user explicitly requests a specific model. | |
| effort | No | Reasoning effort. Auto-select based on task complexity: low/medium for simple tasks, high for moderate, xhigh/max for complex multi-file work. Do NOT set if the user has not asked for a specific level. | |
| permissionMode | No | Permission mode. Defaults to "bypassPermissions" (parity with codex --full-auto). Use "acceptEdits" or "auto" for safer behavior. | |
| cwd | No | Working directory for the Claude session | |
| addDirs | No | Additional directories Claude can read/edit (--add-dir). | |
| allowedTools | No | Tools Claude may use without permission prompt (e.g. ["Bash(git *)", "Edit"]). See Claude permission rule syntax. | |
| disallowedTools | No | Tools Claude must not use. | |
| appendSystemPrompt | No | Text appended to the default system prompt. | |
| mcpConfig | No | MCP server config files or JSON strings (--mcp-config, repeatable). | |
| maxTurns | No | Limit the number of agentic turns (--max-turns). Headless safety stop. | |
| bare | No | Run with --bare (skip hooks/skills/plugins/MCP/CLAUDE.md). NOTE: requires ANTHROPIC_API_KEY or apiKeyHelper — Pro/Max OAuth users will fail to authenticate. | |
| timeout | No | Idle timeout in milliseconds (default: 600000 = 10 min). Resets on every event. |