feat(compat): read a Claude Code user's assets in place - #227
Merged
Conversation
Finding F14 in docs/THREE_WAY_REVIEW.md. CLAUDE.md was not loaded by the memory loader at all — it was only checked for existence, to decide whether to suggest /init. Everything else required `mv ~/.claude/... ~/.deepcode/...` first. That is five steps of grit in front of `npm i -g deepcode-cli && deepcode`, on the one path most new users arrive by. Now read in place: ~/.claude/settings.json when ~/.deepcode/settings.json doesn't exist ~/.claude/CLAUDE.md as user memory CLAUDE.md anywhere in the cwd → root walk ~/.claude/skills/ with DeepCode's own winning a name collision ~/.claude/agents/ likewise Settings is a fallback, not a fifth layer: the moment ~/.deepcode/settings.json exists it wins outright, so provenance still names one real file and the trust gate still sees exactly the layers it knows about. A project's .claude/settings.json is deliberately NOT read — project settings pass through the directory-trust gate, and widening what that gate covers is not a change to make in passing. Fixes a latent bug found on the way: loadFromDir pushed unconditionally, so two skills with the same name were both described to the model, and findAgent's .find() resolved a duplicated agent name to whichever directory was scanned first. Both loaders are now first-definition-wins, and callers load in precedence order. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Finding F14 in
docs/THREE_WAY_REVIEW.md.CLAUDE.mdwas not loaded by the memory loader at all — it was only checked for existence, to decide whether to suggest/init. Everything else requiredmv ~/.claude/... ~/.deepcode/...first. Five steps of grit in front ofnpm i -g deepcode-cli && deepcode, on the path most new users arrive by.Read in place
~/.claude/settings.json~/.deepcode/settings.jsondoesn't exist~/.claude/CLAUDE.mdCLAUDE.mdanywhere in the cwd → root walkDEEPCODE.mdat each level, so DeepCode's wins~/.claude/skills/~/.claude/agents/Settings is a fallback, not a fifth layer: the moment
~/.deepcode/settings.jsonexists it wins outright — no silent merge. Provenance keeps naming one real file, and the trust gate keeps seeing exactly the layers it already knows about.A project's
.claude/settings.jsonis deliberately not read. Project settings pass through the directory-trust gate; widening what that gate covers is not a change to make in passing. There's a test asserting it stays unread.A latent bug on the way
loadFromDirpushed unconditionally in both the skills and sub-agent loaders. Two skills with the same name were both described to the model, andfindAgent's.find()resolved a duplicated agent name to whichever directory happened to be scanned first. Both are now first-definition-wins with callers loading in precedence order — which is also what makes the shadowing above well-defined.Verification
11 new tests covering each source, the precedence in both directions, provenance honesty, the explicit-
directoryopt-out, and the project.claudeexclusion.pnpm typecheck·lint·format:checkclean; core 729/16 skipped · cli 204 · desktop 90 · server 41 · protocol 24 · vscode 12 · lsp 13 · scripts 21. The migration guide now leads with what works without moving anything.🤖 Generated with Claude Code