
If your Claude Code slash command is not showing in the / menu, or you type it and get Unknown command: /name, the file is almost always in a place Claude Code does not read. A custom command must be a Markdown file at .claude/commands/name.md, or a skill at .claude/skills/name/SKILL.md, inside the folder where you start Claude Code. Move the file there, then run /skills to confirm it loaded.
We broke a small project in eight different ways to see what each mistake looks like. Three of them gave the plain “Unknown command” message, and the other five gave a different clue, such as a startup notice or a message that the skill is disabled.
This guide shows every cause with the exact message from the terminal, and the fix for each one. Older posts and versions call this the “unknown slash command” error; in the current version the wording is Unknown command.
Browse all our Claude Code tutorials for more fixes and how-tos.
Tested with Claude Code v2.1.332 on macOS on December 2, 2026. We used a throwaway demo project called notes-app and started Claude Code with project and local settings only, so nothing outside the demo was changed.
Quick Summary: Why a Claude Code Slash Command Is Not Showing
| Cause | What you see | Fix | How we checked it |
|---|---|---|---|
File is outside .claude/commands/ | Unknown command: /standup | Move it to .claude/commands/standup.md | Tested in the terminal |
Wrong extension, such as .txt | Unknown command: /tidy | Rename the file to end in .md | Tested in the terminal |
| Skill saved as a single file | Unknown command: /shiplog | Use a folder: .claude/skills/shiplog/SKILL.md | Tested in the terminal |
| Command file is in a subfolder | The name has a prefix, such as /git:sync | Type the prefixed name | Tested in the terminal |
| Claude Code started in another folder | Unknown command | Start it in the project folder | Tested in the terminal |
Name contains <, > or hidden characters | Startup notice: name refused | Rename the file or folder | Tested in the terminal |
Turned off in skillOverrides | Message says the skill is disabled | Re-enable it in /skills | Tested in the terminal |
user-invocable: false in frontmatter | Message says only Claude can invoke it | Remove the line | Tested in the terminal |
A reserved name such as ship | Your command does not load | Pick another name | From the official docs |
What “Unknown Command” Means in Claude Code
The message means one thing: the name you typed after the slash does not match any command loaded in this session. Claude Code does not run anything and does not send your text to Claude. According to the official error reference, the usual causes are a typo, a command that is not available in your session, or a plugin command that is not installed.
For a custom command there is one more cause, and it is the most common: the file exists, but not where Claude Code looks. Claude Code only scans a few fixed folders. A file anywhere else is just a Markdown file.
Custom commands and skills are now the same feature. The skills documentation says files in .claude/commands/ keep working, and a skill folder creates a slash command too. Our comparison of commands and skills covers what changed.

If the command is missing, check the path before you check anything inside the file. In our tests, a wrong path was the only thing that produced a plain “Unknown command”.
How We Reproduced a Claude Code Slash Command Not Showing
Our demo project had four command files. One was correct, and three had a common mistake each.
.claude/commands/git/sync.md (correct, in a subfolder)
.claude/commands/tidy.txt (wrong extension)
.claude/skills/shiplog.md (skill saved as a single file)
commands/standup.md (not inside .claude)We started Claude Code in the project and typed each command. All three broken ones came back as unknown, and /tidy also got a guess at what we might have meant.

The fastest way to see what really loaded is the /skills command. It lists every custom command and skill in the session with its source. Ours showed one entry, git:sync, which told us the other three files were never picked up.

Fix 1: Put the File in the Right Folder
This fix covers the first three rows of the summary table. We moved each file to the path Claude Code expects, from a normal shell.
mv commands/standup.md .claude/commands/standup.md
mv .claude/commands/tidy.txt .claude/commands/tidy.md
mkdir .claude/skills/shiplog
mv .claude/skills/shiplog.md .claude/skills/shiplog/SKILL.md
Here are the rules behind those moves, all from the official docs:
- A command file goes in
.claude/commands/in your project, or~/.claude/commands/for every project. The folder name is plural and starts with a dot. - The file must be Markdown. The command name is the file name without the extension, so
standup.mdbecomes/standup. - A skill needs its own folder with a file named
SKILL.mdinside. The folder name becomes the command. - A flat file such as
.claude/skills/shiplog.mdis not loaded.
After the moves we started Claude Code again and typed /standup. This time it ran and wrote the short update the command asks for.

The /skills menu now listed all four commands. Note that it shows commands from .claude/commands/ and skills from .claude/skills/ in one list.

New to writing these files? Our guide to creating skills walks through the format from scratch.
Fix 2: Use the Full Name for Commands in Subfolders
If you sort commands into subfolders, the folder becomes part of the name. Our file at .claude/commands/git/sync.md is not /sync. It is /git:sync.
The docs put it this way: the path under commands/ is used with each slash replaced by a colon, then the file name. So .claude/commands/frontend/component.md becomes /frontend:component.

