[BUG] Project skills not discovered when HOME equals cwd when using --setting-sources project

Resolved 💬 3 comments Opened Feb 13, 2026 by ryanee-bcap Closed Mar 14, 2026

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 using --setting-sources project, project skills in .claude/skills/ are not discovered if the HOME environment variable equals the current working directory.

The directory walk function checks if (cwd === homedir) break before checking if .claude/skills/ exists at that directory, so the loop exits immediately without finding any skills. In normal CLI usage this is masked because skills also load via the user settings path (~/.claude/skills/), but with --setting-sources project that fallback is disabled.

What Should Happen?

When using --setting-sources project, skills at .claude/skills/ should be discovered even when HOME equals cwd. The directory walk should inspect each directory for .claude/skills/ before checking stop conditions.

Error Messages/Logs

Steps to Reproduce

  1. Create a project with a skill:

``bash
mkdir -p /tmp/test-skills/.claude/skills/hello
cat > /tmp/test-skills/.claude/skills/hello/SKILL.md << 'EOF'
---
name: Hello
description: Say hello
---
Say hello to the user
EOF
``

  1. Run Claude Code with HOME set to the project directory:

``bash
cd /tmp/test-skills && HOME=/tmp/test-skills claude --setting-sources project
``

  1. Type /skills
  1. Result: "No skills found" — despite .claude/skills/hello/SKILL.md existing at cwd.
  1. For comparison, without the HOME override skills are found:

``bash
cd /tmp/test-skills && claude
# /skills → "Hello" is listed
``

Claude Model

None

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

2.1.41

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

Also reproducible on AWS EC2 Amazon Linux 2023.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