[BUG] Unknown skill when CLAUDE_CONFIG_DIR is set and skill lives in $CLAUDE_CONFIG_DIR/skills/
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] 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
- Create a skill at ~/.claude/skills/test-coverage/SKILL.md with valid frontmatter
- Set CLAUDE_CONFIG_DIR=~/.claude and run Claude Code, type /test-coverage → Unknown skill
- 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_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