fix(install): honor CLAUDE_CONFIG_DIR in always-on CLAUDE.md registration

The always-on registration wrote `~/.claude/CLAUDE.md` unconditionally, so
installing from a Claude profile relocated via CLAUDE_CONFIG_DIR mutated the
DEFAULT profile instead — the same fix _platform_skill_destination already
applies to the skill-copy path, missed for this path. The global branch now
writes to $CLAUDE_CONFIG_DIR/CLAUDE.md with a matching skill reference; env
unset/blank still falls back to ~/.claude. Refs #2694 (part 1; the version-stamp
half is unaddressed).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
AromalBiju1
2026-08-15 21:49:01 +01:00
committed by safishamsi
co-authored by Claude Opus 4.8
parent c2a676d215
commit 4910dccc4a
+15 -3
View File
@@ -633,9 +633,21 @@ def install(platform: str = "claude", *, project: bool = False, project_dir: Pat
print(f" command installed -> {command_dst}")
if cfg["claude_md"]:
# Register in the matching Claude Code scope.
claude_md = (project_dir / ".claude" / "CLAUDE.md") if project else Path.home() / ".claude" / "CLAUDE.md"
registration = _skill_registration(".claude/skills/graphify/SKILL.md" if project else "~/.claude/skills/graphify/SKILL.md")
# Register in the matching Claude Code scope. Honor CLAUDE_CONFIG_DIR
# for the global (non-project) case, same as _platform_skill_destination
# does for the skill copy path (#527) -- this always-on registration
# path was missed by that fix (#2694).
if project:
claude_md = project_dir / ".claude" / "CLAUDE.md"
skill_ref = ".claude/skills/graphify/SKILL.md"
elif os.environ.get("CLAUDE_CONFIG_DIR"):
config_dir = Path(os.environ["CLAUDE_CONFIG_DIR"])
claude_md = config_dir / "CLAUDE.md"
skill_ref = str(config_dir / "skills" / "graphify" / "SKILL.md")
else:
claude_md = Path.home() / ".claude" / "CLAUDE.md"
skill_ref = "~/.claude/skills/graphify/SKILL.md"
registration = _skill_registration(skill_ref)
if claude_md.exists():
content = claude_md.read_text(encoding="utf-8")
if "graphify" in content: