Claude Code can be used both from inside an interactive Claude Code session and directly from the Linux shell. In this article we show you the most useful commands when working with Claude Code.
Start or continue a session
Start Claude Code in the current directory:
claudeStart Claude Code with an initial prompt:
claude "explain this project"Continue the most recent conversation in the current directory:
claude -cResume a specific named session:
claude -r "auth-refactor"
Run Claude Code non-interactively
Use -p if you want Claude Code to answer once and then exit. This is useful for checking logs, explaining files, or using Claude Code in scripts:
claude -p "summarize the current git diff"You can also pipe content into Claude Code:
cat logs.txt | claude -p "explain the error and suggest a fix"
Useful commands inside Claude Code
The following commands are entered inside an active Claude Code session:
/helpShows the available commands.
/initCreates a starter CLAUDE.md file for the current project. This file can describe the project, commands, coding style, test instructions, and anything else Claude Code should remember for this repository.
/permissionsOpens the permissions overview, where you can review or change which actions Claude Code may perform without asking.
/plan fix the login bugStarts plan mode for a larger change. This is useful when you want Claude Code to first propose an approach before editing files.
/diffShows the changes Claude Code has made so you can review them before committing.
/compactSummarizes the current conversation to free up context while keeping the important details.
/clearStarts a fresh conversation. Use this when you switch to an unrelated task.
/resumeOpens the session picker so you can continue an earlier conversation.
/rewindRewinds the conversation and, when possible, related code changes to an earlier checkpoint.
/reviewReviews a pull request or the current branch.
/security-reviewReviews pending changes for security risks such as injection issues, authentication problems, or accidental data exposure.
/usageShows usage, costs, and plan-limit information for the current session.
/statusShows the current Claude Code version, selected model, account status, and connectivity details.
Install Claude Code plugins and skills
Claude Code uses plugins to add extra functionality such as skills, agents, hooks, MCP servers, and language-server integrations. This is the Claude Code equivalent of installing extra agent capabilities.
Open the plugin manager:
/pluginInstall a plugin from a configured marketplace:
/plugin install plugin-name@marketplace-nameFor example, install Anthropic's GitHub plugin from the official marketplace:
/plugin install github@claude-plugins-officialAdd a marketplace from GitHub:
/plugin marketplace add owner/repositoryList configured marketplaces:
/plugin marketplace listUpdate a marketplace:
/plugin marketplace update marketplace-nameDisable, enable, or remove an installed plugin:
/plugin disable plugin-name@marketplace-name
/plugin enable plugin-name@marketplace-name
/plugin uninstall plugin-name@marketplace-nameReload plugins after installing, enabling, or disabling them:
/reload-pluginsView the skills available to Claude Code:
/skills- Only install plugins and marketplaces from sources you trust. Plugins can add powerful functionality, but they may also include files, commands, MCP servers, or other code that runs with your user permissions.
- For team projects, consider using project scope for shared plugins so collaborators get the same setup. From the shell, this can be done with a command such as
claude plugin install formatter@your-org --scope project.
Update, authenticate, and troubleshoot
Check the installed version:
claude --versionUpdate Claude Code:
claude updateCheck login status:
claude auth status --textLog in again:
claude auth loginLog out:
claude auth logoutDiagnose installation or runtime issues from inside Claude Code:
/doctorEnable debug logging when starting Claude Code:
claude --debugWrite debug logs to a specific file:
claude --debug-file /tmp/claude-debug.log