7 Claude Code Features You Should Actually Know

Claude Code stops feeling like a tool and starts feeling like an operating system once you learn these seven commands. A few are built-in. Several are user-level slash commands you add once and reuse forever. Together they change how you work in the terminal.
| # | Command | What it does |
|---|---|---|
| 1 | /init | Auto-generates CLAUDE.md, your repo's living briefing |
| 2 | /compact | Compresses long conversation context without losing the thread |
| 3 | /btw | Ask a side question mid-task without derailing the main one |
| 4 | /insights | Surface your own usage analytics: tokens, costs, cadence |
| 5 | /loop | Run checks continuously until a condition is met |
| 6 | /schedule | Persistent background tasks that fire on a cron |
| 7 | /buddy | Your AI companion in the terminal for open-ended pairing |
Below: what each one does, how to set it up, and why it matters.
1. /init, auto-generate CLAUDE.md
What
/init walks the current repo and writes a CLAUDE.md file at the root: a concise summary of the stack, entry points, scripts, conventions, and anything Claude should know before touching the code.
Why
CLAUDE.md is the single highest-leverage optimization for Claude Code. It's loaded into context every session. Without one, Claude re-discovers your stack every run. With one, Claude walks in already oriented.
How
cd ~/code/your-repo
claude
> /init
Claude reads your package.json, pyproject.toml, README.md, directory structure, and produces something like:
# Project: invoice-reconciler
Stack: Python 3.12, FastAPI, Polars, DuckDB
Entry points: src/main.py (CLI), src/api/routes.py (API)
Tests: pytest -q
Data fixtures: ./fixtures/*.csv — use for any new logic
Do NOT modify: src/legacy/* (being deprecated)
Edit it. Commit it. Claude reads it every session.
2. /compact, compress long context
What
/compact summarizes the current conversation into a condensed form so you can keep going without hitting the context ceiling. It preserves the thread (decisions, intermediate results, open questions) while dropping redundant back-and-forth.
Why
Long sessions hit context limits eventually. Two bad options: (a) start a new chat and lose everything, (b) keep going and watch quality degrade as old messages get truncated. /compact is the third option: deliberate compression that preserves what matters.
How
> /compact
Use it:
- After a long debugging back-and-forth, before moving to the next task
- Before starting a big new feature, compress what came before
- When Claude starts "forgetting" earlier context, it's a warning sign
Pro tip: compaction is lossy. After /compact, ask Claude to confirm the top 5 things it remembers. If something important is missing, paste it back before continuing.
3. /btw, ask a side question mid-task
What
/btw lets you ask Claude an unrelated side question without polluting the current task's context. Claude answers, and then returns to the main thread as if nothing happened.
Why
Anyone who's used a long-running agent session knows the pain of "actually, quick question: how does X work?" derailing a 45-minute coding thread. /btw is the escape hatch. Ask. Get the answer. Continue where you were.
How
User slash command at ~/.claude/commands/btw.md:
Context-isolated side question. Answer the user's question using a minimal fresh context.
After answering, explicitly state: "Back to the main task: <one-line reminder of what we were doing>."
Do not modify the main task state.
User's side question: $ARGUMENTS
Usage:
> /btw what's the difference between bash `$@` and `$*`?
Claude answers the question, reminds you what you were doing, and the main task state stays intact.
4. /insights, your own usage analytics
What
/insights surfaces your Claude Code usage: tokens in/out per session, estimated cost, average turn length, which tools you use most, which days you code on.
Why
You can't optimize what you can't see. Most Claude Code users have no idea they spent 4x as many tokens as necessary last week because they skipped /compact. /insights makes the invisible visible.
How
User slash command at ~/.claude/commands/insights.md:
Read the Claude Code session logs at ~/.claude/projects/**/*.jsonl for the last 7 days.
Summarize:
1. Total tokens in / out
2. Estimated cost (use current Anthropic pricing)
3. Sessions count, average turn count per session
4. Most-used tools
5. Days of the week I worked most
6. Top 3 projects by token volume
Report as a clean markdown table. No fluff.
Run it weekly:
> /insights
Then decide: should I be using /compact more? Should I batch similar questions? Should I switch some tasks to Haiku instead of Opus?
5. /loop, run checks continuously
What
/loop runs a task repeatedly, either on a fixed interval or until a condition is met. Useful for watching builds, polling for state, or repeatedly verifying something is fixed.
Why
Half the time you'd write while true; do ... sleep 10; done in bash, you actually want an intelligent loop that can reason about the output, not just grep it. /loop gives you that.
How
Claude Code has a built-in /loop primitive. Two modes:
Interval loop:
> /loop every 60s check if the deploy to staging completes; notify me when done
Condition loop (dynamic pacing):
> /loop until the prod dashboard shows the p95 latency below 200ms; check every 5 min
Claude picks intelligent wait times, re-evaluates state each tick, and stops as soon as the condition is met (or you interrupt).
For power users: combine with MCP servers. /loop until the Sentry issue count for release v2.1.0 is zero, check every 10 minutes, paired with a Sentry MCP server, is real on-call automation.
6. /schedule, persistent background tasks
What
/schedule sets up a recurring task that Claude runs on a cron schedule, even when your terminal is closed. Daily summaries, weekly reports, nightly code audits.
Why
Agents are only useful if they run when you're not watching. Everything becomes possible once you can say "every morning at 8am, read my Sentry dashboard and Slack me a digest of anything that spiked overnight."
How
Using Claude Code's scheduled-tasks MCP server:
> /schedule daily at 8am:
> Read my Linear "INGEST" project,
> summarize any issues that changed status yesterday,
> post to Slack #engineering
Or via YAML in ~/.claude/schedules/:
- name: morning-digest
cron: "0 8 * * *"
prompt: |
Pull open PRs across anthropics/* on GitHub.
Summarize which have failing CI and are older than 48 hours.
Send to Slack #engineering.
List scheduled tasks:
> /schedule list
Cancel one:
> /schedule cancel morning-digest
7. /buddy, AI companion in the terminal
What
/buddy is the open-ended "let's just talk about this" mode. Less task-driven, more pairing. Ask questions. Think out loud. Explore.
Why
Not everything is a task with a clear deliverable. Sometimes you need to think through a decision, process a frustration, or sanity-check an architectural choice without committing to any action. /buddy is the mode for that.
How
User slash command at ~/.claude/commands/buddy.md:
You are my thinking partner, not my executor. For this turn:
- Do NOT run any tools unless I explicitly ask
- Do NOT propose edits
- Ask me clarifying questions
- Help me think through the problem from multiple angles
- It's fine to disagree with me
Topic: $ARGUMENTS
Usage:
> /buddy should I migrate to React Server Components this quarter,
> or hold off another 6 months?
Claude responds with questions, tradeoffs, scenarios. Not a checklist.
Why these seven change the game
Any one of these is useful. All seven together is a pattern shift:
/initgives Claude a durable brief of your repo./compactkeeps long sessions productive./btwlets you multitask without chaos./insightsmakes your own usage visible./loopturns Claude into a watcher./scheduleturns Claude into a scheduler./buddyturns Claude into a thinking partner.
Individually they're features. Together they're an operating model: Claude as a system you live inside, not a tool you alt-tab into.
How to set them up once
For the user-level slash commands (/btw, /insights, /buddy, and any others you want), drop a markdown file into ~/.claude/commands/:
mkdir -p ~/.claude/commands
# create the .md files as shown above
ls ~/.claude/commands/
# btw.md insights.md buddy.md
Claude Code picks them up automatically. Commit the folder to your dotfiles repo and they follow you to every machine.
For /init, /compact, /loop, /schedule, those are built in. Nothing to install.
One rule
Don't install commands you won't use. Every custom command adds to the list Claude scans when deciding what to do. Keep your ~/.claude/commands/ focused. Six to ten commands that you actually use beats thirty you installed once and forgot.
Start with these seven. Add only when you feel the gap.