Claude Code Custom Slash Command Not Showing? Fix “Unknown Slash Command”

Claude Code Custom Slash Command Not Showing? Fix “Unknown Slash Command”

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

CauseWhat you seeFixHow we checked it
File is outside .claude/commands/Unknown command: /standupMove it to .claude/commands/standup.mdTested in the terminal
Wrong extension, such as .txtUnknown command: /tidyRename the file to end in .mdTested in the terminal
Skill saved as a single fileUnknown command: /shiplogUse a folder: .claude/skills/shiplog/SKILL.mdTested in the terminal
Command file is in a subfolderThe name has a prefix, such as /git:syncType the prefixed nameTested in the terminal
Claude Code started in another folderUnknown commandStart it in the project folderTested in the terminal
Name contains <, > or hidden charactersStartup notice: name refusedRename the file or folderTested in the terminal
Turned off in skillOverridesMessage says the skill is disabledRe-enable it in /skillsTested in the terminal
user-invocable: false in frontmatterMessage says only Claude can invoke itRemove the lineTested in the terminal
A reserved name such as shipYour command does not loadPick another nameFrom 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.

Folder tree showing where Claude Code loads custom slash commands and skills from, with the command name each file creates
The folders Claude Code reads, and the command name each file gets.

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.

Claude Code session showing Unknown command messages for /standup, /tidy and /shiplog after three command files were saved in the wrong place
Three misplaced files, three “Unknown command” messages. The “Did you mean” guess is just the closest built-in name.

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.

Claude Code /skills menu listing only git:sync from the project, showing that three other command files did not load
The /skills menu is the source of truth. If your command is not in this list, Claude Code never loaded it.

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
Terminal showing mv and mkdir commands that move three command files into .claude/commands and .claude/skills, followed by the corrected file list
The three moves, and the file list afterward.

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.md becomes /standup.
  • A skill needs its own folder with a file named SKILL.md inside. The folder name becomes the command.
  • A flat file such as .claude/skills/shiplog.md is 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.

Claude Code running the /standup custom command and replying with Done, Next and Blockers lines after the file was moved to .claude/commands
Same file, right folder. The command runs.

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

Claude Code /skills menu listing git:sync, shiplog, standup and tidy as project commands after the fix
All four commands loaded from the project.

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.

Claude Code slash menu after typing /sync, with /git:sync highlighted as the first match above two built-in commands
Typing /sync brings up /git:sync in the menu.

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.

Claude Code started in the parent folder of the project, showing Unknown command for /standup because the project's .claude folder was not loaded
Claude Code started one folder above the project, so the project’s commands were not loaded.

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.

A command file with a blank first line above the frontmatter, and the Claude Code slash menu showing three dashes as the description for /explain
One blank line above the frontmatter, and the description turns into three dashes.

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
Terminal output of claude plugin validate reporting that YAML frontmatter failed to parse in a SKILL.md file and that the skill loads with empty metadata
The validator names the file and says the skill loads with empty metadata.

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.

Claude Code startup screen with a yellow notice that one skill or command name was refused, after a command file was named with angle brackets
The startup notice is easy to miss. It appears under the prompt and is cut off in a narrow window.

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.log

Our 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 characters

Rename 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.

Claude Code messages for a Claude-only skill and a skill disabled via skillOverrides, with the /skills menu showing tidy as turned off
Both messages at the top, and the /skills menu showing tidy with an empty circle instead of a check mark.

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.

Claude Code slash menu showing a single /standup entry with the skill's description, while a command file with the same name also exists
One name, two files. The menu shows the skill’s description, not the command file’s.

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 deploy skill 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-local and steward are reserved where /ship is 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.
Checklist for a custom slash command that is not showing: check the folder, the file name, the subfolder prefix, the visibility switches, then reload skills
The order we would check things in, from most to least likely.

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/ or claude/commands/ without the leading dot.
  • Writing .claude/command/ or .claude/skill/ in the singular. The folders are commands and skills.
  • Saving a skill as .claude/skills/name.md instead of .claude/skills/name/SKILL.md.
  • Letting an editor save the file as .txt or .md.txt.
  • Typing /sync when the file lives in commands/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 /skills your 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/skills before 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

Cheat sheet for a Claude Code slash command not showing: where command and skill files go, and the commands that check what loaded
File locations on the left, checks on the right.

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.

Newsletter

New AI tools in your inbox

The best new tools and the AI news that matters, in one short email. Unsubscribe any time.

Free · No spam · Unsubscribe any time

✓ Looks like you’re subscribed

Loading Google’s sign-up form…

Looks like you’re already subscribed

Thanks for reading! New AI tools and the AI news that matters will land in your inbox.

Not subscribed yet? Refresh the page to load the sign-up form.

The sign-up form couldn’t load. If you use an ad or content blocker, allow news.google.com and reload the page.

Free instant check before you pay. Takes a few seconds.

Scroll to Top