Skip to content

🤖 feat: load ~/.claude/CLAUDE.md as compat global instructions - #3918

Merged
ibetitsmike merged 2 commits into
mainfrom
mike/fix-3026-claude-md-global
Aug 21, 2026
Merged

🤖 feat: load ~/.claude/CLAUDE.md as compat global instructions#3918
ibetitsmike merged 2 commits into
mainfrom
mike/fix-3026-claude-md-global

Conversation

@ibetitsmike

Copy link
Copy Markdown
Contributor

Summary

Loads the user's personal global Claude Code instructions file ~/.claude/CLAUDE.md as a read-only, lowest-precedence global instruction source, gated behind the existing Claude compatibility experiment (formerly "Claude skills compatibility", same claude-skills-compat ID).

Fixes #3026

Background

Xum reads global instructions only from ~/.xum (base candidates AGENTS.mdAGENT.mdCLAUDE.md), so users with personal instructions in ~/.claude/CLAUDE.md could not bring them along. The repo already ships opt-in Claude compatibility for skills (.claude/skills and ~/.claude/skills behind the claude-skills-compat experiment, read-only, lowest precedence). This PR mirrors that mechanism for global instructions.

Implementation

  • New conservative reader readClaudeCompatGlobalInstructionSet: reads only ~/.claude/CLAUDE.md (no AGENTS.md/AGENT.md candidates, no .local.md pairing, no .mux/ companion, never a write target) with muxOnly: false, so scoped Model:/Mode: directives in it stay ordinary markdown.
  • Additive, not fallback: when the experiment is on, the compat set loads in addition to the native ~/.xum set, ordered before it in prompt order so native files layer on top and always win. A native ~/.xum/AGENTS.md never silently disables the user's Claude instructions.
  • InstructionSources.global becomes an ordered array of sets (compat first, then native) instead of a single nullable set; prompt builder, Instructions tab, and IPC all consume the same shape.
  • Missing file or missing ~/.claude directory is a silent no-op.
  • Experiment copy broadened to "Claude compatibility"; ID stays claude-skills-compat (persisted settings key). Docs updated in docs/agents/instruction-files.mdx and docs/agents/agent-skills.mdx.

Validation

  • Behavioral tests: reader no-op on absence, experiment off/on gating, compat-before-native ordering, scoped Model:/Mode: headings in CLAUDE.md not extracted while native ones still are, decoy files in ~/.claude ignored.
  • Remote dogfood UAT (real Electron build at this SHA, real model): all acceptance criteria passed, including agent-receipt of the compat instructions, precedence, live panel updates on experiment toggle, and prompt-level verification via API debug logs.

Risks

Low. The feature is opt-in behind a default-off experiment; with it off the only behavioral surface is the InstructionSources.global shape change, which is compiler-verified across prompt builder, panel, and mocks. Compat reads are host-local and read-only.


Generated with mux • Model: anthropic:claude-fable-5 • Thinking: xhigh

@mintlify

mintlify Bot commented Aug 21, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
Mux 🟢 Ready View Preview Aug 21, 2026, 8:00 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

This comment has been minimized.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6b09d6d001

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/node/services/systemMessage.ts Outdated
@ibetitsmike
ibetitsmike force-pushed the mike/fix-3026-claude-md-global branch from 6b09d6d to 966427a Compare August 21, 2026 20:04
@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 966427af10

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

This comment has been minimized.

@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 1d68de58d3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

This comment has been minimized.

@ibetitsmike
ibetitsmike added this pull request to the merge queue Aug 21, 2026
Merged via the queue into main with commit 1c19607 Aug 21, 2026
36 of 39 checks passed
@ibetitsmike
ibetitsmike deleted the mike/fix-3026-claude-md-global branch August 21, 2026 22:33
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.

Feature request: it should source ~/.claude/CLAUDE.md on start

1 participant