[BUG] Sub-agents load skills from global directory instead of project directory
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?
Sub-agents load skills from global directory instead of project directory
Description
When a sub-agent is invoked via the Task tool, it loads skills from the global ~/.claude/skills/ directory instead of respecting project-local skills in .claude/skills/. This prevents project-specific skill customization and overrides.
Expected Behavior
Sub-agents should follow the same precedence hierarchy as the main agent:
- Check project-local
.claude/skills/first - Fall back to global
~/.claude/skills/if not found locally
This is consistent with how other configuration typically works (project settings override global settings).
Actual Behavior
Sub-agents always load skills from the global ~/.claude/skills/ directory, ignoring any project-local skills with the same name.
Steps to Reproduce
- Create a global skill at
~/.claude/skills/my-test-skill/skill.md:
---
name: my-test-skill
description: This skill should trigger when the user asks about "use the test-skill" and it will add the phrase "[HELLO FROM SKILL]" to the output.
---
# My Test Skill
Whenever asked, prefix your output with "[HELLO FROM SKILL]".
- Create a project-local skill with the same name at
<project>/.claude/skills/my-test-skill/skill.md:
---
name: my-test-skill
description: This skill should trigger when the user asks about "use the test-skill" and it will add the phrase "[HELLO FROM SKILL FROM PROJECT]" to the output.
---
# My Test Skill
Whenever asked, prefix your output with "[HELLO FROM SKILL FROM PROJECT]".
- Create a sub-agent at
<project>/.claude/agents/test-agent.md:
---
name: test-agent
description: A sub-agent to test Skill usage. It's allowed to use tools: Read, Bash, etc. It will delegate tasks to the test-skill when appropriate.
tools: Read, Bash, Skill
---
You are the "test-agent". If the user's prompt says "use the test-skill" then you should load and use the "my-test-skill" skill. Otherwise respond normally.
- Invoke the sub-agent:
Use the sub-agent "test-agent", and print out whatever test-agent returns:
"Please use the test-skill to generate a short report."
Result
The sub-agent returns output prefixed with [HELLO FROM SKILL] (from global) instead of [HELLO FROM SKILL FROM PROJECT] (from project-local).
The agent output explicitly shows:
The skill loaded successfully from: `/Users/ahmetcetin/.claude/skills/my-test-skill/skill.md`
Instead of the expected project path:
/Users/ahmetcetin/Downloads/testCC/.claude/skills/my-test-skill/skill.md
Environment
- Platform: macOS (Darwin 25.0.0)
- Working directory:
/Users/ahmetcetin/Downloads/testCC - Git repo: No
- Model: claude-sonnet-4-5-20250929
Impact
This prevents teams from:
- Customizing skills per project
- Overriding global skill behavior for specific codebases
- Testing skill modifications without affecting global configuration
Suggested Fix
Implement skill resolution that checks project-local .claude/skills/ before falling back to global ~/.claude/skills/, similar to how configuration file resolution typically works in development tools.
What Should Happen?
Claude should read the skill defined in the project's location first instead of looking at global ~/.claude/skills.
Error Messages/Logs
Steps to Reproduce
- Create skills folder in your projects .claude folder, and create a sub folder there called "my-test-skill". Then add the following skill.md:
---
name: my-test-skill
description: This skill should trigger when the user asks about “use the test-skill” and it will add the phrase “[HELLO FROM PROJECT SKILL]” to the output.
---
My Test Skill
Whenever asked, prefix your output with “[HELLO FROM PROJECT SKILL]”.
Example:
User: “Do something with test skill.”
Agent: “[HELLO FROM PROJECT SKILL] Here is …”
- To see it works, you can create the same skill in global skills folder with changing "PROJECT" to "GLOBAL" in md text.
- Create a subagent called test-agent.md:
---
name: test-agent
description: A sub-agent to test Skill usage. It’s allowed to use tools: Read, Bash, etc. It will delegate tasks to the test-skill when appropriate.
tools: Read, Bash
---
You are the “test-agent”. If the user’s prompt says “use the test-skill” then you should load and use the “my-test-skill” skill. Otherwise respond normally.
- Now when you run Claude Code in the project folder, give the following prompt:
Use the sub-agent “test-agent” and print the output you receive from the test-agent:
“Please use the test-skill to generate a short report.”
- If you created global skill, you would see output from global skill, if you didn't create, you should see that subagent complains about not being able to find the skill.
Claude Model
Sonnet (default)
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.0.24
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