compound-engineering-plugin icon indicating copy to clipboard operation
compound-engineering-plugin copied to clipboard

Plugin uses 36k tokens of context - consider splitting into smaller focused plugins

Open azolotov opened this issue 11 months ago • 5 comments

Hi, I would love to gauge what @dshipper @kieranklaassen think on this.

Problem

The compound-engineering plugin uses 36k tokens of context just by being enabled. A huge chunk of that is being taken up by skills, agents, and MCPs that are not needed in the project.

Breakdown

Category Tokens
MCP tools (Playwright + Context7) 16,400
Custom agents (30 agents) 8,600
Skills (~40 skills) ~11,000
Total ~36,000

Context Output Comparison

Without compound-engineering plugin (65k tokens, 32%)

Context Usage
⛁ ⛀ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁   claude-opus-4-5-20251101 · 65k/200k tokens (32%)
⛀ ⛀ ⛀ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛁ System prompt: 3.2k tokens (1.6%)
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛁ System tools: 16.0k tokens (8.0%)
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛁ Custom agents: 152 tokens (0.1%)
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛁ Memory files: 163 tokens (0.1%)
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛁ Messages: 8 tokens (0.0%)
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛝ ⛝ ⛝   ⛶ Free space: 135k (67.7%)
⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝   ⛝ Autocompact buffer: 45.0k tokens (22.5%)
⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝

Custom agents · /agents

Plugin
└ feature-dev:code-architect: 53 tokens
└ feature-dev:code-reviewer: 52 tokens
└ feature-dev:code-explorer: 47 tokens

Memory files · /memory
└ ~/.claude/CLAUDE.md: 86 tokens
└ CLAUDE.md: 77 tokens

Skills and slash commands · /skills

User
└ rpm-planning: 3.2k tokens
└ rpm-meeting-agendas: 3.1k tokens
└ bdd-requirements: 2.6k tokens
└ slash-command-creator: 2.2k tokens
└ az:harvest-summarize: 322 tokens
└ az:summarize-transcript: 264 tokens
└ az:commit: 211 tokens
└ az:tools: 110 tokens

Plugin
└ feature-dev:feature-dev: 1.2k tokens
└ frontend-design: 989 tokens
└ commit-commands:clean_gone: 422 tokens
└ commit-commands:commit-push-pr: 151 tokens
└ commit-commands:commit: 128 tokens

With compound-engineering plugin (101k tokens, 51%)

Context Usage
⛁ ⛀ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁   claude-opus-4-5-20251101 · 101k/200k tokens (51%)
⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁
⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛀ ⛀   ⛁ System prompt: 3.2k tokens (1.6%)
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛁ System tools: 27.8k tokens (13.9%)
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛁ MCP tools: 16.4k tokens (8.2%)
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛁ Custom agents: 8.6k tokens (4.3%)
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛁ Memory files: 163 tokens (0.1%)
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛝ ⛝ ⛝   ⛁ Messages: 8 tokens (0.0%)
⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝   ⛶ Free space: 99k (49.4%)
⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝   ⛝ Autocompact buffer: 45.0k tokens (22.5%)

MCP tools · /mcp
└ mcp__plugin_compound-engineering_context7__resolve-library-id: 893 tokens
└ mcp__plugin_compound-engineering_context7__get-library-docs: 963 tokens
└ mcp__plugin_compound-engineering_pw__browser_close: 579 tokens
└ mcp__plugin_compound-engineering_pw__browser_resize: 628 tokens
└ mcp__plugin_compound-engineering_pw__browser_console_messages: 640 tokens
└ mcp__plugin_compound-engineering_pw__browser_handle_dialog: 632 tokens
└ mcp__plugin_compound-engineering_pw__browser_evaluate: 677 tokens
└ mcp__plugin_compound-engineering_pw__browser_file_upload: 632 tokens
└ mcp__plugin_compound-engineering_pw__browser_fill_form: 782 tokens
└ mcp__plugin_compound-engineering_pw__browser_install: 597 tokens
└ mcp__plugin_compound-engineering_pw__browser_press_key: 626 tokens
└ mcp__plugin_compound-engineering_pw__browser_type: 734 tokens
└ mcp__plugin_compound-engineering_pw__browser_navigate: 604 tokens
└ mcp__plugin_compound-engineering_pw__browser_navigate_back: 584 tokens
└ mcp__plugin_compound-engineering_pw__browser_network_requests: 626 tokens
└ mcp__plugin_compound-engineering_pw__browser_run_code: 670 tokens
└ mcp__plugin_compound-engineering_pw__browser_take_screenshot: 832 tokens
└ mcp__plugin_compound-engineering_pw__browser_snapshot: 615 tokens
└ mcp__plugin_compound-engineering_pw__browser_click: 759 tokens
└ mcp__plugin_compound-engineering_pw__browser_drag: 715 tokens
└ mcp__plugin_compound-engineering_pw__browser_hover: 642 tokens
└ mcp__plugin_compound-engineering_pw__browser_select_option: 690 tokens
└ mcp__plugin_compound-engineering_pw__browser_tabs: 658 tokens
└ mcp__plugin_compound-engineering_pw__browser_wait_for: 656 tokens

Custom agents · /agents

Plugin
└ compound-engineering:workflow:spec-flow-analyzer: 527 tokens
└ compound-engineering:design:design-iterator: 526 tokens
└ compound-engineering:design:figma-design-sync: 494 tokens
└ compound-engineering:research:repo-research-analyst: 435 tokens
└ compound-engineering:review:kieran-rails-reviewer: 434 tokens
└ compound-engineering:review:kieran-typescript-reviewer: 434 tokens
└ compound-engineering:review:kieran-python-reviewer: 424 tokens
└ compound-engineering:review:dhh-rails-reviewer: 420 tokens
└ compound-engineering:review:security-sentinel: 389 tokens
└ compound-engineering:review:performance-oracle: 384 tokens
└ compound-engineering:research:best-practices-researcher: 312 tokens
└ compound-engineering:design:design-implementation-reviewer: 302 tokens
└ compound-engineering:docs:ankane-readme-writer: 295 tokens
└ compound-engineering:workflow:bug-reproduction-validator: 287 tokens
└ compound-engineering:review:pattern-recognition-specialist: 281 tokens
└ compound-engineering:research:git-history-analyzer: 279 tokens
└ compound-engineering:review:data-migration-expert: 276 tokens
└ compound-engineering:workflow:pr-comment-resolver: 273 tokens
└ compound-engineering:review:data-integrity-guardian: 271 tokens
└ compound-engineering:review:architecture-strategist: 259 tokens
└ compound-engineering:review:code-simplicity-reviewer: 257 tokens
└ compound-engineering:review:deployment-verification-agent: 255 tokens
└ compound-engineering:research:framework-docs-researcher: 251 tokens
└ compound-engineering:review:agent-native-reviewer: 231 tokens
└ compound-engineering:workflow:every-style-editor: 106 tokens
└ feature-dev:code-architect: 53 tokens
└ feature-dev:code-reviewer: 52 tokens
└ feature-dev:code-explorer: 47 tokens
└ compound-engineering:workflow:lint: 41 tokens
└ compound-engineering:review:julik-frontend-races-reviewer: 22 tokens

Memory files · /memory
└ ~/.claude/CLAUDE.md: 86 tokens
└ CLAUDE.md: 77 tokens

Skills and slash commands · /skills

User
└ rpm-planning: 3.2k tokens
└ rpm-meeting-agendas: 3.1k tokens
└ bdd-requirements: 2.6k tokens
└ slash-command-creator: 2.2k tokens
└ az:harvest-summarize: 322 tokens
└ az:summarize-transcript: 264 tokens
└ az:commit: 211 tokens
└ az:tools: 110 tokens

