Skip to content

fix(install): ship dormant identity imports as HTML comments so they stop loading before ActivateImports - #2298

Open
Simonvm9114 wants to merge 1 commit into
danielmiessler:mainfrom
Simonvm9114:fix/dormant-imports
Open

Simonvm9114 wants to merge 1 commit into
danielmiessler:mainfrom
Simonvm9114:fix/dormant-imports

Conversation

@Simonvm9114

Copy link
Copy Markdown

Fixes #2296.

CLAUDE.template.md shipped the five identity imports "dormant" as # @LIFEOS/USER/..., on the assumption (stated in activateImports()) that Claude Code skips an @path that is not at line start. It does not: # @path is a heading and the @path in it is resolved. So every session loaded the USER sample templates (principal "User", timezone America/Los_Angeles, DA "LifeOS", "(sample)" TELOS goals) from the moment CLAUDE.md was placed, before the Interview or ActivateImports ran.

Change

  • install/CLAUDE.template.md (and its copy in install/skills/LifeOS/install/): the five lines ship as <!-- @LIFEOS/USER/... -->. activateImports() already accepts that form, so activation needs no code change.
  • Tools/InstallEngine.ts (both copies): the comment above the dormant-import regex now explains why the HTML form is used. The # @ form is still matched, so CLAUDE.md files from existing installs keep activating.
  • Workflows/Setup.md (both copies): step 4 describes the new dormant form.

Verification (Claude Code 2.1.291, Windows 11)

A project folder with CLAUDE.md copied from the new template, plus code words in LIFEOS/USER/TELOS/PRINCIPAL_TELOS.md and LIFEOS/USER/PROJECTS.md:

  1. Before activation, claude -p asked to list code words in its loaded instructions answers NONE. With the old # @ form the same probe returns the word (see the issue).
  2. activateImports(<CLAUDE.md>, <folder>) returns activated: [PRINCIPAL_TELOS, PROJECTS], with the other three skipped because their files do not exist.
  3. After activation, the same probe returns both code words.

🤖 Generated with Claude Code

…2296)

CLAUDE.template.md shipped its five identity imports "dormant" as
`# @LIFEOS/USER/...`, on the assumption that Claude Code skips an @path
that is not at line start. It does not: `# @path` is a heading, and the
@path in it is resolved. Every session therefore loaded the USER sample
templates (principal "User", timezone America/Los_Angeles, DA "LifeOS",
"(sample)" TELOS goals) from the moment CLAUDE.md was placed, before the
Interview or ActivateImports ran.

- CLAUDE.template.md (both shipped copies): the five lines now ship as
  `<!-- @LIFEOS/USER/... -->`, the form activateImports() already accepts.
- InstallEngine.ts (both copies): the comment above the dormant-import
  regex now says why the HTML form is used. The `# @` form is still
  matched so CLAUDE.md files from older installs keep activating.
- Setup.md (both copies): step 4 describes the new dormant form.

Verified end to end with Claude Code 2.1.291 on Windows 11: a project
CLAUDE.md copied from the new template, with code words in
LIFEOS/USER/TELOS/PRINCIPAL_TELOS.md and LIFEOS/USER/PROJECTS.md, loads
neither word; after activateImports() rewrites the two lines (the other
three are skipped because their files do not exist), Claude sees both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MatiasBarboza

Copy link
Copy Markdown

Same file, one line this PR leaves alone. Line 19 of CLAUDE.template.md says the five identity files "are commented out above" and that /LifeOS setup uncomments them. ActivateImports does uncomment the import lines. It never touches that sentence, so every install that finished setup keeps a CLAUDE.md telling the model its identity files are inactive while they load in every session.

Repro on a clean v7.40.4 clone. Copy LifeOS/install/CLAUDE.template.md into a temp root as CLAUDE.md, create the five USER files it imports, then run bun LifeOS/Tools/ActivateImports.ts --config-root <tmp> --apply. It reports ok: true with 5 activated, and lines 9-13 lose their # prefix. Line 19 still reads "are commented out above".

Negative control: before the --apply run, lines 9-13 do start with # , so the sentence matches the file. It goes false only after activation.

Small stakes, but real. A model that reads that line can decide identity isn't loaded and suggest re-running setup. Two cheap fixes: word the sentence so it covers both states ("ship commented out, ActivateImports enables each one once its target exists"), or have ActivateImports rewrite it. Since this PR already edits the template and InstallEngine, it fits here if you'd rather keep it in one place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants