slash commands

Commands starting with / control the session itself, rather than being a request for Claude to do something in your code.
CommandDoes
/helplists available commands and basic usage
/clearstarts a fresh session, discarding the current conversation's context
/compactsummarizes the conversation so far to free up context — use before you hit the limit, not after
/configopens configuration settings
/initgenerates a starter CLAUDE.md by having Claude read and summarize the codebase
Projects and users can also define their own custom slash commands — a skill (see Claude Skills) is one way these get packaged and shared.

running shell commands directly

Prefixing input with ! runs it as a literal shell command in the current session rather than a message to Claude — handy for something you want to run yourself and have the output land directly in the conversation (e.g. an interactive login command Claude shouldn't run on your behalf).

permission rules

Claude Code asks before running a tool call that isn't already allowed. Rules take the shape Tool(pattern) and live in an allow/deny list — deny always wins over allow, and a more specific pattern overrides a general one.

{
  "permissions": {
    "allow": [
      "Bash(npm run test *)",
      "Read(~/.zshrc)"
    ],
    "deny": [
      "Bash(curl *)",
      "Read(./.env)",
      "Read(./secrets/**)"
    ]
  }
}
            

where configuration lives

LocationScopeShared?
~/.claude/settings.jsonyou, every projectno
.claude/settings.jsonthis projectyes — commit it
.claude/settings.local.jsonyou, this project onlyno — gitignore it
Managed policy settingsevery user in the organizationyes, IT-deployed
When the same rule appears at multiple levels, managed policy always wins, then command-line flags, then local, then project, then user settings — except permission allow/deny rules specifically, which merge across every scope instead of the higher one overriding the lower. Run /status in a session to see exactly which settings files actually loaded.

a few settings worth knowing about

KeyDoes
modelsets the session's model — see Choosing a Claude Model
autoMemoryEnabledtoggles auto memory (on by default) — see Effective Prompting
hooksevent-triggered scripts — see Hooks & Automation
envenvironment variables set for every tool call in the session

related topics

Claude Cheat Sheet — the bigger picture this CLI fits into.
Claude Code Keyboard Shortcuts — the interactive controls that sit on top of these commands.
Agents & Subagents — delegating part of a task to a separate Claude Code session.
Hooks & Automation — running your own scripts automatically around tool calls, configured in these same settings files.
Avoiding Usage Limits — why /compact helps with context but doesn't reset your account-level usage.

reference

code.claude.com — overview
code.claude.com — settings