Context rot commands, plus 10 more Claude commands
Hey, it's Cindy ๐ฑ Use this in under 30 seconds. Find the situation that matches your Claude Code session, then type the command.
btw the waitlist for AI System Club is now open! If you're keen on using AI to automate your content, video editing, job search, business or build AI agents, feel free to sign up (only if you want to hehe). Ps. the waitlist gets first dibs:)
pick one
What is happening right now?
I want to see what is using the context window/context Claude shows what is currently loaded and where the space is going.
I am continuing the same task/compact Focus on [next task] Claude compresses the session around the work that still matters.
I am switching to an unrelated task/clear Claude starts with a clean context instead of carrying old work into the new task.
I only have a side question/btw [question] Claude answers without adding the exchange to the main conversation history.
This investigation will read lots of filesUse a subagent to investigate... The large reads stay in the subagent's separate context and only its findings return.
The two-command version. Use /compact when you want continuity. Use /clear when you want a clean start. That solves most context problems.
copy and paste
The exact commands
Continue the same task
compact around the next job
/compact Focus the next context on [your next task]. Preserve the current goal, decisions already made, modified files, unresolved errors, test results, and the exact next action.
Start an unrelated task
start clean
/clear
Ask a side question without growing the session
keep the answer out of history
/btw [your side question]
Keep a large investigation out of the main context
delegate the heavy reading
Use a subagent to investigate [topic]. Keep the file reads and exploration inside the subagent's separate context. Return only the findings, exact source paths, unresolved questions, and the next decision I need to make.
optional one-time upgrade
Tell compaction what it must never lose
If you use Claude Code for long projects, add this short rule to your project-level CLAUDE.md. It gives compaction an explicit preservation list. This is optional, not another setup project.
add once to CLAUDE.md
When compacting, always preserve:
- the current goal and definition of done
- decisions already made and why
- every modified file
- unresolved errors or blockers
- commands and tests already run, with their results
- the exact next action
Keep CLAUDE.md lean
Keep only broad, non-obvious instructions that should apply in every session.
Move occasional knowledge and repeatable workflows into Skills so Claude loads them only when relevant.
For each line, ask: would removing this cause Claude to make a mistake? If not, cut it.
For a checked-in CLAUDE.md, run /doctor and review the cuts Claude proposes.
worth knowing
10 more Claude Code commands
These are the ones I actually use. All built in, nothing to install, and you type them straight into Claude Code.
๐งญ /init Sets up a CLAUDE.md for the project you're in, which is the file Claude reads every session. Run it once in any project you'll come back to.
๐ง /memory Opens your CLAUDE.md files to edit, and lets you turn auto memory on or off and see what it has saved.
๐ /plan Drops you into plan mode, so Claude works out the approach and shows you before it touches anything. Use it for anything you can't easily undo.
๐ /model Switches which model you're using and saves it as your default for new sessions.
๐ /autocompact Sets how full the context window gets before Claude compacts automatically. Useful if it keeps compacting in the middle of your work.
๐ /diff Shows every change in your working files, including everything Claude edited. Read this before you commit anything.
๐ /copy Copies Claude's last answer to your clipboard, so you don't have to select it by hand.
๐พ /export Saves the whole conversation as plain text. Good for keeping a build you'll want to repeat later.
๐ฟ /branch Branches the conversation from this point, so you can try a different direction without losing what you have.
๐ฉบ /doctor Runs a checkup on your setup, tells you what's broken, and can fix a lot of it for you.
๐ก Two more if you like working in the background./fork copies the conversation into a background session and leaves you working here, and /background detaches the session you're in so your terminal is free again.
๐ฑ Can't remember any of them? Type /help to see the full list inside Claude Code, and the official reference lives at code.claude.com/docs/en/commands.
Official Anthropic sources
Claude Code best practices, for managing context aggressively, using /clear, /compact, /btw, concise CLAUDE.md files, Skills, subagents and /doctor. Explore the context window, for /context, focused compaction and what survives compaction. Effective context engineering for AI agents, for compaction and just-in-time retrieval as Anthropic's broader context-management principles.
the waitlist is now open
AI System Club is launching soon
Build AI systems with me through recorded lessons you can follow at your own pace. Join the waitlist for first access and the founding price.
btw this list gets first dibs the moment doors open :)