You keep using Claude Code as a chat window that edits files.
Stop treating it that way.
Get the guide today.
Updated 17 Nov 2026: added real /batch and /loop output and the two Windows failures I hit.
The best Claude Code commands are /clear, /compact, /context, /plan, /diff, /code-review, /usage, /model and /batch. They control context size, force a plan before edits, review what changed, track spend and fan work out in parallel. Everything else on the long list is situational. Skip it until you need it. I ran the risky ones myself on 16 and 17 November 2026, on a Windows laptop with no special setup, and two of them failed in ways that no page currently ranking for the best Claude Code commands warns you about.
I use Claude Code on Windows with Git Bash, and I tested every best Claude Code command in this guide on version 2.1.316. Where I couldn't test something, I say so.
Fact | Value |
|---|---|
Version tested | Claude Code 2.1.316, Windows 11, Git Bash |
Test dates | 16 and 17 Nov 2026 |
Fastest way to list commands |
|
Context reset |
|
Context shrink |
|
Cost view |
|
Parallel refactor |
|
Recurring check |
|
Here's the catch most lists skip. Several of these commands behave differently when you run them headless with claude -p. On Windows, the very first character of your command can get rewritten before Claude ever sees it, which turns a working command into a confusing question about a folder that doesn't exist. Fixing it takes one line. Finding it took me twenty minutes.
What are Claude Code commands, skills and MCP prompts?
Claude Code has three kinds of things you invoke with a slash. Built-in commands are coded into the CLI and do a fixed job, like /clear or /diff. Skills are markdown instructions that Claude follows, like /batch or /simplify. MCP prompts are templates a connected server exposes, and they show up in the same menu.
The official commands reference marks bundled skills with a "Skill" tag in its table and bundled workflows, such as /deep-research, with a "Workflow" tag. You type all of them the same way. The difference shows up when you want to change one. You can't edit /clear. You can edit a skill, because it's a file.
Claude Code command vs skill: which one do you need?
A command runs code. A skill hands Claude a prompt and lets it reason. If you want deterministic behavior, such as wiping context, you want a command. If you want judgment, such as reviewing a diff against your team's rules, you want a skill. Custom commands in .claude/commands/ still work, but the current docs point you to skills for anything new, since skills accept supporting files and frontmatter controls.
One detail trips people up. Some guides describe skills as something Claude picks on its own from natural language, and others treat them as slash-invoked. Both are true. A skill's frontmatter decides it: set disable-model-invocation: true and only you can trigger it.
How do I view all available Claude Code commands?
Type /help inside a session. It lists built-in commands plus any custom and MCP-provided ones. Type / alone and the menu filters as you type. /skills lists only skills, and in the docs' account you can press t to sort them by token cost. A few commands are hidden on purpose, like /heapdump, and only appear if you type the full name.
The docs table runs past 100 rows once aliases are counted, so a claude code commands list in one article can't be complete. Treat any list as a snapshot. This one too. Run /help on your own version before trusting a command name, because commands get removed. /vim and /pr-comments are gone in current builds, and /ultraplan was removed in favor of plan mode.
Claude Code commands cheat sheet: the best Claude Code commands in one table
This claude code commands cheat sheet covers the best Claude Code commands I'd teach a new teammate first, in the order I'd teach them. Syntax comes from the official table; <arg> is required and [arg] is optional.
Command | What it does | When I reach for it |
|---|---|---|
| New conversation, empty context | Switching tasks |
| Summarizes the conversation | Mid-task, context filling |
| Grid of context usage | Before deciding to compact |
| Enters plan mode | Anything touching 3+ files |
| Shows working-tree changes | Before every commit |
| Reviews diff, PR or path (alias | After a feature lands |
| Cleanup pass, not a bug hunt | After review |
| Rolls back conversation and/or code | When an edit went sideways |
| Side question, no history cost | Quick lookups mid-task |
| Cost, limits, stats | Weekly, and when a session feels slow |
| Switch model | Cheap model for chores |
| Toggle fast mode | Latency-sensitive work |
| Set reasoning effort | Hard bugs up, chores down |
| Parallel changes across the repo | Mechanical migrations |
| Repeats a prompt | Watching a deploy or CI |
| Allow, ask, deny rules | Setup, once |
| Creates a CLAUDE.md | New repo |
That table is the claude code commands cheat sheet worth pinning. If you search for a best Claude Code commands PDF, you'll find printable versions of the same thing, but they age fast. The official page is the one that tracks releases.
Best Claude Code commands for context management
Context is the budget everything else spends from. Run out and quality drops. These three of the best Claude Code commands decide how long a session stays useful, and each does a different job.
How do I clear or compact the context window in Claude Code?
Use /clear to start over with empty context, and /compact to keep going with a summary. /clear takes an optional name, so /clear auth-refactor labels the old conversation and you can return with /resume. /compact takes focus instructions: /compact focus on the database migration work tells the summary what to keep.
I measured a fresh session with /context on 16 November 2026. It reported 33.8k of 1m tokens used (3%). The breakdown: system prompt 4.7k, system tools 15.6k, skills 10k, messages 1.9k, autocompact buffer 33k, free space 933.2k. Skills alone cost 10k tokens before I typed anything. That's the number to watch if your session feels sluggish in week three of a project.
What is the difference between /compact and starting a fresh session?
/compact keeps a lossy summary of the same task. A fresh session, via /clear, keeps nothing except what's in CLAUDE.md and the files on disk. Compact when the task is the same and the history is long. Clear when the task changed. Compacting across unrelated tasks drags dead context along, and the summary quietly carries stale assumptions into the new work.
My rule: compact at a natural seam, like after a passing test run, and give it instructions. A bare /compact summarizes whatever it thinks mattered. Auto-compact will fire on its own if you never run it, and you can set the window with /autocompact.
My own /usage run listed "Start fresh when you switch tasks, run /clear" as the top suggestion for my last 24 hours, at 73%. The tool agrees with the rule.
Code review and planning: best Claude Code slash commands
Plan first, review after. That order catches more than any single command, and it's the habit I'd start with if you only adopt one.
/plan switches Claude into plan mode, where it proposes before it edits. Pass the task inline: /plan add rate limiting to the upload endpoint. Shift+Tab also cycles modes, but one guide reports it doesn't surface plan mode on some Windows builds, so /plan is the safer habit.
/diff shows the working tree, including Claude's own edits. Read it before you commit. I look for three things: stray imports, anything resembling a secret, and edits to files I never mentioned.
/code-review (alias /review) takes a level and a target: /code-review high 123 reviews PR 123 at high effort, and --fix applies the findings. /simplify is the follow-up. The docs are explicit that it's for cleanup, not correctness bugs, so run review for bugs first and simplify second.
Advanced workflow commands: /batch and /loop with real output
Neither official docs nor any top page shows what these print. Here's what they printed for me.
What does /batch actually do?
/batch researches your instruction, splits it into 5 to 30 units, shows a plan, then spawns one background subagent per unit, each in its own git worktree. It needs a git repository. I tested it in a throwaway repo with three one-line files and the instruction /batch rename the exported function in each src file to its uppercase name.
The first run, headless with default permissions, printed this table and then failed:
| # | Unit | Status | PR |
| 1 | src/a.js: a → A | failed (Edit/Write denied in worktree) | none |
| 2 | src/b.js: b → B | failed (Edit/Write denied in worktree) | none |
| 3 | src/c.js: c → C | failed (Edit/Write denied in worktree) | none |
0/3 units landed. Nothing in the repo was modified.
It took 1 minute 45 seconds. A non-interactive run has nobody to approve edits, so the permission system denies them. Rerunning with claude -p --permission-mode acceptEdits "/batch ..." finished in 1 minute 3 seconds with all three files renamed, uncommitted, status "done, none, no remote". Note that on the second run Claude skipped the worktree fan-out and edited directly, because it judged three tiny files not worth three agents. That's sensible, and it means /batch is for real migrations, not toy ones.
Fair warning: that test doesn't prove anything about large repos. Use /batch for mechanical, pattern-based changes like a Jest to Vitest move, and don't use it for redesigns.
What does /loop print?
/loop 5m check if the deploy finished scheduled a recurring job and printed:
Loop scheduled: job `865e3802`, cron `*/5 * * * *` (every 5 minutes), next fire Nov 17 2:25am.
Recurring jobs auto-expire after 7 days; cancel sooner with CronDelete using that ID.
Runs until you close this session. For durable cloud-based loops, use /schedule
Then it ran a first check immediately. My repo had no deploy to inspect, so Claude decided "deploy finished" meant two empty output files had become non-empty, and said so. The lesson: give /loop a concrete signal, such as a URL, a log path or a gh run ID. Vague prompts get an invented definition of done. If the loop must outlive your terminal, use /schedule instead.
Cost, usage and model control commands
/usage is the one to remember, because /cost and /stats are aliases of it. It shows plan limits and, in my run, a breakdown of what drove usage. Mine read: current session 100% used, current week (all models) 29%, and the last 24 hours at 313 requests across 41 sessions. It also named my top MCP servers by share of usage, which is how I learned one connector was eating 23%.
/usage runs immediately even while Claude is mid-response, as do /status and /tasks. Other commands sent during a response are queued.
/model sonnet switches and saves it as default, and pressing s in the picker switches for the session only. /fast on trades cost for speed. /effort status prints the current level; mine said "low", which explained why a hard bug got a shallow first answer. Raise effort for the hard problems and drop it for renames.
Best way to use Claude Code for programming: a one-session pipeline
The best way to use Claude Code for programming is a loop, not a single clever prompt. It's also the best way to use Claude AI for coding that I've found when a task spans many files. This is the sequence I run. Every step is one of the best Claude Code commands from above.
/clearso the session starts clean./plan <task>and read the plan before approving.Let it implement. Run
/diffat each seam./compact focus on <current task>when/contextshows the window past roughly half./code-review high, fix findings, then/simplify./usageto see what the session cost.
This is the claude code commands workflow in one list. The point is that each command guards a different failure: plan guards against wrong assumptions, diff against surprise edits, compact against drift, review against bugs. Skip a step and you'll meet the failure it prevents.
How to create custom Claude Code skills and commands
Yes. You can create custom commands in Claude Code, and the way to do it now is a skill. It's one file. Create it, run /reload-skills, and it appears as /your-name in the menu next to the built-ins, which is how I'd build your own best Claude Code custom commands.
Make a folder:
.claude/skills/fix-issue/for a project skill, or~/.claude/skills/fix-issue/for a personal one.Create
SKILL.mdinside it with frontmatter and instructions.Reference arguments with
$ARGUMENTS, or$0and$1for positional ones.Run it:
/fix-issue 123.
A minimal example:
---
name: fix-issue
description: Fix a GitHub issue following our standards
disable-model-invocation: true
allowed-tools: Bash(git *), Read, Edit
---
Fix issue #$ARGUMENTS. Read the issue, write a failing test first,
then make it pass. Show me the diff before committing.
Two frontmatter fields do most of the work. disable-model-invocation: true makes it manual-only, which is right for anything with side effects. allowed-tools pre-approves specific tools so you aren't prompted on every step. Shell output can be injected with the exclamation-backtick syntax, such as running git status inline, so the skill starts with live data.
Older command files in .claude/commands/name.md still work. If you have them, migrate gradually and don't rush.
Best Claude Code custom commands and template prompts
Good claude code template prompts are narrow and name their own exit condition. Three I actually use as skills: a handover skill that writes the current state to a markdown file before /clear, a fix-issue skill like the one above, and a pre-commit skill that runs the tests and prints the diff. The pattern for all of them is the same: one job, a stated stopping point, and a check at the end.
Claude Code commands best practices
Claude Code slash commands best practices come down to six habits, and the best Claude Code commands only pay off if you follow them.
Name your sessions.
/clear nameand/renamemake/resumeusable.Keep CLAUDE.md short. It loads every session, so every line costs tokens every time.
Prefer
/compactwith instructions over bare/compact.Put side effects behind
disable-model-invocation: true.Run
/skill-doctoroccasionally. It shows each skill's context cost and usage frequency.Re-check command names after upgrades. Several I've seen recommended no longer exist.
These also answer the common search for how to set up claude code workflow: start with /init, trim the generated CLAUDE.md, add two or three skills for your repeated chores, and set permissions once.
How can I safely configure permissions so Claude Code doesn't delete files?
Use /permissions to set deny rules, and keep the default behavior of asking before actions. Rules look like Bash(git *) to allow, and Read(./.env) to deny, and they live in .claude/settings.json, with personal overrides in settings.local.json. Deny reading secrets, deny destructive shell patterns you never want, and review /diff before committing.
Avoid --dangerously-skip-permissions outside a disposable container. The safer middle ground is --permission-mode acceptEdits, which my /batch test needed, since it lets edits through while still gating other actions. Git is your real safety net: commit before big runs, and use /rewind to roll back.
Troubleshooting Claude Code commands
This table is the part no top page has. The first two rows come from my own runs.
Symptom | Cause | Fix |
|---|---|---|
| Git Bash rewrites the leading |
|
| Same path rewrite; Claude saw mangled text | Same fix, then rerun |
| Headless run, nobody to approve edits | Add |
| Prompt had no concrete signal | Name a URL, log path or run ID |
A command "doesn't exist" | Removed or renamed in your version |
|
Slash command typed mid-sentence does nothing | Commands only register at message start | Put the command first |
Command sent mid-response seems ignored | It was queued until the response ended | Wait, or use |
Why is my Claude Code command hanging and not responding?
First rule out slow, not stuck. In my tests a trivial headless command took 14 to 18 seconds, /loop took 45 seconds, and /batch took over a minute. Check /tasks for background work still running. Press Esc to stop generation. If a headless script stalls, wrap it in timeout 120 claude -p ... so it can't wait forever on a prompt nobody will answer. I did not reproduce a true hang, so treat this as a checklist, not a diagnosis.
What is the best command to let Claude Code automatically fix failing tests?
There's no single built-in for it. The best approach is a short skill, or one plain prompt: "Run the test suite, fix failures one at a time, rerun after each fix, stop when green." Combine it with /plan for risky changes and /diff afterward. If you use GitHub, /autofix-pr starts a cloud session that watches your branch's PR and pushes fixes, and it needs the gh CLI.
How do I refactor a large file without breaking my code?
Plan, split, test, review. Run /plan refactor payments.py into modules, no behavior change. Make sure tests pass first, because a refactor without tests is a guess. Let Claude move one function group at a time, run tests after each move, and check /diff for accidental behavior changes. Finish with /code-review and /simplify. If a step goes wrong, /rewind restores the code to an earlier checkpoint.
Best Claude Code commands for Python and backend developers
Python developers get the most from the same general commands, plus a few habits. Keep your virtualenv and test command in CLAUDE.md so Claude runs pytest -x instead of guessing. Use /plan before touching models or migrations. Use /batch for mechanical changes such as adding type hints across modules or swapping a library. Use /code-review on database and auth code, and /security-review before shipping, which scans branch changes against the default branch and needs an origin remote. I didn't run a Python-specific test suite for this guide, so these are practices, not measurements.
What is Claude Code and how do I start using it?
Claude Code is Anthropic's coding agent that runs in your terminal, reads your project and edits files with your approval. Install it with npm (npm install -g @anthropic-ai/claude-code, which needs Node.js 18 or newer per one April 2026 guide), then run claude inside a project folder and sign in. Run /init to create a CLAUDE.md. Check the official install page, because install methods change.
What are the most essential Claude Code commands for a beginner?
Learn these seven first. They're the best Claude Code commands for a beginner: /help, /init, /clear, /compact, /plan, /diff and /usage. They cover orientation, setup, context, planning, review and cost. Add /model and /permissions in week two. Everything else on the claude code commands list can wait until you hit the problem it solves.
Is Claude Code free, and how does it compare to GitHub Copilot CLI?
Claude Code isn't free to use in the way a plain open-source CLI is. It runs against a paid Claude plan or an API key. One April 2026 guide lists Pro at $20, Max 5x at $100 and Max 20x at $200 a month, but prices change, so check Anthropic's pricing page before you decide. My own /usage output shows weekly limits per plan, so a plan caps how much you can run.
For Copilot CLI, I haven't tested it, so I won't claim feature parity either way. The difference I can speak to is workflow: Claude Code puts planning, context control and parallel work behind slash commands you can inspect and extend with skills. Compare both on a real task in your own repo before paying for either.
Best Claude Code commands on Reddit and GitHub
If you search for the best Claude Code commands on Reddit or GitHub, expect ideas, not gospel. Reddit threads and GitHub repos are good for custom prompts and skill files, and poor for current syntax. People post their own command files and workflows, and some of those are genuinely clever, though almost none say which version they were written for. They're often written against an older version. Copy the idea, then verify the command name with /help on yours. Treat a command from a three-month-old thread as a hint, not a fact.
Verdict: what I'd keep and what I'd skip
My verdict on the best Claude Code commands is short. I'd keep /clear, /compact, /plan, /diff and /usage for every session. I'd keep /batch for migrations only, since in my test it correctly declined to fan out three tiny files. I'd skip memorizing the rare commands, because the list changes with each release and /help is always current. The strongest counterpoint is that a long list teaches you the tool's shape. True, but the shape is learnable in an hour, and the Windows path bug cost me longer than that.
