Clear, practical technology insights BSOD Code Lookup · Windows Error Code Lookup · Wi-Fi Troubleshooting · PC Troubleshooting Checklist

Essential Claude Code Commands for Context, Sessions and Review

Use the documented Claude Code commands for help, context, compaction, session recovery and permissions, with examples that distinguish prompts from shell commands.

Table of Contents

Claude Code's most useful session commands help you inspect context, start a fresh conversation, resume earlier work and manage permissions. Type / in the input to see the commands available in your installation, or use /help.

Do not assume /add, /ls and /undo are standard Claude Code commands. Other coding assistants and custom plugins may use similar names. Check the official command reference and your local menu before copying a command from another tool's tutorial.

Quick command reference

CommandPurposeUse it when
/helpShow help and available commands.You need to confirm syntax.
/statusInspect version, model, account and connectivity information.You need to check the current setup.
/contextInspect context usage.You want to understand what is filling the context window.
/compactSummarize the conversation to free context.The task continues but the history is lengthy.
/clearStart a conversation with empty context.You are moving to an unrelated task.
/resumeChoose a previous conversation.You want to continue earlier work.
/rewindOpen checkpoint and conversation rewind options.You need to revisit a prior point.
/permissionsInspect and manage tool permissions.You need to control what the agent may do.
/modelOpen model selection.You want to change the model.
/usageInspect usage information.You need to understand consumption or limits.

Run commands individually at the start of the input. Availability and behavior can differ with version, account and interface; this table is a focused reference rather than a list of everything installed.

Provide file context with a clear request

You do not need a special “add every file” step before every task. Ask Claude to inspect the relevant paths using its available file tools:

Read src/auth.js and tests/auth.test.js. Explain how an expired
session is handled. Do not edit files. Identify any missing
context before proposing a fix.

Replace those example paths with files that exist in your project. If you do not know the location, ask Claude to find the relevant implementation first. Inspect the tool activity and cited file references rather than treating a claim of familiarity as proof that the file was read.

A directory listing shows files on disk; it is not a complete inventory of what the model has considered. Similarly, a context-usage display is not a guarantee that every relevant line is retained.

Choose /compact or /clear deliberately

Use compaction when continuing the same task. You can state what the summary needs to preserve:

/compact Preserve the caching requirements, decisions, changed files,
test results and unresolved failures.

Compaction reduces conversation context, not the size of source files on disk. Review the remaining task state afterward, especially if exact constraints or unfinished checks matter. The context-window guide explains related controls.

Use /clear for a new topic. It is not a command to delete project files or securely erase all stored history. Claude Code's session documentation explains that previous conversations can be resumed. Before clearing, preserve any task details you will need for the next conversation.

Understand what /rewind can restore

The checkpointing guide describes selecting a prior point with /rewind. Review the options carefully because restoring conversation context and restoring tracked file changes are different operations.

Do not expect rewind to undo every shell command or reverse actions in external systems. A database update, sent message or deployment needs its own recovery procedure. Keep version control and backups appropriate to the project.

Three practical workflows

Understand an unfamiliar repository

Read README.md and the project configuration. Summarize the
application's purpose, entry points and documented test commands.
Do not install packages or modify files.

Continue after a long investigation

Inspect /context, compact with a focused instruction if needed, then ask Claude to restate the next step and any unresolved uncertainty before making further changes.

Review before committing

Inspect the current Git diff. Identify likely regressions and
missing tests. Do not edit files, commit or push. Support each
finding with the affected file and an explanation.

This avoids relying on shell substitution inside an invented slash command. A shell command, an interactive Claude Code command and an ordinary-language request are distinct inputs.

Keep access and verification separate

Changing context does not grant permission to access a new service or run a consequential command. Review /permissions when needed, and check the actual diff and test results before accepting work.

For an editor-based workflow, see Claude Code in VS Code. For access and action boundaries, see using Claude Code safely.

Discussion

Reader Comments 0

Sign in with email or Google to join the discussion.