name: diagnosing-commands
Goal: reduce any /command problem to a single concrete fix.
A person inspects commands from the / menu (the Commands group) in the input box; an agent inspects by reading the command files at the locations below.
Two points that are often misunderstood: nested command names join with a colon (
review/code.mdbecomes/review:code, not/review/code); and a command is a.mdfile whose file name is the command name.
~/.zcode/commands~/.agents/commands.zcode/commands (from the current directory up to the repository root; every level counts).agents/commandsWithin a level, .zcode is scanned before .agents. Subdirectories are scanned recursively, and a nested path joins into the command name with a colon.
The key is the normalized command name (the relative path with .md removed, separators replaced by :, lowercased). The first occurrence — the highest-precedence location — wins: user overrides workspace, .zcode overrides .agents, and local files override plugins. Duplicates are ignored.
There is also an interactive-surface-only filter: a command whose name matches a built-in slash command (or compress) is filtered out of the live / menu, though it is still present on disk.
^[a-z0-9][a-z0-9_:-]{0,63}$ (lowercase alphanumeric start; no spaces, dots, or leading -/_; at most 64 characters). A violation drops the command.description, argument-hint, allowed-tools, model, skills, and disable-noninteractive (all hyphenated). An unknown key is ignored but the command still loads.description is absent, the first non-empty body line is used.$ARGUMENTS is the full argument string; $1/$2 are positional (out of range is empty). When arguments are supplied but no placeholder is present, they are appended under a "User arguments:" heading.skills are auto-mounted. Inline dynamic shell (!`cmd` or a fenced ! block) is rejected./ in the input box and open the Commands group; you can search by keyword. Each entry shows its name and description..md files at each location in discovery order. Derive each command's name from its path (subdirectories become :), and remember that for a same-named command the first in discovery order is the one that runs..md is not under a scanned root (for example a singular .zcode/command/, or above the repository root). → Move it into ~/.zcode/commands/ or <repo>/.zcode/commands/.-/_, or over 64 characters). → Rename to a valid lowercase name; namespace with subdirectories (which become :), not dots.allowed-tools: Read, Bash.description: or at least one non-empty body line.model/skills/allowed-tools have no effect. → Use the hyphenated keys: allowed-tools (not allowed_tools), argument-hint, disable-noninteractive.$ARGUMENTS/$1 does not substitute — the placeholder appears literally or is empty. The body has no placeholder (arguments are appended under "User arguments:" by design), $1 is out of range, or a form like ${ARGUMENTS} is not recognized. → Use the exact $ARGUMENTS/$1 tokens.!`...` or fenced ! block is not executed when the command is invoked, and its output is not pasted in beforehand. ZCode rewrites each block into an instruction for the model to run that command with the Bash tool, so it appears as a normal tool call with the usual approval prompt (and plan mode can deny it). → Expect that tool call; if the command must not depend on shell output, use static text or $ARGUMENTS instead.enable to true or remove it./ versus : confusion — /review/code reports not found although review/code.md exists. Subdirectories map to :, so the real name is review:code. → Invoke /review:code./ menu, because its name matches a built-in slash command or compress. → Rename to a non-reserved name./ menu? Open the Commands group. Absent → step 2. Present but the wrong content runs → step 4 (a duplicate)..md sits directly under a scanned commands root for the current working directory — pitfall 1 — and that its name is valid — pitfall 2.