Skip to content

[upstream] [compat.claude] is inert for instructions and agents (Grok CLI 1.0.5) #34

Description

@johnsmalls22-rgb

[upstream] [compat.claude] is inert for instructions and agents (Grok CLI 1.0.5)

Grok 1.0.5 still autoloads ~/.claude/rules/*.md and ~/.claude/agents/*.md after every [compat.claude] key is set to false. grok inspect echoes the flags as enabled: false, source: config and then loads the files anyway.

This is filed here because xai-org/grok-build has issues disabled. It is an upstream Grok CLI discovery bug, not a plugin bug.

Expected

With ~/.grok/config.toml:

[compat.claude]
skills = false
rules = false
agents = false
mcps = false
hooks = false
sessions = false

grok inspect --json at a home-root workspace should load only native Grok / project instruction files (~/.grok/Agents.md, cwd Agents.md / Claude.md). It should not load ~/.claude/rules/*.md or ~/.claude/agents/*.md.

Actual

grok inspect --json reports externalCompat.claude.*.enabled = false and still loads:

  • ~/.claude/CLAUDE.md
  • every ~/.claude/rules/*.md (nine files in this install)
  • ~/.claude/agents/critic.md and evaluator.md

Measured: 13 Project Instructions / ~10k tokens instead of the intended 3 / ~1.5k.

Repro (Windows, Grok CLI 1.0.5 stable)

All of these were run with the config above.

# Test Result
A grok inspect --json from a cwd that contains no .claude directory Still loads all ~/.claude/rules files + both agents. Load is ~-anchored, not cwd-relative.
B USERPROFILE / HOME pointed at an empty profile, GROK_HOME preserved Unchanged. Windows does not move ~ via those env vars.
C GROK_HOME pointed at an isolated config dir Drops ~/.grok/Agents.md as expected. Keeps all ~/.claude files + both agents. GROK_HOME moves the config dir only.
D CLI flag --rules only appends. No --no-rules. [skills] ignore covers skills only.
E Rename ~/.claude/rules~/.claude/shared-rules and ~/.claude/agents~/.claude/shared-agents Not discovered. Scan is name-keyed on the literal directories rules and agents under ~/.claude.

Probe that decided (E): two throwaway dirs ~/.claude/zzprobe-rules/ and ~/.claude/zzprobe-agents/ with one inert file each were not loaded. Discovery is not a recursive scan of ~/.claude; it is keyed to those two names.

Docs gap

README § Claude Code Compatibility says Grok automatically discovers Claude Code directories and “No extra setup is needed.” It documents no disable switch. [compat.claude] does not appear in the README. The pickup table lists CLAUDE.md and .claude/CLAUDE.md; it does not list ~/.claude/rules/, which is where the nine extra files were coming from.

User-guide 12-project-rules.md says ~/.claude/rules/ is “Controlled by compat.claude.rules”. On 1.0.5 that control does not subtract.

Ask

Honor [compat.claude].rules and [compat.claude].agents as a subtractive switch, or document that they are additive-only and that the only way to stop the load is to not have directories named rules / agents under ~/.claude.

Workaround in use: rename those directories. That is a topology hack, not a supported isolation switch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions