Skip to content

[BUG] Custom command in ~/.claude/commands/ not recognized #41243

Closed

Description

@TacoTakumi

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Custom slash commands placed in ~/.claude/commands/ no longer appear
after updating to Claude Code 2.1.88. They were working prior to the update.

What Should Happen?

Custom slash commands in ~/.claude/commands should be available.

Error Messages/Logs

Steps to Reproduce

  1. Create a command file: ~/.claude/commands/test.md
  2. Run /test — command does not appear in autocomplete or execute

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.87

Claude Code Version

2.1.88

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Other

Additional Information

No response

Activity

  1. yurukusa commented on Mar 31, 2026

    @yurukusa

    /tmp/gh-comment-41243.md

  2. github-actions commented on Mar 31, 2026

    @github-actions

    Found 3 possible duplicate issues:

    1. [BUG] User-level custom commands in ~/.claude/commands/ not loaded into skill registry #27888
    2. .claude/commands/*.md files not discovered as slash commands #35346
    3. [BUG] Custom commands disappear from autocomplete after first use — requires CLI restart #36486

    This issue will be automatically closed as a duplicate in 3 days.

    • If your issue is a duplicate, please close it and 👍 the existing issue instead
    • To prevent auto-closure, add a comment or 👎 this comment

    🤖 Generated with Claude Code

  3. TacoTakumi commented on Mar 31, 2026

    @TacoTakumi
    Author

    I can make them come back by using 2.1.87, go away again with 2.1.88.

  4. willguitaradmfar commented on Mar 31, 2026

    @willguitaradmfar

    I'm starting to experience exactly the same issue right now, specifically after upgrading to v2.1.88.

    Context

    • Everything was working fine before
    • The issue started immediately after using version 2.1.88
    • No changes were made on my side

    What I’m seeing

    • Same behavior described in this issue
    • Happens consistently

    Environment

    • OS: Linux
    • Claude Code version: 2.1.88

    Notes

    • The timing strongly suggests a regression introduced in v2.1.88 rather than a local setup issue
  5. Ahacad commented on Mar 31, 2026

    @Ahacad

    Same, updated to v2.1.88, no longer recognizing ~/.claude/commands folder, shows unknow skills

  6. jamesnagle commented on Mar 31, 2026

    @jamesnagle

    Not sure if this applies for others but my commands and agents weren't working as well. Started looking into rolling back the version. Then I thought about the 'claude has switched to a native installer use claude install' message I had been ignoring. Tried claude install, it did its thing and when I started a new session the commands and agents were working again. Hope this helps someone else.

  7. Elia31 commented on Mar 31, 2026

    @Elia31

    I'm using Claude via the Windows 11 Desktop app. After the last update commands no longer work. I've been using things like /btw yesterday just fine. Also I have no %USERPROFILE%/.claude/commands folder but I'm honestly not sure if there ever has been one (but I guess so since I could use commands beforehand jsut fine).
    Claude for Windows Version: Version 1.1.9669

  8. ghao-luminate commented on Mar 31, 2026

    @ghao-luminate

    Not sure if this applies for others but my commands and agents weren't working as well. Started looking into rolling back the version. Then I thought about the 'claude has switched to a native installer use claude install' message I had been ignoring. Tried claude install, it did its thing and when I started a new session the commands and agents were working again. Hope this helps someone else.

    this worked for me

  9. yurukusa commented on Mar 31, 2026

    @yurukusa

    Thanks @jamesnagle for the fix — claude install re-linking resolves this for CLI users.
    Summary for anyone landing here:

    Platform Fix
    CLI (npm/native) Run claude install to re-register the native installer. Restart your terminal afterward.
    Windows Desktop app This appears to be a separate regression in v1.1.9669 (@Elia31's case). The Desktop app manages its own command discovery path. If %USERPROFILE%\.claude\commands\ doesn't exist, try creating it manually and placing your .md command files there, then restart the app.
    If claude install doesn't work:
    which claude
    claude --version
    ls -la ~/.claude/commands/
    claude /help  # Should list your custom commands

    The root cause seems to be that v2.1.88's migration to the native installer changed how command paths are resolved. Running claude install re-establishes the correct symlinks.

  10. jwallaceparker commented on Mar 31, 2026

    @jwallaceparker

    Thanks @jamesnagle claude install fixed this for me.

  11. luke-timon commented on Mar 31, 2026

    @luke-timon

    Root Cause: vendored ripgrep binary missing execute permission

    I debugged this extensively and found the actual root cause — it's not a path resolution issue but a file permission issue on the bundled rg binary.

    How commands are loaded

    Claude Code loads custom commands via its vendored ripgrep:

    voz() → vh1() → LF() → spawn("rg", ["--files", "--glob", "*.md", path])
    

    What went wrong in v2.1.88

    The vendored ripgrep binary was installed with 644 (no execute bit):

    $ ls -la /opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/vendor/ripgrep/arm64-darwin/rg
    -rw-r--r--  ...  rg    # ← missing execute permission

    When rg can't execute, the spawn fails with EACCES. The error handler in e44() catches this and returns an empty array []. The outer try/catch in voz() silently swallows the error — so custom commands simply vanish with no error message.

    Skills (loaded via Node.js readdir() + readFile()) are unaffected since they don't depend on ripgrep.

    Fix

    chmod +x /opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/vendor/ripgrep/arm64-darwin/rg

    For Linux users, the path is typically:

    chmod +x /usr/lib/node_modules/@anthropic-ai/claude-code/vendor/ripgrep/x64-linux/rg
    # or wherever `npm root -g` points to

    General command to find and fix it:

    chmod +x "$(npm root -g)/@anthropic-ai/claude-code/vendor/ripgrep/"*/rg

    Why claude install also works

    claude install likely re-extracts or re-links the binary with correct permissions as a side effect, which is why it resolves the issue for some users.

    Diagnosis

    # Check if rg has execute permission:
    ls -la "$(npm root -g)/@anthropic-ai/claude-code/vendor/ripgrep/"*/rg
    
    # Test if rg can actually run:
    "$(npm root -g)/@anthropic-ai/claude-code/vendor/ripgrep/"*/rg --version
    
    # Test command scanning:
    "$(npm root -g)/@anthropic-ai/claude-code/vendor/ripgrep/"*/rg --files --glob "*.md" ~/.claude/commands/

    Suggestion for Anthropic

    The post-install script (YK4()) handles codesign and quarantine removal but doesn't ensure the execute bit. Adding chmod +x to the install/update pipeline would prevent this regression.

  12. yurukusa commented on Mar 31, 2026

    @yurukusa

    Great root cause analysis @luke-timon — the 644 permission on the vendored rg binary explains everything. My earlier comment incorrectly attributed this to path resolution; the execute-bit issue is the actual culprit.
    For anyone landing here:

    Root cause Vendored rg binary shipped with 644 (no execute bit) in v2.1.88
    Why it breaks Claude Code discovers custom commands via rg --files --glob "*.md" — if rg can't execute, no commands are found
    CLI fix claude install (re-registers the native installer, restores permissions)
    Windows Desktop Separate regression in v1.1.9669 — Desktop app manages its own command discovery path
  13. jdainsworthsnb commented on Apr 1, 2026

    @jdainsworthsnb

    I debugged this extensively and found the actual root cause — it's not a path resolution issue but a file permission issue on the bundled rg binary.

    How commands are loaded

    Claude Code loads custom commands via its vendored ripgrep:

    That did it. awesome

  14. TacoTakumi commented on Apr 1, 2026

    @TacoTakumi
    Author

    LOL, you guys released 2.1.89 with the same bug! Unbelievable, nice work!

  15. yurukusa commented on Apr 5, 2026

    @yurukusa

    @TacoTakumi The fix keeps regressing because each npm install overwrites the binary with the same 644 permissions from the package tarball.

    Quick fix (run once after each update):

    chmod +x "$(find "$(dirname "$(readlink -f "$(which claude)")")/../vendor/ripgrep" -name rg 2>/dev/null)"

    Permanent fix — add a SessionStart hook that auto-corrects the permission on every launch. In ~/.claude/settings.json:

    {
      "hooks": {
        "SessionStart": [
          {
            "matcher": "",
            "hooks": [
              {
                "type": "command",
                "command": "for rg in \"$(dirname \"$(readlink -f \"$(which claude)\")\")\"/../../vendor/ripgrep/*/rg; do [ -f \"$rg\" ] && [ ! -x \"$rg\" ] && chmod +x \"$rg\"; done"
              }
            ]
          }
        ]
      }
    }

    This runs in <1ms and silently no-ops when the permission is already correct. It'll survive every future update until Anthropic fixes the packaging.

  16. dicksontsai commented on Apr 7, 2026

    @dicksontsai
    Collaborator

    This issue occurred in 2.1.88 and should be fixed as of 2.1.90.

  17. github-actions commented on Apr 15, 2026

    @github-actions

    This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

  18. locked as resolved and limited conversation to collaborators on Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions