From 4910dccc4a3cec539cc49ba5fdb8e48d9740e508 Mon Sep 17 00:00:00 2001 From: AromalBiju1 <178022850+AromalBiju1@users.noreply.github.com> Date: Sat, 15 Aug 2026 21:49:01 +0100 Subject: [PATCH] fix(install): honor CLAUDE_CONFIG_DIR in always-on CLAUDE.md registration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- graphify/install.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/graphify/install.py b/graphify/install.py index fafa8d20..25df3c43 100644 --- a/graphify/install.py +++ b/graphify/install.py @@ -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: