Common Claude Code errors and fixes — reproduced live
Real errors reproduced on this Mac, with the actual messages and fixes.
How this article was built
Not generic advice — errors actually reproduced on this Mac, with the real messages recorded.
Specifying a nonexistent model
`claude --model this-model-does-not-exist -p "hello"` returned:
There's an issue with the selected model (this-model-does-not-exist).
It may not exist or you may not have access to it."Workspace not trusted" on a first-time folder
Even with `permissions.allow` set, a first-time project folder shows:
Ignoring N permissions.allow entries from .claude/settings.json:
this workspace has not been trusted. Run Claude Code interactively
here once and accept the trust dialog...Blocked by permissions.deny
Verified live with `Bash(rm -rf*)` in deny:
Permission to use Bash with command rm -rf ... has been denied.Blocked by a PreToolUse hook
If the hook exits with code 2:
PreToolUse:Bash hook error: [<hook command>]: <message the hook printed>MCP server stuck "pending approval"
`claude mcp list` shows unapproved servers like this until approved interactively:
demo-server: https://example.com/mcp (HTTP) - ⏸ Pending approval (run `claude` to approve)Still stuck?
Run `claude doctor` (only in trusted directories — it spawns stdio MCP servers for health checks) and note your `--version` before digging further.
FAQ
What does "issue with the selected model" mean?
A typo in the model name, or no access to it. Check your --model value.
What does "workspace has not been trusted" mean?
A first-time project folder — run interactively once and accept the trust dialog.
What does "Permission ... has been denied" mean?
The action matched permissions.deny — check if that's intended.
What does "PreToolUse:Bash hook error" mean?
A hook exited with code 2, blocking the call — check if intended.
MCP server stuck pending approval?
Run `claude` interactively once to approve it.