Skip to content

Basic Usage

This guide covers essential daily operations with Claude Code.

Starting and Stopping

# Start interactive mode
claude

# Run a one-off task
claude "fix the build error"

# Run a query and exit
claude -p "explain this function"

# Continue recent conversation
claude -c

Common Operations

Reading Code

> Explain this file
> What does the authenticate function do?
> Show me how errors are handled

Writing Code

> Add input validation to the form
> Create a new API endpoint for users
> Implement the feature described in issue #123

Debugging

> Why is this test failing?
> Find the bug causing the login error
> Analyze this error message: [paste error]

Refactoring

> Refactor this to use async/await
> Extract common logic into a utility function
> Simplify this complex condition

Working with Files

Claude can:

  • Read any file in your project
  • Create new files
  • Edit existing files
  • Delete files (with confirmation)

All modifications require your approval.

Slash Commands

CommandDescription
/helpShow available commands
/clearClear conversation history
/initInitialize CLAUDE.md for project
/permissionsView permission settings
/mcpManage MCP servers

Keyboard Shortcuts

ShortcutAction
EscapeInterrupt current operation
Ctrl+CExit Claude Code
TabAutocomplete file paths
↑ / ↓Navigate command history
Shift+TabToggle permission mode

Best Practices

  1. Start with exploration: Let Claude understand your codebase first
  2. Use /clear between tasks: Keep context focused
  3. Review changes carefully: Always verify before approving
  4. Use specific descriptions: More detail = better results