Plugin
└ workflows:review: 4.0k tokens
└ agent-native-architecture: 3.8k tokens
└ dspy-ruby: 3.8k tokens
└ compound-docs: 3.5k tokens
└ workflows:plan: 2.8k tokens
└ skill-creator: 2.8k tokens
└ workflows:work: 2.2k tokens
└ git-worktree: 2.1k tokens
└ triage: 1.9k tokens
└ file-todos: 1.8k tokens
└ workflows:compound: 1.7k tokens
└ create-agent-skills: 1.7k tokens
└ xcode-test: 1.6k tokens
└ gemini-imagegen: 1.5k tokens
└ release-docs: 1.5k tokens
└ dhh-ruby-style: 1.3k tokens
└ playwright-test: 1.3k tokens
└ feature-dev:feature-dev: 1.2k tokens
└ every-style-editor: 1.2k tokens
└ changelog: 1.1k tokens
└ andrew-kane-gem-writer: 1.1k tokens
└ dhh-rails-style: 1.0k tokens
└ frontend-design: 990 tokens
└ frontend-design: 989 tokens
└ generate_command: 980 tokens
└ report-bug: 934 tokens
└ heal-skill: 934 tokens
└ deploy-docs: 666 tokens
└ commit-commands:clean_gone: 422 tokens
└ resolve_todo_parallel: 283 tokens
└ resolve_pr_parallel: 272 tokens
└ resolve_parallel: 263 tokens
└ reproduce-bug: 217 tokens
└ commit-commands:commit-push-pr: 151 tokens
└ commit-commands:commit: 128 tokens
└ plan_review: 31 tokens
└ create-agent-skill: 14 tokens

With compound-engineering plugin but MCPs disabled (85k tokens, 42%)

