← All posts

When you're straining to recall the command, that's the bug

I had seven Claude Code slash commands and couldn't keep them straight. The fix wasn't a cheat-sheet — it was making the agent read my intent.

  • claude-code
  • agents
  • developer-tools
  • hooks
  • workflow

I was mid-prompt in Claude Code — the terminal coding agent I use all day — and I stopped typing because I couldn’t remember whether the command was /review or /code-review. I sat there for a second, cursor blinking, trying to recall my own tooling.

That pause was the whole problem, and it took me embarrassingly long to see it.

Some context for anyone who doesn’t live in a terminal: a slash command is a shortcut you type to make the agent do a specific thing. /plan makes it sketch an approach before writing code. /review makes it critique what it wrote. Think of them like the number-pad shortcuts on an old office phone — great if you’ve memorized them, useless the moment you can’t.

I’d accumulated seven of these. /plan, /build, /review, a /code-graph that maps how files connect, a “lazy senior dev” plugin that strips code down to the minimum, a dispatcher that routes work to sub-agents, and a couple more I honestly forget. Each one earned its place when I built it. Together they were a filing cabinet I kept forgetting the labels to.

My first fix was the obvious dumb one: I made a cheat-sheet. A little markdown file listing every command and when to use it. I looked at it maybe twice. If I have to context-switch to a reference doc to remember how to talk to my assistant, the assistant isn’t assisting — I’m doing lookup work on its behalf.

The real fix came from flipping who the commands are for.

Slash commands felt like they were for me to remember. They’re not. They’re for the agent to know. Some of mine were always-on — I basically wanted the planning and the code-graph awareness firing on every coding request. So why was I typing them at all?

I moved those into a hook — a rule that watches my prompt and fires automatically when it detects I’m asking for code. Now I just describe what I want in plain English, and the always-on tools attach themselves before the agent even starts. The rest still exist as commands, but the ones I need constantly, I never type.

Wiring intent-triggered hooks in Claude Code give me the detail

Claude Code lets you register a UserPromptSubmit hook that runs before the model sees your message. Mine does a cheap intent check and injects the always-on context:

#!/usr/bin/env bash
prompt="$(cat)"
if echo "$prompt" | grep -qiE 'implement|fix|refactor|add .*function|write .*code'; then
  echo "Before coding: consult the code-graph for affected files, and plan the change first. Prefer the minimal senior-dev diff."
fi

The grep is deliberately blunt — a keyword sniff, not a classifier. It’s the wrong tool if you want precision, but for “is this a coding request,” a false positive costs me nothing and I never have to remember /plan again. The dispatcher and one-off commands stay manual, because those genuinely vary by task.

Here’s the part that transfers past my terminal: when you find yourself reaching for the name of a command, that reach is a signal your tool should have read your intent already. Memorizing your own interface is a tax you invented. Every command you keep straining to recall is one you should be triggering from plain language instead — let the agent detect what you meant, and spend your attention on the actual work.