← All posts

✨ Claude Power User Guide

A bag of CLI commands and keyboard shortcuts that I use when working with claude.

🛠️ Claude Code (CLI) commands

/init — Initialize project

Sets up the environment and creates / reads a CLAUDE.md file so Claude understands your specific repo structure, tech stack, and coding standards.

/resume — Resume session

Instantly restores the context of your last terminal conversation so you can pick up exactly where you left off without re-explaining the task.

/compact — Optimize context

Compresses the conversation history. Vital for long sessions to save on token costs and keep Claude's reasoning sharp and focused.

/btw — Context switch

Lets you interrupt a long-running task to ask a quick side question without losing the progress or context of your primary coding work.

/plan — Strategy mode

Forces Claude to write a detailed technical blueprint for approval before it starts generating any actual code changes, ensuring alignment on the approach.

/rewind — Undo changes

Reverts both the code edits and the chat history to a previous checkpoint if a particular refactor or logic path doesn't go as planned.

⌨️ Terminal keyboard shortcuts

Many of the shortcuts in Claude Code are identical to standard Linux terminal commands.

ShortcutActionWhat it does
Navigate historyCycle through previous prompts and commands to reuse or edit them, just like a standard terminal.
Ctrl + CCancel / interruptInstantly stops Claude in the middle of generating a long response or running a task.
Ctrl + DExit sessionThe standard way to safely exit the Claude CLI and return to your normal terminal prompt.
Ctrl + RSearch historyReverse-search through your previous prompts and commands within the session, just like Bash or Zsh.
Shift + TabPermission toggleCycle through permission modes — e.g. from "ask for every edit" to "auto-approve edits" for faster workflows.
Shift + EnterNew lineInsert a newline in your prompt without submitting. Useful for multi-line instructions or pasting code blocks.
Esc + EscQuick rewindOpen the rewind menu and jump back to a previous "clean" state of the conversation.

💻 CLI features

! [command] — Direct shell execution

Prefix any command with an exclamation mark (e.g. !ls -la) to run a shell command directly within the Claude session without exiting.

@ [file] — File attachment and autocomplete

Type @ followed by a filename to quickly reference or "attach" a specific file to your prompt so Claude focuses its attention there.

🧠 Claude memory

Claude uses a two-part system to remember project details and coding preferences across sessions.

1. CLAUDE.md — hierarchical instructions

A manual "source of truth" file placed in your project root. It's meant to be committed to Git so the entire team shares the same context. It follows a three-level hierarchy:

  • User level~/.claude/CLAUDE.md — your global personal preferences.
  • Project level./CLAUDE.md — shared team standards and tech stack.
  • Local levelCLAUDE.local.md — personal project-specific overrides, ignored via .gitignore.

2. Auto-memory — local learning

Claude automatically tracks learned patterns (like working build commands or specific bug fixes) without manual input.

  • Storage~/.claude/projects/[project-path]/memory/
  • Usage — Claude reads these logs at the start of each session to stay up to speed.
  • Control — since these are just Markdown files, you can manually edit or delete them if Claude "remembers" something incorrectly.

💡 Pro tip

If you want Claude to remember something specific, explicitly tell him — he will add it to his auto-memory for future sessions.

You can inspect the files in ~/.claude/projects/[project-path]/memory/ yourself. If something looks wrong, you can either edit the files manually or ask Claude to modify his memory directly.