Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[CLI] Honor CLAUDE_CONFIG_DIR in hf skills add -g --claude (#4957)
* [CLI] Honor CLAUDE_CONFIG_DIR in hf skills add -g --claude

* remove test
  • Loading branch information
hanouticelina authored Sep 22, 2026
commit 8d4fba634e072bb0685a9ec4b9234c741227a2f9
3 changes: 2 additions & 1 deletion docs/source/en/package_reference/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -4298,7 +4298,8 @@ Install a Hugging Face skill for an AI assistant.
The default `hf-cli` skill is generated locally from the installed CLI version;
other skills are downloaded from the Hugging Face marketplace.
Default location is in the current directory (.agents/skills) or user-level (~/.agents/skills).
If `--claude` is specified, the skill is also symlinked into Claude's legacy skills directory.
If `--claude` is specified, the skill is also symlinked into Claude's legacy skills directory
(`.claude/skills` or `~/.claude/skills`, honoring `CLAUDE_CONFIG_DIR` when set).

**Usage**:

Expand Down
3 changes: 2 additions & 1 deletion src/huggingface_hub/cli/skills.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,8 @@ def skills_add(
The default `hf-cli` skill is generated locally from the installed CLI version;
other skills are downloaded from the Hugging Face marketplace.
Default location is in the current directory (.agents/skills) or user-level (~/.agents/skills).
If `--claude` is specified, the skill is also symlinked into Claude's legacy skills directory.
If `--claude` is specified, the skill is also symlinked into Claude's legacy skills directory
(`.claude/skills` or `~/.claude/skills`, honoring `CLAUDE_CONFIG_DIR` when set).
"""
if dest is not None:
if claude or global_:
Expand Down
3 changes: 2 additions & 1 deletion src/huggingface_hub/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,11 @@ def list_files(repo_id: str):

# Skills directories for AI agents: `.agents/skills` is read by most agents, `.claude/skills` by Claude Code.
# Local = current project, global = user-level (see `hf skills add`).
# Claude Code's user-level directory defaults to `~/.claude` but can be relocated with `CLAUDE_CONFIG_DIR`.
AGENTS_SKILLS_LOCAL_PATH = Path(".agents/skills")
AGENTS_SKILLS_GLOBAL_PATH = Path("~/.agents/skills")
CLAUDE_SKILLS_LOCAL_PATH = Path(".claude/skills")
CLAUDE_SKILLS_GLOBAL_PATH = Path("~/.claude/skills")
CLAUDE_SKILLS_GLOBAL_PATH = Path(os.environ.get("CLAUDE_CONFIG_DIR") or "~/.claude") / "skills"

# Set to skip the CLI update check (PyPI query + "new version available" warning at startup).
HF_HUB_DISABLE_UPDATE_CHECK = _is_true(os.environ.get("HF_HUB_DISABLE_UPDATE_CHECK"))
Expand Down
Loading