Skip to content

Support custom CLAUDE_CONFIG_DIR in install#13523

Open
tommaso-moro wants to merge 2 commits into
trunkfrom
tommy/skill-claude-config-dir-fix
Open

Support custom CLAUDE_CONFIG_DIR in install#13523
tommaso-moro wants to merge 2 commits into
trunkfrom
tommy/skill-claude-config-dir-fix

Conversation

@tommaso-moro
Copy link
Copy Markdown
Contributor

Fixes #13262

Summary

This updates Claude Code user-scope skill directory resolution to honor CLAUDE_CONFIG_DIR when it is set. User-scope installs for Claude Code now write to $CLAUDE_CONFIG_DIR/skills, falling back to the existing ~/.claude/skills location when the environment variable is not present.

The change lives in the shared agent registry path resolver so gh skill install, gh skill list, and gh skill update all use the same location for Claude Code user-scope skills.

Tests

  • Added registry coverage for Claude Code's default user-scope path and CLAUDE_CONFIG_DIR override.
  • Added an install regression test that verifies gh skill install --agent claude-code --scope user writes under $CLAUDE_CONFIG_DIR/skills and not ~/.claude/skills.
  • Ran go test ./internal/skills/registry ./pkg/cmd/skills/....

@tommaso-moro tommaso-moro marked this pull request as ready for review May 26, 2026 12:30
@tommaso-moro tommaso-moro requested review from a team as code owners May 26, 2026 12:30
@tommaso-moro tommaso-moro requested review from babakks and Copilot May 26, 2026 12:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Claude Code user-scope skill installation path resolution to honor CLAUDE_CONFIG_DIR, so user-scope operations (gh skill install/list/update) use $CLAUDE_CONFIG_DIR/skills when set and otherwise fall back to ~/.claude/skills.

Changes:

  • Add CLAUDE_CONFIG_DIR handling in the shared agent registry InstallDir resolver for claude-code user scope.
  • Add registry tests covering both default Claude Code user-scope path and the CLAUDE_CONFIG_DIR override.
  • Add an install regression test ensuring user-scope installs for claude-code write under $CLAUDE_CONFIG_DIR/skills (and not ~/.claude/skills).
Show a summary per file
File Description
internal/skills/registry/registry.go Reads CLAUDE_CONFIG_DIR for claude-code user-scope install dir resolution.
internal/skills/registry/registry_test.go Adds test coverage for Claude Code user-scope dir default and env override.
pkg/cmd/skills/install/install_test.go Adds regression test verifying install writes to $CLAUDE_CONFIG_DIR/skills for Claude Code user-scope.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 3/3 changed files
  • Comments generated: 1

Comment thread internal/skills/registry/registry_test.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gh skill ignores CLAUDE_CONFIG_DIR

2 participants