Skip to content

refactor(agents): lazy-load claude templates via CLAUDE_PLUGIN_ROOT#201

Merged
8nevil8 merged 1 commit intomainfrom
refactor/claude-templates-lazy-load
Mar 6, 2026
Merged

refactor(agents): lazy-load claude templates via CLAUDE_PLUGIN_ROOT#201
8nevil8 merged 1 commit intomainfrom
refactor/claude-templates-lazy-load

Conversation

@8nevil8
Copy link
Collaborator

@8nevil8 8nevil8 commented Mar 5, 2026

Summary

Templates (claude-templates/) were previously copied into .codemie/ in the project working directory on every agent startup, polluting repositories with ephemeral files. This refactor eliminates that — templates are now read directly from the globally-installed plugin path via the existing ${CLAUDE_PLUGIN_ROOT} environment variable.

Additionally, the claude.extension.json version-tracking file was being written to .codemie/ (cwd) instead of ~/.codemie/ where it belongs alongside other CodeMie global state.

Changes

  • local-install.json: removed claude-templates/** from includes — templates are no longer copied to .codemie/ on startup
  • codemie-init.md, codemie-subagents.md, memory-refresh.md: all template path references updated from .codemie/claude-templates/${CLAUDE_PLUGIN_ROOT}/claude-templates/
  • BaseExtensionInstaller.ts: writeVersionFile and shouldUpdateLocal now use getCodemiePath('claude.extension.json') (~/.codemie/) instead of the local target directory; removed stale actualFiles directory scan
  • plugin.json: version bumped to 1.0.16
  • Tests and integration tests updated accordingly

Impact

Before: Every codemie claude startup wrote claude-templates/ + claude.extension.json into .codemie/ in the user's project directory.

After: No files written to the project directory on startup. Commands that need templates read them from ${CLAUDE_PLUGIN_ROOT}/claude-templates/ directly. Version tracking lives in ~/.codemie/claude.extension.json.

Checklist

  • Self-reviewed
  • Manual testing performed
  • Documentation updated (if needed)
  • No breaking changes (or clearly documented)

- Remove claude-templates/** from local-install.json includes so templates
  are no longer copied to .codemie/ on every agent startup
- Update codemie-init, codemie-subagents, memory-refresh commands to
  reference templates via \${CLAUDE_PLUGIN_ROOT}/claude-templates/ directly
- Move claude.extension.json version tracking from .codemie/ (cwd) to
  ~/.codemie/ so it is not written into project directories
- Simplify shouldUpdateLocal: remove stale actualFiles check now that the
  version file is no longer in the local target directory
- Bump claude plugin version to 1.0.16

Generated with AI

Co-Authored-By: codemie-ai <codemie.ai@gmail.com>
@8nevil8 8nevil8 merged commit 7dfad17 into main Mar 6, 2026
5 checks passed
@8nevil8 8nevil8 deleted the refactor/claude-templates-lazy-load branch March 6, 2026 07:54
TarasSpashchenko pushed a commit that referenced this pull request Mar 9, 2026
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.

2 participants