Use /cost to Track Token Spending
Check how many tokens you've used and how much the current session has cost — without leaving Claude Code.
/cost Practical tips and tricks to get more from Claude Code.
Check how many tokens you've used and how much the current session has cost — without leaving Claude Code.
/cost Wipe the conversation history and get a clean context without killing the Claude Code process.
/clear Stop Claude immediately when it's going in the wrong direction — before it wastes tokens on output you don't need.
Escape Let Claude Code scan your project and auto-generate a CLAUDE.md file instead of writing one from scratch.
/init Skip interactive mode and send a prompt directly from the command line using the -p flag.
claude -p "explain this error" < error.log Send command output directly into Claude via stdin — no copy-paste needed.
npm test 2>&1 | claude -p "explain failures" Ask Claude to plan before coding when a task spans multiple files or steps.
plan before you code Choose which Claude model to use at startup — match the model to the task and save money on routine work.
claude --model sonnet The optimal CLAUDE.md structure that gives Claude Code maximum project understanding
# Project Overview
# Tech Stack
# Architecture
# Conventions
# Common Commands
# Known Issues
Free up context window space by compressing your conversation history
/compact Skip AI interpretation and execute shell commands instantly by prefixing with !
! npm test