Skip to content

[BUG] Unknown skill when CLAUDE_CONFIG_DIR is set and skill lives in $CLAUDE_CONFIG_DIR/skills/ #36172

Description

@pozhidaevak

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?

When CLAUDE_CONFIG_DIR is set to a custom path, skills placed in
$CLAUDE_CONFIG_DIR/skills/<skill-name>/SKILL.md are not recognized and invoking them via
/skill-name returns Unknown skill.

Critically, setting CLAUDE_CONFIG_DIR=~/.claude (the default path) also fails — the skill is only
found when CLAUDE_CONFIG_DIR is not set at all. This suggests the bug is in how the skills
directory is resolved when CLAUDE_CONFIG_DIR is explicitly set, even to the default location.

Environment

  • Claude Code version: 2.1.79
  • OS: macOS Darwin 24.3.0
  • Skill is present in both ~/.claude/skills/test-coverage/SKILL.md and
    ~/.claude-work/skills/test-coverage/SKILL.md
  • Bug reproduces with CLAUDE_CONFIG_DIR=/.claude and CLAUDE_CONFIG_DIR=/.claude-work
  • Works only when CLAUDE_CONFIG_DIR is not set

Additional context

The skill file has valid frontmatter:

name: test-coverage
description: Write unit tests for code changed since a branch, then verify 80% diff coverage
argument-hint: [base-branch]
user-invocable: true

The root cause appears to be that setting CLAUDE_CONFIG_DIR (even to the default ~/.claude)
causes the skills directory lookup to fail. The skills scanner likely uses a hardcoded default
path rather than respecting CLAUDE_CONFIG_DIR.

What Should Happen?

The skill is found and executed regardless of whether CLAUDE_CONFIG_DIR is explicitly set or not,
including when set to a non-default path like ~/.claude-work.

Error Messages/Logs

Steps to Reproduce

  1. Create a skill at ~/.claude/skills/test-coverage/SKILL.md with valid frontmatter
  2. Set CLAUDE_CONFIG_DIR=~/.claude and run Claude Code, type /test-coverage → Unknown skill
  3. Unset CLAUDE_CONFIG_DIR entirely and run Claude Code, type /test-coverage → works

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

2.1.79

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

IntelliJ IDEA terminal

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:skillsbugSomething isn't workingduplicateThis issue or pull request already existsplatform:macosIssue specifically occurs on macOSstaleIssue is inactive

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions