Claude Code Bash Sandbox Blocks an Expected Command
Claude Code keeps prompting for a command you allowlisted. Fix it: prefix patterns with a trailing wildcard, split compound commands, and check the new OS sandbox fallback. Verified June 2026.
Agent loops, wrong-file edits, lost context, multi-agent conflicts, rollbacks, Plan mode issues.
Claude Code / Codex agent workflow failures are rarely "the model is weak" — usually "wrong context" or "too-broad permission." Articles here group by real failure mode: agent loops, wrong-file edits, lost context, broken Plan mode, multi-agent conflicts, messy rollbacks, scattered changes. One symptom, shortest fix path.
Claude Code keeps prompting for a command you allowlisted. Fix it: prefix patterns with a trailing wildcard, split compound commands, and check the new OS sandbox fallback. Verified June 2026.
Claude Code starts a session but ignores your project CLAUDE.md. Run /memory to see what loaded, fix the path/casing, and resolve the cause in minutes.
A PreToolUse hook keeps rejecting Edit calls, even safe ones. The fix is almost always exit-code 2 logic, the deny-JSON format, stdin parsing, or matcher scope.
MCP tool calls in Claude Code time out or hang while a direct curl works. Usually stdio stdout pollution, the wrong startup vs tool timeout, a never-sent initialize, or a proxy that buffers SSE. Fixes verified June 2026.
A long Claude Code reply cuts off mid-sentence. Fastest fix: tell it to continue from the last line. Real cause is usually auto-compact, the per-reply output cap, or one huge tool result eating the budget.
Resume a Claude Code session and it acts like a fresh start — forgetting the plan, the decisions, the half-finished refactor. Diagnose compaction, broken transcript chains, and ephemeral tool results, then fix it.
Edited ~/.claude/settings.json but Claude Code ignores your hook, permission, or env? Run /doctor first. Usually JSON syntax, wrong scope, or precedence shadowing.
You added a SKILL.md under ~/.claude/skills/ but /<name> says not found, or it never auto-fires. Fix the path, frontmatter, description, or skill-budget issue in minutes.
Your Claude Code statusLine shows an error, stays blank, or stalls the prompt. Fix the JSON-on-stdin contract, missing jq, exit codes, slow git calls, and workspace trust.
A Task subagent finished cleanly but the main Claude Code session shows nothing, a generic summary, or claims it's still running. Fix the final-message, output-size, or routing problem in minutes.
Claude Code re-prompts for a Bash or Edit you already allowed. Usually the allow pattern is too narrow, lives in the wrong settings scope, or the command is compound — here is the exact fix.
One task burns through the context window, auto-compacts mid-refactor, and loses your plan. Decompose into smaller steps, push reads into sub-agents, and save state to disk.
A dev server or curl runs forever and Claude Code freezes on a spinner. Use run_in_background, set an explicit timeout, and kill stuck shells with /tasks. Verified June 2026.