Conversation
…sessions
The Claude model running inside an OpenCode session does not honor
SOUL.md/MEMORY.md content composed into AGENTS.md alone — empirically
it self-reports the DM bundle as 'not in context'. A side-by-side
fresh session with the same config running glm-5.1 self-identifies
as 'Extra Chill Bot' with phrasing pulled from SOUL.md.
OpenCode reads both AGENTS.md and CLAUDE.md from cwd (it globs
["AGENTS.md", "CLAUDE.md", "CONTEXT.md"], deduped), so writing
CLAUDE.md is purely additive. Claude Code reads only CLAUDE.md.
The fix symlinks CLAUDE.md → AGENTS.md (relative target) so:
- upgrade.sh Phase 5 self-heals the symlink after every compose
- runtimes/opencode.sh fresh installs create the symlink at first run
- claude-code/studio-code runtimes that ship a real CLAUDE.md are
left untouched (the helper only acts when CLAUDE.md is missing
or already a symlink)
Closes #108
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.
Closes #108
Problem
upgrade.shPhase 5 regeneratesAGENTS.mdviawp datamachine memory compose, butCLAUDE.mdis only generated byhooks/dm-agent-sync.shwhich is gated to Claude Code's SessionStart hook. On opencode-runtime + kimaki-bridge installs,CLAUDE.mdis never created.Empirical evidence
On the extrachill.com VPS, a fresh OpenCode session running
claude-opus-4-7does not honor SOUL.md/MEMORY.md content and self-reports the DM bundle as "not in context." A side-by-side fresh session with the same config runningglm-5.1self-identifies as "Extra Chill Bot" with phrasing pulled directly from SOUL.md.AGENTS.md alone is insufficient for the Claude model — CLAUDE.md is needed.
Why a symlink (Option 3)
Three options were considered in #108:
datamachine memory compose CLAUDE.mdalongside AGENTS.md. Risks drift if one compose succeeds and the other fails, plus duplicated bytes on disk.dm-agent-sync.shout of the Claude Code SessionStart gate and run it for opencode too. Larger blast radius, requires reworking the runtime hook contract.OpenCode source globs
["AGENTS.md", "CLAUDE.md", "CONTEXT.md"]upward from cwd (deduped), so writing CLAUDE.md is purely additive — it does not break opencode users and gives Claude-model users the context they need.Changes
upgrade.shPhase 5After
wp datamachine memory compose AGENTS.mdsucceeds, ensureCLAUDE.md → AGENTS.mdsymlink exists. Dry-run path prints the would-be action. Skips whenCLAUDE.mdis a regular file (claude-code/studio-code runtimes ship their own template-based CLAUDE.md).runtimes/opencode.sh::runtime_generate_instructionsFresh installs via the opencode runtime now also create the symlink — both on the compose-success path and on the static-template fallback path. Extracted into helper
_opencode_symlink_claude_mdso it is called from every code path that writes AGENTS.md, including the "AGENTS.md already exists, skipping" branch (so existing installs get the symlink on next run even without a regeneration).Scope
--agents-md-only(verified via dry-run, see below)ln -sf AGENTS.md CLAUDE.mdfrom$SITE_PATH) — survives directory movesln -sfoverwrites an existing symlink, helper guards against clobbering a realCLAUDE.mdfileVerification
./upgrade.sh --dry-run --agents-md-onlyon extrachill.com:bash -nsyntax check passes on both modified files.git diff origin/mainshows ONLY the symlink addition + dry-run handling. No unrelated edits.Acceptance criteria (from #108)
CLAUDE.mdexists afterupgrade.shrunsCLAUDE.mdcontent is identical toAGENTS.md(it is the same file via symlink)upgrade.shruns (idempotent)CLAUDE.mdare not clobbered--agents-md-onlyscope flag covers the symlink (it is part of Phase 5, not gated separately)