> /context
  ⎿
      Context Usage
     ⛁ ⛀ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁   claude-opus-4-5-20251101 · 85k/200k tokens (42%)
     ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁
     ⛀ ⛀ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛁ System prompt: 3.2k tokens (1.6%)
     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛁ System tools: 27.8k tokens (13.9%)
     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛁ Custom agents: 8.6k tokens (4.3%)
     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛁ Memory files: 163 tokens (0.1%)
     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛁ Messages: 8 tokens (0.0%)
     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛝ ⛝ ⛝   ⛶ Free space: 115k (57.6%)
     ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝   ⛝ Autocompact buffer: 45.0k tokens (22.5%)
     ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝

     Custom agents · /agents

     Plugin
     └ compound-engineering:workflow:spec-flow-analyzer: 527 tokens
     └ compound-engineering:design:design-iterator: 526 tokens
     └ compound-engineering:design:figma-design-sync: 494 tokens
     └ compound-engineering:research:repo-research-analyst: 435 tokens
     └ compound-engineering:review:kieran-rails-reviewer: 434 tokens
     └ compound-engineering:review:kieran-typescript-reviewer: 434 tokens
     └ compound-engineering:review:kieran-python-reviewer: 424 tokens
     └ compound-engineering:review:dhh-rails-reviewer: 420 tokens
     └ compound-engineering:review:security-sentinel: 389 tokens
     └ compound-engineering:review:performance-oracle: 384 tokens
     └ compound-engineering:research:best-practices-researcher: 312 tokens
     └ compound-engineering:design:design-implementation-reviewer: 302 tokens
     └ compound-engineering:docs:ankane-readme-writer: 295 tokens
     └ compound-engineering:workflow:bug-reproduction-validator: 287 tokens
     └ compound-engineering:review:pattern-recognition-specialist: 281 tokens
     └ compound-engineering:research:git-history-analyzer: 279 tokens
     └ compound-engineering:review:data-migration-expert: 276 tokens
     └ compound-engineering:workflow:pr-comment-resolver: 273 tokens
     └ compound-engineering:review:data-integrity-guardian: 271 tokens
     └ compound-engineering:review:architecture-strategist: 259 tokens
     └ compound-engineering:review:code-simplicity-reviewer: 257 tokens
     └ compound-engineering:review:deployment-verification-agent: 255 tokens
     └ compound-engineering:research:framework-docs-researcher: 251 tokens
     └ compound-engineering:review:agent-native-reviewer: 231 tokens
     └ compound-engineering:workflow:every-style-editor: 106 tokens
     └ feature-dev:code-architect: 53 tokens
     └ feature-dev:code-reviewer: 52 tokens
     └ feature-dev:code-explorer: 47 tokens
     └ compound-engineering:workflow:lint: 41 tokens
     └ compound-engineering:review:julik-frontend-races-reviewer: 22 tokens

     Memory files · /memory
     └ ~/.claude/CLAUDE.md: 86 tokens
     └ CLAUDE.md: 77 tokens

     Skills and slash commands · /skills

     User
     └ rpm-planning: 3.2k tokens
     └ rpm-meeting-agendas: 3.1k tokens
     └ bdd-requirements: 2.6k tokens
     └ slash-command-creator: 2.2k tokens
     └ az:harvest-summarize: 322 tokens
     └ az:summarize-transcript: 264 tokens
     └ az:commit: 211 tokens
     └ az:tools: 110 tokens

     Plugin
     └ workflows:review: 4.0k tokens
     └ agent-native-architecture: 3.8k tokens
     └ dspy-ruby: 3.8k tokens
     └ compound-docs: 3.5k tokens
     └ workflows:plan: 2.8k tokens
     └ skill-creator: 2.8k tokens
     └ workflows:work: 2.2k tokens
     └ git-worktree: 2.1k tokens
     └ triage: 1.9k tokens
     └ file-todos: 1.8k tokens
     └ workflows:compound: 1.7k tokens
     └ create-agent-skills: 1.7k tokens
     └ xcode-test: 1.6k tokens
     └ gemini-imagegen: 1.5k tokens
     └ release-docs: 1.5k tokens
     └ dhh-ruby-style: 1.3k tokens
     └ playwright-test: 1.3k tokens
     └ feature-dev:feature-dev: 1.2k tokens
     └ every-style-editor: 1.2k tokens
     └ changelog: 1.1k tokens
     └ andrew-kane-gem-writer: 1.1k tokens
     └ dhh-rails-style: 1.0k tokens
     └ frontend-design: 990 tokens
     └ frontend-design: 989 tokens
     └ generate_command: 980 tokens
     └ report-bug: 934 tokens
     └ heal-skill: 934 tokens
     └ deploy-docs: 666 tokens
     └ commit-commands:clean_gone: 422 tokens
     └ resolve_todo_parallel: 283 tokens
     └ resolve_pr_parallel: 272 tokens
     └ resolve_parallel: 263 tokens
     └ reproduce-bug: 217 tokens
     └ commit-commands:commit-push-pr: 151 tokens
     └ commit-commands:commit: 128 tokens
     └ plan_review: 31 tokens
     └ create-agent-skill: 14 tokens

Current Architecture

Everything is bundled into one plugin:

  • Browser automation: 24 Playwright MCP tools
  • Code review agents: Rails, TypeScript, Python, DHH-style reviewers
  • Design tools: Figma sync, design iterator, design reviewer
  • Research agents: Git history, best practices, framework docs
  • Workflow tools: PR resolver, bug validator, lint, spec analyzer
  • Documentation: Ankane README writer, changelog, compound-docs
  • Style guides: DHH Ruby/Rails style, Every style editor

The Problem

It's clogging up my context with a bunch of tools I don't need. For example, in a TypeScript project, I don't need:

  • compound-engineering:review:kieran-rails-reviewer: 434 tokens
  • compound-engineering:review:kieran-python-reviewer: 424 tokens
  • compound-engineering:review:dhh-rails-reviewer: 420 tokens
  • changelog: 1.1k tokens
  • gemini-imagegen: 1.5k tokens
  • xcode-test: 1.6k tokens
  • ...

