Operations and Safety Commands
Commands for permission control, MCP, plugins, cleanup, sandboxing, and troubleshooting.
Key takeaways
- Groups the operational commands: permission and sandbox controls, MCP and plugin management, project cleanup, and a troubleshooting sequence.
- Scope
/permissionsrules by tool and path, and treat/sandboxas one layer rather than the sole security boundary. claude project purgedeletes transcripts, task lists, logs, and the project entry in~/.claude.json; always run--dry-runfirst.claude --safe-modedisables customizations (CLAUDE.md, hooks, plugins, MCP, skills) to isolate what triggers a Fable-to-Opus fallback, while keeping auth and permissions active.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1bundles the autoupdater, feedback, error-reporting, and telemetry disables for locked-down environments.
Permission and Sandbox
| Command | Use it for | Watch out for |
|---|---|---|
/permissions | Manage allow, ask, and deny rules for tool permissions. Opens an interactive dialog where you can view rules by scope, add or remove rules, manage working directories, and review recent auto mode denials. Alias: /allowed-tools. | Rules should be scoped by tool and path where possible. |
/fewer-permission-prompts | Bundled skill. Scans your transcripts for common read-only Bash and MCP tool calls, then adds a prioritized allowlist to project .claude/settings.json to reduce permission prompts. | Review proposed rules before committing them. |
/sandbox | Toggle sandbox mode. Available on supported platforms only. | Do not use it as the only security boundary. |
/security-review | Analyze pending changes on the current branch for security vulnerabilities. Reviews the git diff and flags risks like injection, auth issues, and data exposure. | It complements tests and human review; it does not replace them. |
MCP and Plugins
| Command | Use it for | Recent note |
|---|---|---|
/mcp | Manage MCP server connections and OAuth authentication. | Use /mcp for interactive diagnosis; show tool visibility and connection state from inside a session. |
claude mcp | Configure MCP servers from the CLI (add, remove, list, login, logout, and authenticate). | Use the CLI for scriptable bootstrap and OAuth refresh; use /mcp for interactive diagnosis. |
/plugin | Manage Claude Code plugins (install, enable, and configure). | Marketplace and plugin behavior is configured under .claude/ settings and plugin manifests. |
/reload-plugins | Reload all active plugins to apply pending changes without restarting. | Reports counts for each reloaded component and flags any load errors, including --plugin-dir load failures. |
/reload-skills | Re-scan skill and command directories so skills added or changed during the session become available without restarting (v2.1.152+). | Useful after editing .claude/skills or .claude/commands. Reports how many skills are available and how many were added or removed. |
/hooks | View hook configurations for tool events. | Hooks can be powerful; keep failure behavior explicit. |
Cleanup
Use claude project purge when you need to remove local Claude Code state for a project:
claude project purge ~/work/repo --dry-run
claude project purge ~/work/repo -yIt deletes transcripts, task lists, debug logs, file-edit history, prompt history lines, and the
project's entry in ~/.claude.json. Omit the path to pick from an interactive list. Useful flags:
--dry-run to preview, -y/--yes to skip confirmation, -i/--interactive to confirm each item,
and --all to purge every project. Always start with --dry-run unless you are in a disposable
environment.
Troubleshooting Sequence
/status
/doctor
/mcp
/plugin
/usage/status opens the Settings interface on the Status tab (version, model, account, connectivity) and
works while Claude is responding. /doctor diagnoses and verifies your installation and settings;
press f to have Claude fix any reported issues. /usage shows session cost, plan limits, and
activity stats; /cost and /stats are aliases of /usage.
For long MCP calls, set CLAUDE_CODE_MCP_TOOL_IDLE_TIMEOUT explicitly in CI or agent-runner
environments. v2.1.187 added claude mcp login/logout; prefer those commands when auth needs to be
refreshed outside an interactive /mcp session.
For model or usage drift after the Fable 5 and Opus 4.8 updates, add:
/model
/advisor
/usage-credits/usage-credits (previously /extra-usage) configures usage credits so you can keep working when
you hit a limit.
If Fable 5 unexpectedly falls back to Opus before an unusual prompt, isolate configuration and workspace context with:
claude --safe-modeSafe mode starts Claude Code with customizations disabled, which makes it useful for checking whether
CLAUDE.md, hooks, plugins, MCP servers, skills, custom commands, output styles, workflows, themes,
keybindings, status line, file suggestions, LSP servers, or auto-memory are triggering classifiers.
It differs from --bare: authentication, model selection, built-in tools, and permissions still work,
and managed settings policy still applies.
Use --disable-slash-commands when a session should expose no skills or slash commands. Use
disableBundledSkills: true or CLAUDE_CODE_DISABLE_BUNDLED_SKILLS=1 when you only want to remove
Claude Code's bundled skills and workflows while leaving project, user, and plugin skills available.
For locked-down environments, consider CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 and document
why it is set. This is equivalent to setting DISABLE_AUTOUPDATER, DISABLE_FEEDBACK_COMMAND,
DISABLE_ERROR_REPORTING, and DISABLE_TELEMETRY together. Do not rely on Auto mode alone for
data-loss prevention; keep network and permission rules scoped.
In v2.1.181~v2.1.190 runbooks, also check sandbox.credentials, Windows PowerShell sandbox behavior,
and destructive-command sandbox auto-approval. These controls are security boundaries; record the
expected behavior before enabling broad background or agent workflows.
If the issue is command behavior rather than environment state, add:
/debug describe the failure and include the last command that behaved unexpectedly/debug is a bundled skill that enables debug logging for the current session and analyzes the
session debug log. Because logging is off by default unless you started with claude --debug,
running /debug mid-session captures logs from that point forward. Optionally describe the issue to
focus the analysis.
For large, stale sessions, prefer summarize-and-resume behavior (/compact, /rewind, or
/clear) over repeatedly loading a corrupted or oversized transcript.