Repository navigation
fix(worker): keep device instruction files out of threads - #214
Merged
Merged
Conversation
Exclude Claude user memory and ancestor instructions with claudeMdExcludes while retaining HOME and login discovery. Keep Codex and Grok thread HOME, USERPROFILE and XDG paths intact so shell tools retain device configuration; private homes remain limited to bots. Disable discovered device Codex skills with native path selectors and bound scratch root discovery. Isolate Grok configuration, disable compatibility context and memory, and ignore home-level .agents skills. Document Codex process snapshots and Grok compatibility scope limits. Capture real CLI requests for scratch and project threads with empty and assigned instructions, verify library skills and project rules, and check thread subprocess git identity with temporary homes. Retain bot isolation coverage.
This was referenced Nov 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Platform threads no longer read the device owner's global instruction files. A new scratch thread on a Mac quoted the owner's
~/.claude/CLAUDE.md(rules about a plugin that the thread does not have).Cause: Claude Code (CLI 2.1.308, Agent SDK 0.3.316) loads global user memory (
~/.claude/CLAUDE.md) andCLAUDE.mdfiles from parent directories even withsettingSources: ["project", "local"]. A real-CLI capture of scratch and project threads contained both fixture texts.Fix
claudeMdExcludesfor the device's~/.claude/**and forCLAUDE.md,CLAUDE.local.md,AGENTS.mdand.claude/**in every directory above the workspace root. Instructions inside the workspace or repo stay.HOMEand the login setup are unchanged, so macOS Keychain sign-in is not affected.HOME,USERPROFILEand XDG paths, so git identity, SSH keys,ghand tool configs keep working in agent shells. The device's skills are left out through Codex's own skill-path settings; library skills in the isolatedCODEX_HOMEstay. Scratch threads useproject_root_markers: [], so noAGENTS.mdabove them is collected.GROK_HOME, the compatibility flags and[skills].ignorekeep global context out. Grok's native rules and root instruction files stay.Limitations
Tests:
apps/worker/src/providers/instruction-isolation.test.tscaptures requests from the real Claude, Codex and Grok CLIs for scratch and project threads, using a temporaryHOMEwith fixture files. It checks that:HOMEand git identity.Bot isolation tests pass.
check:tmp: 1398 passed, 0 failed.Docs:
agent-environment.md,claude-adapter.md,codex-adapter.md,grok-adapter.md,worker-config.md.Copy audit: no UI text changed.