Suggested Solution

Split the plugin into focused sub-plugins within the same marketplace so that people can choose what they want and don't want.

azolotov avatar Dec 28 '25 04:12 azolotov

For now I want to keep things simple, so I keep things in one plugin. But you can disable the MCPs, especially the Playwright one—it has 15k tokens. I think it's completely reasonable to have a plugin that has 15,000 tokens. You can disable things as well so it takes fewer tokens.

I do agree that reducing tokens is good, but I don't think splitting it up is the way to go, because it just makes it harder to use the plugin. I'll keep working on reducing token sizes. I think I can improve it a bit more. But disabling Playwright is your best bet right now, and you can just disable the MCP.

kieranklaassen avatar Dec 28 '25 17:12 kieranklaassen

No idea how feasible (or even possible at the moment) it is but potentially plugin installation should guide user through a set of questions and install/enable only relevant portions - ie I don't care about rails or Imagen in my work

RBozydar avatar Dec 31 '25 07:12 RBozydar

Chiming in on this, the /workflows:plan agent eats up +200k tokens every time I run it, maxxing out my Claude Max subscription with three small features. That seems excessive.

  ⏺ 3 agents finished (ctrl+o to expand)
  ├─ compound-engineering:research:repo-research-analyst (Research repo for border group reset patterns) · 14 tool uses · 76.4k tokens
  │  ⎿  Done
  ├─ compound-engineering:research:best-practices-researcher (Research best practices for form field grouping) · 18 tool uses · 73.6k tokens
  │  ⎿  Done
  └─ compound-engineering:research:framework-docs-researcher (Research React/Formik docs for field grouping) · 15 tool uses · 85.7k tokens
  ⎿  Done

sanderfish avatar Jan 20 '26 02:01 sanderfish

I did remove the 13k playwright MCP so that will fre up the biggest chunk. Closing for now. Thanks!

kieranklaassen avatar Jan 20 '26 04:01 kieranklaassen

@kieranklaassen I would like to reopen this issue, to revisit it, if possible. I have a claude 5x plan, 100€/month which is not the cheap one, and just installed this tool in a TypeScript project (that was created using superpowers), and with just 3 plans that didn't even finish as there were critial bugs in the review phase that ended creating new plans, I reached the limit and have to wait a couple hours until I can continue. I didn't even ran the compound phase a single time. I can't imagine the consumption with complex plans. Right now this tool feels that is made just for 10x plans.

What I mean is, this tool is marvelous and I'm ultra-hyped with the promised capabilities, but is a pity that I must use the 200€ plan to manage a small TypeScript project. I started tinkering with AI and spending 200€ a month is not a hobby anymore... :-(

As a noob I'm surely doing a lot of mistakes. I think that maybe I should create a new chat each time I want to run a command, like running brainstorm, then open a new clean chat, running plan, then opening a new chat, work, new chat, review, and so on. I think (I'm not sure) that using the same chat to init next phases consumes more tokens as the context in a new chat is only 46k tokens, but the context in the chat that was running the review and reached the limit has 116k tokens (where I was running all commands, the one that created new plans after finding critical bugs in the review phase that required a big refactor). But I'm not sure if this will be a bad approach with this tool, as losing the context maybe makes the planner or reviewer "dumber"...

Any light on this will be greatly appreciated. And/or maybe adding a way to disable skills like the OP suggested, I don't know... (there's a duplicate here: https://github.com/EveryInc/compound-engineering-plugin/issues/139)

EDIT: Ah, I see another PR here already with this granular control: https://github.com/EveryInc/compound-engineering-plugin/pull/103 (lets hope that it lands). Anyway, any light on the "new chat per phase" thing will be appreciated.

Llorx avatar Jan 31 '26 23:01 Llorx