Clear conversation history (CLAUDE.md reloads; stays in terminal)
Session Management
These commands help you manage context, pause/resume work, and keep sessions productive.
In-Session Commands
Command
Description
When to Use
/context
Visual grid showing what’s consuming your context window
Check before deciding to clear or compact
/cost
Show token usage for the current session
Monitor how much context you’ve used
/compact [focus]
Compress conversation, keeping key content
Mid-task but context is filling up — e.g., /compact focus on the bootstrap function
/clear
Wipe conversation history completely
Switching tasks — e.g., done planning, ready to implement
/rename <name>
Name the current session for later retrieval
Before pausing work — e.g., /rename sensitivity-analysis
/rewind
Open menu to undo to a specific point in conversation
Claude went in the wrong direction — roll back without losing code
CLI Flags (Starting Sessions)
Flag
Description
Example
claude -c
Resume the most recent session
Pick up after a break
claude -r "<name>"
Resume a specific named session
claude -r "sensitivity-analysis"
claude -r
Open interactive session picker
Browse and select from past sessions
claude --fork-session
Resume but branch into a new session ID
Try an alternative approach without affecting the original
When to Use What
Situation
Command
Context getting heavy, still working on same task
/compact
Done planning, ready to implement from a plan file
/clear
Stopping for the day, want to continue tomorrow
/rename → /exit → later: claude -c
Returning to a specific past session
claude -r "session-name"
Claude went off track, want to backtrack
/rewind
Want to try two approaches from the same starting point
claude --continue --fork-session
Authentication
Command
Description
claude login
Authenticate with Claude
claude logout
Sign out
claude auth status
Check authentication
Plugins
Command
Description
claude plugins list
List installed plugins
claude plugins install <name>
Install plugin
claude plugins uninstall <name>
Remove plugin
Keyboard Shortcuts
Shortcut
Action
Ctrl+C
Cancel current operation / Exit
↑ / ↓
Navigate command history
Tab
Autocomplete (if supported)
Ctrl+L
Clear screen
Common Prompts
Exploration
What is the structure of this project?
Explain the targets pipeline in _targets.R
What functions are in R/analysis.R?
Show me recent git commits
Modification
Add a function to R/utils.R that calculates the median
Update the simulation to use 1000 iterations
Fix the bug in calculate_statistics()
Refactor this function to be more readable
Running Code
Run the targets pipeline
Run tar_outdated() to check what needs updating
Execute the test suite
Run this R script
Git Operations
What's the git status?
Create a new branch called feature/bootstrap
Stage all R files
Commit with message "Add bootstrap CI"
Push to origin
Review and Quality
Review my changes for issues
Check for lab coding standard violations
Are there any hardcoded values that should be in globals.yml?
# Start session
claude
# Resume last session
claude -c
# Resume named session
claude -r "my-session"
# Explore
> What's in this project?
> Explain R/models.R
# Modify
> Add a bootstrap function to R/analysis.R
# Review
> /review
# Commit
> /commit
# Push
> Push to origin
# Check context usage
> /context
# Compress conversation
> /compact focus on the analysis function
# Fresh start (same terminal)
> /clear
# Name session before stopping
> /rename feature-name
# Undo last few messages
> /rewind