Skip to content

fix(claude): deploy CLAUDE.md via xdg.configFile to respect CLAUDE_CONFIG_DIR#20

Merged
borland502 merged 1 commit intomainfrom
fix/claude-xdg-config-path
May 1, 2026
Merged

fix(claude): deploy CLAUDE.md via xdg.configFile to respect CLAUDE_CONFIG_DIR#20
borland502 merged 1 commit intomainfrom
fix/claude-xdg-config-path

Conversation

@borland502
Copy link
Copy Markdown
Owner

Summary

  • Moves the Claude Code global instructions file (CLAUDE.md) from home.file to xdg.configFile so it is deployed to $XDG_CONFIG_HOME/claude/CLAUDE.md instead of the hardcoded ~/.claude/CLAUDE.md.
  • This aligns with the CLAUDE_CONFIG_DIR env var exported in zsh.nix, which points to $XDG_CONFIG_HOME/claude.
  • Bumps the stylix flake input to the latest upstream revision (a2538cd).

Why

The previous home.file approach ignored the CLAUDE_CONFIG_DIR env var and always wrote to ~/.claude/CLAUDE.md. By switching to xdg.configFile, the file lands where Claude Code actually looks for it when CLAUDE_CONFIG_DIR is set.

Reviewer notes

  • No functional change to Copilot instruction deployment — only the Claude path is affected.
  • The comment in home.file that mentioned Claude has been removed since it no longer applies.

🤖 Generated with Claude Code

…NFIG_DIR

Move Claude Code global instructions from home.file (which hardcodes ~/.claude/CLAUDE.md)
to xdg.configFile so they land at $XDG_CONFIG_HOME/claude/CLAUDE.md, consistent with the
CLAUDE_CONFIG_DIR env var exported in zsh.nix.

Also bumps stylix flake input to latest revision.
@borland502 borland502 merged commit 57518b3 into main May 1, 2026
6 checks passed
@borland502 borland502 deleted the fix/claude-xdg-config-path branch May 4, 2026 14:08
borland502 added a commit that referenced this pull request May 4, 2026
Claude Code's memory-file loader hardcodes ~/.claude/CLAUDE.md and does
not honor CLAUDE_CONFIG_DIR (per https://code.claude.com/docs/en/memory.md).
PR #20 moved CLAUDE.md to the XDG location alone, which silently broke
auto-loading — Claude Code launched blind to the user's directives until
told to read the file explicitly.

Deploy the same source to both paths: XDG remains the canonical location,
and ~/.claude/CLAUDE.md becomes a forwarding pointer the loader can find.
Comments in common.nix flag this as a workaround pending an upstream fix
that teaches the loader to follow CLAUDE_CONFIG_DIR.
borland502 added a commit that referenced this pull request May 4, 2026
* fix(claude): restore ~/.claude/CLAUDE.md so memory file auto-loads

Claude Code's memory-file loader hardcodes ~/.claude/CLAUDE.md and does
not honor CLAUDE_CONFIG_DIR (per https://code.claude.com/docs/en/memory.md).
PR #20 moved CLAUDE.md to the XDG location alone, which silently broke
auto-loading — Claude Code launched blind to the user's directives until
told to read the file explicitly.

Deploy the same source to both paths: XDG remains the canonical location,
and ~/.claude/CLAUDE.md becomes a forwarding pointer the loader can find.
Comments in common.nix flag this as a workaround pending an upstream fix
that teaches the loader to follow CLAUDE_CONFIG_DIR.

* fix: update terminal defaults and instructions for shell usage and command handling
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.

1 participant