In v2.1.332 the menu helps here. When we typed /sync, the menu highlighted /git:sync, and pressing Enter ran it. Still, if you search the menu for a name and see nothing, try typing the folder name first.
Fix 3: Start Claude Code in the Project Folder
Project commands load based on where you start Claude Code. We started it one level above notes-app, typed /standup, and got the unknown message again, even though the file was fine.

The direction matters. The docs say Claude Code loads project skills from the folder where you start it and from every parent folder up to the repository root. When we started it inside a subfolder of the project, /standup was found.
Going the other way is different. Skills in a .claude/skills/ folder below your starting point do not load at startup. Per the docs, they load the first time Claude reads or edits a file in that subfolder, or sooner if you run /add-dir with its path.
So check the folder path printed under the Claude Code logo at startup. If it is not your project, exit and cd into the right place. This is easy to miss in large repos; our guide to monorepo setups has more on working across packages.
Fix 4: Check the Frontmatter
Here is a result that surprised us: a frontmatter mistake did not hide the command in any of our tests. The command still appeared and still ran. What broke was its description.
First we added a blank line above the opening ---. The docs say Claude Code reads frontmatter only when --- is the first line of the file. Otherwise the whole file is treated as content, and the menu showed --- as the description.

Next we wrote invalid YAML: a description with an opening quote and no closing quote. The command still loaded, with the first line of the body as its description. Every frontmatter field was dropped, including argument-hint.
That matters more than it looks. Without a description, Claude cannot match your request to the skill, so it stops being used automatically. To find the broken file, run the validator from your shell:
claude plugin validate .claude/skills
The docs say this command needs v2.1.233 or later. It also works on .claude/commands, where it warned us about the file with the blank first line. For descriptions that Claude picks up reliably, see our skill best practices.
Fix 5: Rename Files With Characters Claude Code Refuses
Claude Code refuses some names outright. The docs list < and >, zero-width spaces and other hidden characters, two spaces in a row, and a space at the start or end. Hidden characters usually arrive when you copy a name from a web page or a chat message.
We saved a command as fix<bug>.md. It did not load, and Claude Code showed a yellow notice at startup.

The notice does not say which name was refused. To find out, start Claude Code with a debug log and search it for [names]:
claude --debug-file debug.log
grep -F '[names]' debug.logOur log had this line, which names the file:
[WARN] [names] fix<bug> is not offered: a name may not hold hidden,
direction-changing or blank-like characters, < or >, or be over 256 charactersRename the file or folder using plain letters, numbers and hyphens. The docs add that the log spells out hidden characters as codes, such as \u{200B} for a zero-width space, so you can see where they are.
Fix 6: Look for Settings That Hide the Command
Two switches can hide a command on purpose. In both cases the command loaded fine, and Claude Code told us exactly why it would not run.
The first is user-invocable: false in the frontmatter. It marks a skill as background knowledge for Claude only, so it is left out of the / menu. Typing it anyway gave this message: “This skill can only be invoked by Claude, not directly by users.”
The second is the skillOverrides setting. A value of "off" hides a skill from both Claude and the menu. When we typed the hidden command, Claude Code replied that the skill “is disabled via skillOverrides” and pointed us to /skills.

To fix the first, delete the user-invocable line from the file. To fix the second, open /skills, highlight the skill, press Space until the check mark returns, then press Esc to save.
You can also edit the setting by hand. The /skills menu writes it to .claude/settings.local.json, but it can sit in any settings file:
{
"skillOverrides": {
"tidy": "off"
}
}Remove the entry or set it to "on". If you are not sure which file holds it, our guide to settings file locations lists them all. The docs note that skillOverrides does not affect plugin skills; those are managed through /plugin.
Fix 7: Resolve Name Clashes
Sometimes the command shows up, but it is not the one you wrote. That happens when two things share a name.
We kept .claude/commands/standup.md and added a skill at .claude/skills/standup/SKILL.md. The menu showed one /standup, and it was the skill.

The docs give the full order for clashes:
- A skill beats a file in
.claude/commands/with the same name. - Enterprise beats personal, and personal beats project. A
deployskill in~/.claude/skills/wins over one in the project. - Your skill replaces a built-in command of the same name in a terminal session, but not that command’s aliases.
- Plugin skills never clash, because they are named
/plugin-name:skill-name. - The names
ship,ship-localandstewardare reserved where/shipis available, so your own command with one of those names does not load.
If the missing command comes from a plugin, the cause is usually the plugin itself. Our fix guide for a plugin not found covers that case.
Do You Need to Restart Claude Code After Adding a Command?
Usually not. The docs say Claude Code watches the skill folders for changes and picks up new, edited or removed skills within the current session. In our tests that held for command files as well.
We moved a file into .claude/commands/ while a session was open, and it appeared in the menu right away. We also created the whole .claude/commands/ folder after startup, in a project that had none, and the new command was in the menu when we checked a few seconds later.
If yours does not appear, run /reload-skills. The docs describe it as a re-scan of the skill and command folders, and it prints how many skills are available. A restart is the last step, and the docs call for one in two cases:
- After renaming a file that Claude Code refused, unless it is in a watched folder.
- After changing files in the
.claude/commands/folder of a directory you passed with--add-dir, which is not watched.

Slash Commands in VS Code, the Desktop App and Headless Runs
The “Unknown command” message only appears in an interactive terminal session. The docs say that in other places, an unmatched slash name is sent to Claude as a normal message, with a note that the command did not run.
Those places include -p runs, Agent SDK apps, the Code tab of the desktop app, the VS Code chat panel and cloud sessions. So if Claude replies with a confused answer instead of running your command there, treat it the same way: the command did not load. We did not test these surfaces; this comes from the official error reference.
The file rules are the same everywhere, so the fixes above still apply. One difference: personal skills in ~/.claude/skills/ load on your machine, but the docs note they do not load in Cowork or cloud sessions.
Try It Yourself
Open any project in Claude Code and paste this prompt. It creates one working command so you can see the correct layout.
Create a custom slash command at .claude/commands/standup.md.
Give it frontmatter with a one-line description, starting on line 1.
The command should write a three-line standup update from the
files in this project. Do not create any other files.Then type /standup. If it does not appear, run /reload-skills and check /skills. For practice, rename the file to standup.txt, watch it disappear from /skills, and rename it back.
Common Mistakes
- Saving the file in
commands/orclaude/commands/without the leading dot. - Writing
.claude/command/or.claude/skill/in the singular. The folders arecommandsandskills. - Saving a skill as
.claude/skills/name.mdinstead of.claude/skills/name/SKILL.md. - Letting an editor save the file as
.txtor.md.txt. - Typing
/syncwhen the file lives incommands/git/and the name is/git:sync. - Starting Claude Code in a parent or sibling folder, then wondering where the project commands went.
- Leaving a blank line or a comment above the opening
---. - Naming a command after a reserved name such as
ship.
Pro Tips
- Make
/skillsyour first check. It shows what loaded and where from, and it filters as you type. - Keep names to lowercase letters, numbers and hyphens. That avoids every refused-name problem.
- Type new file names by hand instead of pasting them, so no hidden characters come along.
- Run
claude plugin validate .claude/skillsbefore you commit shared skills, so teammates do not inherit broken frontmatter. - Prefer a skill folder for new work. The docs recommend it because a skill can hold supporting files, and it wins any clash with an old command file.
- For built-in commands that go missing, see our slash commands guide, and for other error text, our list of common errors.
Cheat Sheet

Frequently Asked Questions
Why is my Claude Code slash command not showing in the menu?
Most often the file is not at .claude/commands/name.md or .claude/skills/name/SKILL.md, or Claude Code was started in a different folder. Run /skills to see what loaded. If the command is listed there but not in the menu, check skillOverrides and user-invocable.
Where do custom slash commands go in Claude Code?
Project commands go in .claude/commands/ inside the project. Personal commands that work in every project go in ~/.claude/commands/. Skills use .claude/skills/ or ~/.claude/skills/, with one folder per skill.
Does a frontmatter error stop a command from loading?
Not in our tests, and the docs agree. The command still loads, but its fields are dropped, so the description and argument hint are missing. Run claude plugin validate on the folder to find the file.
Do I have to restart Claude Code after adding a command?
Usually no. New files appeared within seconds in our session. If one does not, run /reload-skills, and restart only if that fails.
Do custom commands work outside the terminal?
Yes, the same files are used by the other surfaces of Claude AI coding sessions. The difference is the error: outside the interactive terminal, a missing command is sent to Claude as normal text instead of showing “Unknown command”.
Conclusion
When a Claude Code slash command is not showing, start with the path: the file must be .claude/commands/name.md or .claude/skills/name/SKILL.md, in the folder where you start Claude Code or above it. If the path is right, look at the name next, since a subfolder adds a prefix and characters such as < make Claude Code refuse the file. If Claude Code says the command is disabled or Claude-only, the cause is skillOverrides or user-invocable, not the file location. Run /skills to see what loaded, use /reload-skills after a change, and keep a restart as the last resort.


