Feature: Lazy loading for plugins to reduce context overhead

Resolved 💬 3 comments Opened Jan 6, 2026 by johnb-datavant Closed Jan 10, 2026

Problem

Plugins load all their agents, skills, and MCP tools into context at session start, even when they won't be used. For feature-rich plugins like compound-engineering, this can consume 8-15% of available context (15k+ tokens) before the user even types anything.

Current Workaround

Users must:

  1. Disable the plugin in settings.json
  2. Use --settings '{"enabledPlugins":{"plugin@marketplace":true}}' via alias when needed

This works but is clunky.

Proposed Solution

Add lazy/on-demand plugin loading. Options could include:

  1. --enable-plugin <name> CLI flag - Enable a disabled plugin for this session only (inverse of current behavior)
  1. Lazy discovery mode - Only load plugin name/description at startup; load full agents/skills/MCP when first invoked
  1. Per-project plugin configs - Allow .claude/settings.local.json to override which plugins are enabled for specific projects
  1. Plugin profiles - Define named plugin sets (e.g., claude --profile heavy vs default lite)

Use Case

I use compound-engineering for complex code reviews and planning workflows, but not for quick queries. Currently I either:

  • Pay the 15k token tax every session, or
  • Maintain shell aliases with JSON overrides

A first-class solution would improve UX significantly.

Environment

  • Claude Code version: latest
  • OS: macOS

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