Skip to content

7.40.4: the "dormant" identity imports in CLAUDE.template.md load anyway — Claude Code resolves # @path, so every session loads the USER sample templates before ActivateImports runs (CLAUDE.template.md:9-13) #2296

Description

@Simonvm9114

Version

LifeOS 7.40.4 (repo main at 5e2f2e8) / install/CLAUDE.template.md + ActivateImports

What is broken

CLAUDE.template.md ships the five identity imports "dormant" as # @LIFEOS/USER/..., to be switched on later by ActivateImports once the USER tree is populated. The comment in activateImports() states the assumption behind that form: hash-prefixed so the @ isn't at line-start and Claude Code skips it. Claude Code does not skip it. A line # @path is a Markdown heading, and the @path in it is resolved as an import. So from the moment CLAUDE.md is in place, every session loads all five USER files. Before the Interview, those are the shipped sample templates: principal "User", timezone America/Los_Angeles, DA named "LifeOS", "(sample)" TELOS goals, about 3k tokens of placeholder identity steering every session. The dormant state the installer relies on never exists, and ActivateImports only removes a # that had no effect.

Where (file:line)

  • Writer: LifeOS/install/CLAUDE.template.md:9-13: # @LIFEOS/USER/TELOS/PRINCIPAL_TELOS.md … # @LIFEOS/USER/CONFIG/OPERATIONAL_RULES.md
  • Reader: LifeOS/Tools/InstallEngine.ts:751-755: activateImports() comment and regex; the regex already accepts the <!-- @path --> form

Repro on a clean tree

Minimal, independent of any install:

mkdir import-probe; cd import-probe
printf '# Probe\n\n# @marker.md\n' > CLAUDE.md
echo 'The probe code word is PELICAN-7.' > marker.md
echo 'The control code word is OSPREY-3.' > control.md
claude -p "Without using any tools: do you see a code word in your loaded instructions or memory files? Reply with each code word you see, or NONE."
# Observed: PELICAN-7 (from the "dormant" # @marker.md line). OSPREY-3, referenced nowhere, is not seen.

On a LifeOS install: after DeployCore places CLAUDE.md from the template and ScaffoldUser/LinkUser create the USER tree, but before ActivateImports or the Interview, start any Claude Code session. The session's loaded instruction files include LIFEOS/USER/TELOS/PRINCIPAL_TELOS.md and the other four, with their "🎯 SAMPLE TEMPLATE" / "INTERVIEW REQUIRED" bodies.

Negative control

Claude Code 2.1.291 on Windows 11, unpatched 7.40.4 template form: the minimal probe above answers PELICAN-7, so a # @path line is resolved as an import. On a 7.40.4 install, before ActivateImports ran, the loaded instruction files at session start included the five USER templates with "Name: User", "Timezone: America/Los_Angeles" and the "(sample)" TELOS entries.

The same probe with the import line written as <!-- @marker.md --> answers NONE, and so does # `@marker.md` (code span). Both forms are genuinely not loaded.

Suggested fix

Ship the dormant lines in the HTML-comment form, which activateImports() already recognises and rewrites (InstallEngine.ts:755, second alternative):

-# @LIFEOS/USER/TELOS/PRINCIPAL_TELOS.md
+<!-- @LIFEOS/USER/TELOS/PRINCIPAL_TELOS.md -->

(and the same for the other four lines), plus updating the comment at InstallEngine.ts:751-753 and the template prose that describes the # form. Tested only as far as the probe above: the <!-- @path --> form is not loaded by Claude Code 2.1.291. I have not run ActivateImports against a template edited this way, though the regex at line 755 matches it.

Before submitting

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions