Start Debugging

ai-agents

288 posts · Page 3 of 29

How to Change Claude's Effort Per Turn With a Mid-Conversation System Message

Stop rewriting output_config.effort between requests. Append {"role": "system", "content": [], "output_config": {"effort": "low"}} with the mid-conversation-output-config-2026-07-01 beta and claude-opus-5-5, claude-sonnet-5-5 or claude-haiku-5-5 switches effort from the next user turn while the prompt cache and preserved thinking stay valid. Placement, persistence, errors and an agent-loop helper.

How to Stop Claude Code From Writing Outside the Repo With permissions.blockWritesOutsideWorkingDirectories

Set permissions.blockWritesOutsideWorkingDirectories to true and Claude Code 2.1.314+ makes Write, Edit and NotebookEdit refuse any path outside the working directories in every permission mode, bypassPermissions included. What it refuses, what stays writable, why allow rules cannot open it, how /add-dir and additionalDirectories do, what it does to worktrees, and how to pair it with the Bash sandbox so shell commands are fenced too.

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.

How to Manage Claude Managed Agents, Skills and Memory Stores as Code with ant apply

Keep Claude Managed Agents, skills, environments and memory stores in git and reconcile them with `ant apply` (anthropic-cli 1.30.0+, current 2.9.0). The file layout for each kind, what claude-lock.json records and why you must commit it, how drift, --force and --prune behave, why memory stores attach through deployments rather than agents, and a GitHub Actions workflow that applies on merge.

How to Trace Anthropic SDK Calls With the Built-In OpenTelemetry Export

The Anthropic Python and TypeScript SDKs now emit OpenTelemetry spans on their own: register a tracer provider before the first call and every messages.create becomes an anthropic.messages.create CLIENT span with gen_ai.* token, model and stop-reason attributes. Content mode, conversation IDs, user.id baggage, linking to the Claude Platform's server-side spans, streaming and tool runner behavior, and the env-var override trap, checked against anthropic 2.8.0.
Prev Next