Find the layer before you fix the problem
Analyze an operational problem in a Claude-based system or Claude Code to find whether configuration, permissions, limits, context or model behaviour causes it, and pick the fix for that cause.
Scenario
An on-call engineer sees Claude requests failing and switches the service to a larger model. Nothing changes. Two hours later someone reads the error body: the workspace had hit the monthly spend limit the finance team set.
The model was never the problem. The fix was one setting away.
Explanation
Operational problems look like "Claude is broken". Work through the layers in this order, cheapest evidence first, and only blame the model once the others are ruled out.
1. Configuration: did the tool load what you think? In Claude Code, /status shows which settings sources loaded, and claude mcp list shows each MCP server's state. A project .mcp.json server waits for approval in an interactive session. An unset ${VAR} in .mcp.json is passed through as literal text, and Claude's own credential names (such as ANTHROPIC_API_KEY) read as empty in a remote server's headers, which usually ends in a 401.
2. Permissions: did a rule decide it? Rules run deny, then ask, then allow. A "don't ask again" approval saves an allow rule to your local file, and it doesn't outrank an ask rule from the project or managed settings.
3. Limits and errors: what does the response say?
| Signal | Likely cause | Fix |
|---|---|---|
429 with retry-after |
rate limit | back off; the SDK retries with backoff |
429, no retry-after, keeps failing |
tier spend cap | billing, not retries |
| 400 "reached your specified ... usage limits" | a spend limit you set | raise or remove it |
529 overloaded_error |
API-wide load | retry with backoff, degrade gracefully |
500 api_error that persists |
Anthropic-side error | contact support with the request-id |
The rate-limit headers (anthropic-ratelimit-*) and anthropic-workspace-id show which limit and which workspace a request hit.
4. Context: what was in the window? Long sessions full of failed attempts, and CLAUDE.md files so long that rules get lost, both look like "Claude ignores me". Use /clear between tasks and prune CLAUDE.md.
5. Model behaviour. Only now. And if a rule must always hold, the fix isn't a better model: CLAUDE.md is guidance, so enforce the rule with a permission rule or a hook.
Worked example
Ticket: "Claude Code keeps editing files in src/generated/ even though CLAUDE.md says not to. Can we get a better model?"
Before. The team proposes a larger model and moves the rule to the top of CLAUDE.md in capitals.
Diagnosis, layer by layer. Configuration: the rule is in CLAUDE.md, which is 600 lines, well past the guidance of under 200, so rules get lost. Permissions: no rule protects the folder, so nothing stops an edit. The behaviour follows from the setup, not from the model.
After.
{
"permissions": {
"deny": ["Edit(/src/generated/**)"]
}
}
The deny rule goes into the shared .claude/settings.json, and CLAUDE.md is pruned to what Claude can't work out from the code. Claude's file edits to that folder are now blocked whatever the model decides: the rule covers its file tools, the file commands Claude Code recognizes in Bash and redirections, though not a script that writes files itself. For a guarantee that covers every process, add the sandbox.