Skip to content

feat(compat): read a Claude Code user's assets in place - #227

Merged
oratis merged 1 commit into
mainfrom
feat/claude-compat
Aug 3, 2026
Merged

feat(compat): read a Claude Code user's assets in place#227
oratis merged 1 commit into
mainfrom
feat/claude-compat

Conversation

@oratis

@oratis oratis commented Aug 3, 2026

Copy link
Copy Markdown
Owner

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. Five steps of grit in front of npm i -g deepcode-cli && deepcode, on the path most new users arrive by.

Read in place

Source Behaviour
~/.claude/settings.json used when ~/.deepcode/settings.json doesn't exist
~/.claude/CLAUDE.md loaded as user memory
CLAUDE.md anywhere in the cwd → root walk loaded before DEEPCODE.md at each level, so DeepCode's wins
~/.claude/skills/ DeepCode's own shadows a same-named skill
~/.claude/agents/ likewise

Settings is a fallback, not a fifth layer: the moment ~/.deepcode/settings.json exists 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.json is 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

loadFromDir pushed unconditionally in both the skills and sub-agent loaders. Two skills with the same name were both described to the model, and findAgent'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-directory opt-out, and the project .claude exclusion. pnpm typecheck · lint · format:check clean; 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

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>
@oratis
oratis merged commit 8edb24f into main Aug 3, 2026
5 checks passed
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