◆ Winter saleAll 3 kits for $29 instead of $49.See the offer →
← All posts

Claude Code commands: what writing 30 of them taught me

By Wajahat Karim · December 5, 2026 · 7 min read

Claude Code commands: a command file kit-run-app.md with the rule 'Run Gradle in the background. Never kill it.', a sticky note about a 47 minute frozen build, and the /kit- command menuBuild a mobile app with AI. 0 to store review in 5 hours.$29 →

The first time I let Claude Code run a fresh Android build, my terminal froze for 47 minutes. I restarted my Wi-Fi router twice. It wasn't the internet.

Short answer: Claude Code commands start with a / at the beginning of your message. Built-in ones control the session, like /clear, /compact and /model. Custom ones are your own prompts saved as Markdown files in .claude/commands/, so run-app.md becomes /run-app. Type / to see them all. Anything after the name goes into $ARGUMENTS.

Claude Code had killed Gradle at its 2 minute shell timeout, in the middle of a 1 GB download. The killed build left lock files in ~/.gradle. The next build waited for them forever.

That frozen cursor became the first rule in my first command. Today NowKit has 30 /kit-* commands, and every build command in them runs Gradle in the background and checks on it.

Here's what I learned writing all of them.

What are Claude Code commands?

Claude Code commands are shortcuts you type with a / at the start of a message. Built-in ones switch models, clear context or rewind. Custom ones run a prompt you saved as a file. Type / in a session to see every one available to you.

Two details from Anthropic's commands reference that I wish I knew earlier:

  • A command only works at the start of your message. Text after the name becomes its arguments.
  • If you send one while Claude is still answering, it waits in a queue and runs after the current turn. Dialogs like /help and /theme open right away.

So /compact keep the paywall decisions is one command with an instruction, not a chat message.

Which built-in Claude Code commands do I actually use?

These ten cover most days. /init once per project, /clear between tasks, /compact and /context in long sessions. /rewind when Claude goes the wrong way, /usage to watch your plan.

CommandWhat it does (as of December 2026)When it helps
/initWrites a CLAUDE.md guide for the projectOnce, on a new project, then I cut it down
/clearStarts a new conversation with empty contextBetween two unrelated tasks
/compactSummarizes the conversation to free up contextHalfway through a long build session
/contextShows what is filling the context windowWhen Claude starts forgetting my rules
/modelSwitches the model and saves it as defaultBigger model for planning, smaller for edits
/rewindGoes back to an earlier point in chat and codeWhen an edit went the wrong way
/resumeOpens an earlier conversationNext morning, to continue yesterday's work
/memoryEdits your CLAUDE.md filesWhen I add a rule I keep repeating
/permissionsManages allow, ask and deny rules for toolsTo stop approving ./gradlew every time
/usageShows session cost and plan usage limitsBefore a long run, so I don't hit a limit

The descriptions come from the same commands reference. /cost is an alias for /usage now, so older tutorials still work.

Here's the catch with long sessions: the context fills up, and the rules from the first hour get squeezed. A fresh /clear for each new task keeps them sharp.

How do you create a custom slash command in Claude Code?

Make a Markdown file in .claude/commands/ inside your project. The file name becomes the command, so .claude/commands/compile-check.md becomes /compile-check. Write the prompt in the file, add a description at the top, and commit the folder so everyone who clones the project gets it.

Here's a small one from a mobile project. It checks one module compiles and explains the first error:

---
description: Compile one Gradle module and explain the first error
argument-hint: [module]
---

## Current changes
!`git status --short`

1. Run `./gradlew :$0:compileDebugKotlin` in the background. Check the output every 30 seconds. Never kill it.
2. If it fails, show me the first `e:` line only and explain it in one sentence.
3. Fix that one error and compile again. Stop after 3 tries and tell me what's left.

Type /compile-check app and $0 becomes app.

How a Claude Code custom command works in four steps: save a Markdown file in .claude/commands, type /compile-check app, the arguments fill $0 and the !git status line runs first, then Claude follows the numbered steps

The !`git status --short` line is the part most people miss. Per Anthropic's skills docs, it runs before the prompt is sent, and its output replaces the line. So Claude gets the real data, not a request to go fetch it.

Want the command in every project on your machine? The personal place is ~/.claude/skills/<name>/SKILL.md.

How do arguments work in Claude Code commands?

$ARGUMENTS gets everything you type after the command name. $0, $1 and so on get one value each, counting from zero. Wrap a value with spaces in quotes, so it stays one argument.

So /rename-screen "Settings Screen" Profile gives $0 = Settings Screen and $1 = Profile.

If your file has no placeholder at all, Claude Code adds your text at the end as ARGUMENTS: <value>. Nothing gets lost.

