Start Debugging

headless

4 posts

How to Cut claude -p Input Tokens When claude.ai Connectors Add Hundreds of Thousands of Tokens to Every Headless Call

On a claude.ai subscription login, every connector on your account rides along into each claude -p call. With tool search on, that costs a few thousand tokens. Pass --tools without ToolSearch and the full definitions load upfront: one reported health check went from 2,854 to 429,388 input tokens. How to drop the connectors with ENABLE_CLAUDEAI_MCP_SERVERS=false, disableClaudeAiConnectors or --strict-mcp-config, keep the MCP servers you need, and add a token ceiling so the next auto-loaded feature cannot silently come back. Claude Code 2.1.331.

How to Keep Unattended Claude Code Runs From Stalling on Permission Prompts With permissions.denyInsteadOfPrompting

Set permissions.denyInsteadOfPrompting to true in user, managed or --settings scope and Claude Code 2.1.319+ denies any tool call that would wait on a permission prompt, then keeps the turn going. Where it applies, how it differs from dontAsk mode and --permission-prompts none, what it also switches off, how to approve calls from a PermissionRequest hook, and the two dialogs it cannot skip.