When Claude Code acts up, I want to know whether my own setup causes it. One flag takes the setup out of the picture so I can look again.
--safe-mode starts a session with all customisations disabled. The CLI reference describes it as a way to troubleshoot a broken configuration.
claude --safe-mode
In that session CLAUDE.md, skills, plugins, hooks, MCP servers, custom commands and agents, output styles, workflows, custom themes and keybindings, the status line, file-suggestion commands, LSP servers and auto memory do not load. Authentication, model selection, built-in tools and permissions work as usual. That is where it differs from --bare, a minimal mode that skips auto-discovery of hooks, skills, plugins, MCP servers, auto memory and CLAUDE.md so scripted calls start faster.
The test is simple. Reproduce the problem in a normal session, then try again with claude --safe-mode. If it still happens, your setup is not the cause. If it is gone, add things back one at a time, hooks and MCP servers first, until the problem returns. The reference also names a second use: checking whether a customisation triggers automatic model fallback.
The flag sets the environment variable CLAUDE_CODE_SAFE_MODE.
Managed settings policy still applies in safe mode, including policy-configured hooks, status line and file-suggestion commands. A problem that comes from such a policy survives the test.
Further reading: Claude Code CLI reference