Skip to main content

Claude Code Tips and Tricks

Power user features and lesser-known capabilities.

Try It Live

Discover power user features

explain

Press Cmd/Ctrl + Enter to submit


Session Management

Resume Previous Conversations

claude --continue          # Resume last conversation
claude --resume # Same as --continue

Your context is preserved, so you can pick up exactly where you left off.

Check Running Tasks

/tasks

Shows all background tasks, their status, and IDs.

View Token Usage

/cost

See how many tokens you've used and estimated cost.

Compact Long Conversations

/compact

Summarizes and compresses the conversation while preserving important context. Useful for very long sessions.


Hidden Superpowers

1. I Can Read Images

"Look at the screenshot at ~/Desktop/error.png and help me debug"
"Review this wireframe image and suggest improvements"
"What does this diagram show?"

I'm multimodal - I can see and analyze images, screenshots, diagrams, and more.

claude

   ╭─────────────────────────────────╮
   │                                 │
   │   ██████╗██╗      █████╗ ██╗   │
   │  ██╔════╝██║     ██╔══██╗██║   │
   │  ██║     ██║     ███████║██║   │
   │  ██║     ██║     ██╔══██║██║   │
   │  ╚██████╗███████╗██║  ██║██║   │
   │   ╚═════╝╚══════╝╚═╝  ╚═╝╚═╝   │
   │                                 │
   │         claude code             │
   │                                 │
   ╰─────────────────────────────────╯

2. I Can Read PDFs

"Read the spec document at docs/api-spec.pdf"
"Summarize the PDF report"

I extract both text and visual content from PDFs.

3. I Can Read Jupyter Notebooks

"Review the data analysis in analysis.ipynb"
"What does the ML model notebook do?"

I see all cells, code, outputs, and visualizations.

4. I Can Run Commands in Background

"Start the dev server in the background"
"Run the full test suite in the background while we continue"

You can keep working while long-running commands execute.

5. I Can Search the Web

"Search for the latest Next.js 15 features"
"Find documentation for [obscure library]"
"What's the current best practice for X?"

I can find up-to-date information beyond my training data.


Efficient Exploration

Use Explore Agents for Codebase Understanding

"Use the Explore agent to map out the authentication system"
"Have an agent investigate how payments are processed"

Explore agents do deep-dives without cluttering your main conversation.

Pattern Searching

"Find all files that export a default class"
"Search for components using useState"
"Find functions longer than 50 lines"

Architecture Discovery

"What's the directory structure?"
"How are modules organized?"
"Show me the dependency graph"

Git Workflow Integration

Smart Commits

"Show me what changed, then create a well-formatted commit"

I'll:

  1. Analyze all staged and unstaged changes
  2. Look at recent commit messages for style
  3. Write a descriptive commit message
  4. Create the commit with proper attribution

Pull Request Creation

"Create a pull request for these changes"

I'll:

  1. Analyze all commits on the branch
  2. Write a comprehensive PR description
  3. Create the PR with gh cli

Code Review

"Review the changes in this PR"
"What could be improved in the last commit?"

Development Acceleration

Generate Boilerplate

"Create a new React component with TypeScript, tests, and stories"
"Generate a CRUD API for the Product model"
"Create a new Express router with error handling"

Instant Refactoring

"Convert all var declarations to const/let"
"Add TypeScript types to this JavaScript file"
"Convert callbacks to async/await"

Pattern Application

"Apply the same error handling pattern from UserService to ProductService"
"Make this component match the style of the other components"

Debugging Acceleration

Error Analysis

"Here's the error: [paste error]"
"Debug why this test is flaky"
"Find the root cause of this memory leak"

Tracing Issues

"Trace how data flows from the form to the database"
"Find where this value is getting mutated"
"What could cause this race condition?"

Fix Verification

"Fix the bug and add a test that would have caught it"
"Fix this and make sure we didn't break anything else"

Multi-File Operations

Bulk Updates

"Update all API endpoints to return consistent error formats"
"Add logging to all service methods"
"Update all imports from old path to new path"

Coordinated Changes

"Rename the User model to Account and update all references"
"Move authentication to a new module and update imports"

Testing Tricks

Test Generation

"Generate unit tests for this service"
"Add integration tests for the API endpoints"
"Create edge case tests for this function"

Test Debugging

"Why is this test failing?"
"Make this flaky test reliable"
"The test passes locally but fails in CI - help me debug"

Test Coverage

"What code paths aren't covered by tests?"
"Add tests for the uncovered branches"

Documentation Tricks

Auto-Documentation

"Add JSDoc to all exported functions in this file"
"Generate API documentation from the routes"
"Create a README explaining this module"

Documentation from Code

"Document the expected request/response format based on the types"
"What environment variables does this app need?"

Performance Tricks

Parallel Tool Execution

I automatically parallelize when possible, but you can be explicit:

"Read all three config files at once"
"Search for these five patterns in parallel"

Efficient Searching

Instead of browsing manually:

"Find files that match X and contain Y"

Scoped Operations

"Only look in the src directory"
"Search TypeScript files only"
"Ignore test files"

Context Optimization

Reference Earlier Work

"Using the same approach as before..."
"Apply that fix to the other files too"
"Continue implementing the feature we discussed"

Establish Conventions Early

In your CLAUDE.md or early in the conversation:

"We use Prettier for formatting, ESLint for linting,
Jest for tests, and we prefer functional components."

Then later I'll follow these automatically.

Checkpoint Complex Work

"Let's stop here and review before continuing"
"Summarize what we've done so far"
"What's left to implement?"

Safety Tips

Preview Before Apply

"Show me what you're going to change before doing it"
"Explain the approach first"

Incremental Verification

"After each change, run the tests"
"Build after modifications"
"Check for TypeScript errors frequently"

Backup Important Work

"Create a backup of this file before major changes"
"Let's commit the current state before refactoring"

Recovery Patterns

If Something Goes Wrong

"Undo the last change"
"Revert to the previous version"
"Show me git diff to see what changed"
"Reset this file to its original state"

If I Get Stuck

"Let's try a different approach"
"Start over with this task"
"What other options do we have?"

If Context Gets Lost

"Here's a summary of what we're working on: [context]"
"Let me re-explain the goal..."

Interactive: Commit Workflow

See how the /commit command works with pre-commit checks:

Commit Workflow
beginner
📁 my-app/
📄 ├── CLAUDE.md
📁 └── .claude/commands/
*Initialized. Found CLAUDE.md, 3 commands.*
>
💡Use /commit when you're ready to save your work. It runs checks first.

Interactive: Initialize a Project

Watch Claude generate a CLAUDE.md from your codebase:

Initialize Project
beginner
📁 new-project/
📁 ├── src/
📄 ├── package.json
📄 └── tsconfig.json
*Initialized. No CLAUDE.md found.*
>
💡The /init command scans your project and generates a starter CLAUDE.md.