The frontmatter fields I use most:

  • description: what the command does. Claude reads it to decide when the command fits.
  • argument-hint: the hint shown while you type, like [module].
  • allowed-tools: tools Claude can use without asking, during that command's turn.
  • disable-model-invocation: true: Claude never runs it on its own, only when you type it.

Put the last one on anything that publishes, signs or deletes. Trust me, you don't want a release command running because Claude thought it was a good idea.

Are Claude Code slash commands and skills the same now?

Mostly, yes. Anthropic merged custom commands into skills. Your .claude/commands/ files keep working, and Claude can use them without you typing the name. A skill lives in its own folder with a SKILL.md, so it can also carry extra files like templates or scripts.

What that means in practice:

  • Old command files: keep them. Nothing breaks.
  • New work: Anthropic suggests a skill, because of the extra files.
  • Same name in both places: the skill wins over the command file.
  • Same skill in two places: personal beats project, per the skills docs.

My kits still ship command files for Claude Code. They work, and the same text renders for the other agents.

What did writing 30 Claude Code commands teach me?

Five rules, each one from something that broke. Long jobs run in the background. Every command is safe to run twice. Long ones can stop and pick up later. Big commands call small ones. And one source feeds every agent.

  1. Long jobs go in the background. That 47 minute freeze is why every build step polls instead of waiting in the foreground.
  2. Safe to run again. Every command checks what's already set and offers to keep, change or redo it.
  3. Stop and resume. Long ones can be picked up later, even in a new chat.
  4. Big commands call small ones. /kit-publish-to-play runs the listing, screenshot and legal commands for you.
  5. One source, five agents. Claude Code, Cursor, Codex, Antigravity and OpenCode each get their own copy.

Rule 5 has its own story. On Nov 29, I built a subscription tracker called Suby live, with Google's Antigravity CLI and the NowKit commands.

The agent reused my previous project. So the whole app got built in the wrong folder, my-app1, and the new folder stayed empty. I only noticed when the RevenueCat JSON showed up in the old app's folder.

Agent CLIs bind to a project, not to your folder. Now I check pwd before a new app, and I start one with --new-project.

The NowKit command menu in Claude Code after typing /kit-: kit-start-setup, kit-design-app, kit-setup-paywall, kit-run-app, kit-publish-to-play and kit-publish-to-app-store with one-line descriptions

Every command and what it does is in the commands reference. If you're new to Claude Code on Android, start with my frozen first build post. It covers the setup and the CLAUDE.md these commands lean on.

When should a prompt become a command?

When you type the same long prompt a second time. That's my rule. If a prompt has steps, a check at the end, and a thing that must never happen, it belongs in a file.

Signs it's time:

  • You keep pasting the same paragraph from a notes app.
  • Claude forgets one step every third time.
  • A teammate asks "how did you make it do that?"

Keep each command to one job. When one grows past a screen, split it, and let a bigger command call the small ones.

So, write your first one today. Take the prompt you typed most this week and save it in .claude/commands/. Then type / and watch it show up.

If you'd rather start with 30 that already ship real apps, that's NowKit. /kit-start-setup names the app, sets the brand, turns on sign-in, paywall and analytics, and runs it. For more on going from AI prompts to a store listing, read my vibe coding app guide.

Frequently asked questions

How do I see all Claude Code commands?

Type / in a Claude Code session. You get every built-in command plus your own custom ones. Type a few letters after the / to filter the list.

Where do custom slash commands go in Claude Code?

A Markdown file in .claude/commands/ in your project, like .claude/commands/run-app.md for /run-app. The newer format is a skill at .claude/skills/run-app/SKILL.md. Commit the folder so your team gets it too.

How do I pass arguments to a Claude Code slash command?

Write $ARGUMENTS in the file where the text should go. For separate values, use $0, $1 and so on. Wrap a value with spaces in quotes, so it counts as one argument.

Are Claude Code skills and slash commands the same?

Almost. Anthropic merged custom commands into skills, and old .claude/commands/ files keep working. A skill can also carry extra files. If both share a name, the skill wins.

What is the difference between /clear and /compact?

/clear starts a new conversation with empty context. /compact keeps the same conversation but summarizes it to free up space. I use /clear between tasks and /compact in the middle of a long one.

Can Claude run my custom command without me typing it?

Yes. Claude can pick a skill or command when its description matches the task. Add disable-model-invocation: true to the frontmatter if you only want it to run when you type it.

Do Claude Code commands work in Cursor or Codex?

Not as they are. Each agent reads its own folder and format. NowKit ships the same commands for Claude Code, Cursor, Codex, Antigravity and OpenCode, and in Codex you type $kit- instead of /kit-.

Claude Code and AI agents

Related guides