daBongo LMS AI Training Courses

Claude Power User – Hacks, Shortcuts, and Hidden Features

Lesson 3: Claude Code Hacks – Commands, Flags, and Shortcuts

Lesson Objectives

By the end of this lesson, students should be able to:

  • Use the key Claude Code slash commands for session and memory management
  • Apply keyboard shortcuts that control Code mode behavior
  • Explain and use CLI flags for non-interactive and scripted use
  • Use file references, plan mode, and context management techniques
  • Know when to use parallel sub-agents for complex multi-step tasks

Lesson Content

Claude Code has a command vocabulary most users never discover.

The Claude Code interface accepts typed messages, but it also responds to slash commands, keyboard shortcuts, and – when used from the terminal – CLI flags that give you fine-grained control over how it operates.

Slash commands – the in-session control panel.

  • /help – Lists all available commands and current tools. The fastest way to see what is available in your version.
  • /clear – Clears conversation context entirely. Use when a session has accumulated so much context that Claude is losing track of the current task.
  • /compact – Compresses conversation history into a summary to free up context space while maintaining continuity. Use for long sessions where you want to continue without clearing.
  • /cost – Shows token usage and estimated cost for the current session. Useful for managing context and understanding spend.
  • /memory – Opens your memory files for viewing and editing directly within the session.
  • /init – Generates a CLAUDE.md file for the current directory by analyzing the project structure. The starting point for persistent project context.
  • /doctor – Runs a diagnostic check on your Claude Code configuration.
  • /review – Triggers an automatic code review of recent changes in the current working directory.

Keyboard shortcuts.

  • Shift + Tab – Toggles between Plan Mode (Claude describes everything it intends to do before acting) and Auto-Accept Mode (Claude executes approved action types automatically).
  • Escape – Cancels the current operation immediately.
  • Ctrl + C (terminal) – Force-terminates a Claude Code session.

The # prefix – silent context injection.

Typing a message starting with # adds that content to Claude's context without triggering a response. Useful for providing background, correcting misunderstandings, or setting up context for future messages without interrupting workflow. Example: # This project uses Python 3.11 and we never modify files in the /archive directory

@ file references.

Typing @filename prompts Claude to read that specific file and include it in context without copy-pasting. Reference multiple files in a single message.

CLI flags – for terminal and scripted use.

  • --continue – Resumes the most recent conversation session with full prior context.
  • --resume [session-id] – Resumes a specific past session by ID.
  • --print – Non-interactive mode. Claude produces its response and exits. For scripted workflows and piping Claude output into other tools.
  • --model [model-id] – Specifies which Claude model to use.
  • --output-format [format] – Specifies output format for non-interactive use: plain text, JSON, or streaming JSON.

Piping content to Claude Code.

From the terminal: cat report.txt | claude --print "summarize this in three bullet points" passes file content directly without an interactive session. Enables integration with shell scripts and automated workflows.

Plan mode in depth.

In plan mode (Shift+Tab), Claude analyzes the task, lists every intended action, and waits for approval before executing any of them. The plan is editable – skip steps, add steps, or change the order before executing. For users new to Code mode, or for any task involving important files, always start in plan mode.

Parallel sub-agents.

For large multi-step tasks with parallelizable components, Claude Code can spawn multiple sub-agents working simultaneously, then merge results. Example: "Use parallel agents to review the documentation, tests, and core logic simultaneously and report back." Significantly reduces completion time for large tasks.

.claudeignore

Create a .claudeignore file following .gitignore syntax to exclude specific files and directories from Claude Code's access. Use proactively to exclude sensitive files, large binary assets, or irrelevant directories.

Practical Example

A developer refactoring a large module: presses Shift+Tab for Plan Mode, uses @authentication.py and @tests/test_auth.py to pull relevant files into context, types /compact mid-session when conversation grows long, closes for the day, resumes the next morning with --continue, and checks /cost at the end.

Eight Code mode features in a single productive session.

Lesser-Known Tip

Keep a personal CLAUDE.md template you can drop into any new project directory and customize in five minutes. A good template includes: project description, tech stack, file structure overview, conventions, and common commands. Store it somewhere easy to find – never start a Code session in a new project from zero context.

Safety Notes

Auto-Accept Mode (Shift+Tab) allows Claude to execute approved action types without per-action confirmation. Enable it only for well-understood, low-risk operations in a known environment – not for first sessions in a new codebase or operations affecting production systems. Use .claudeignore proactively to exclude sensitive directories rather than reactively after unintended access.

Practice Task

Open Claude Code mode and try in sequence: (1) type /help and read the full command list, (2) type a message starting with # to add silent context, (3) press Shift+Tab and observe the mode change, (4) type /cost after a few exchanges, (5) type /memory to see your current memory file contents.

Completion Check

You should be able to use all slash commands covered, explain what the # prefix does, describe the difference between Plan Mode and Auto-Accept Mode, know when to use CLI flags, and explain what .claudeignore does.

Log in and enroll to access lesson quizzes.

Scroll to Top