You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE] Reduce initial system prompt token overhead (~68k tokens before first user message) #26661
In a fresh OpenCode session with a standard setup (Sisyphus agent, ~100 skills, 50+ tools), the token count before the user sends a single message is approximately 68,000 tokens. This is ~99% system overhead.
Breakdown:
Skill descriptions: 100+ skills with full descriptions inlined in system prompt
Agent behavior instructions: Full Phase 0-3 orchestration rules
Using-superpowers skill: Injected inline at session start
For comparison, Claude Code's system prompt is ~10-15k tokens for the first message.
Impact
With a typical 128k context window:
Effective conversation space: ~60k tokens (less than half the window)
Faster context exhaustion → more frequent compressions → potential loss of context
Higher API costs per conversation turn (system prompt sent every time)
Shorter productive sessions before hitting context limits
Proposed Solutions
1. Lazy-load skill descriptions
Currently all 100+ skill names + descriptions are inlined. Only inject skill names initially, and load full descriptions on-demand when skill tool is invoked. This could save ~10-15k tokens.
2. Tool schema compression
Only inline tool schemas for tools the current agent type is likely to use
Or use abbreviated schemas with a "full schema on demand" mechanism
Some tools (e.g., full Playwright suite with 20+ methods) are rarely all used in one session
3. Agent instruction modularization
The Sisyphus Phase 0-3 behavior instructions are verbose. Consider:
Loading detailed instructions only when the agent type is Sisyphus
Providing a compressed version for simpler agent types (Sisyphus-Junior, explore, etc.)
Subagents already have scoped instructions; the orchestrator pays the full cost
4. Skill content injection optimization
The using-superpowers skill content is injected with <EXTREMELY_IMPORTANT> tags at session start. Consider deferring this until a skill is actually matched/needed.
Please review these issues to see if your request is already covered or can be addressed there. If you believe this is distinct, feel free to clarify how it differs.
ZAP takes the opposite approach to this — skills lazy-load and only
inject when keywords match your message, MCP schemas stay out of
context until the model explicitly connects them. Base overhead for
a greeting is ~31 tokens.
Activity
github-actions commentedon May 10, 2026
This issue might be a duplicate of existing issues. Please check:
Please review these issues to see if your request is already covered or can be addressed there. If you believe this is distinct, feel free to clarify how it differs.
sanjeev23oct commentedon Jun 17, 2026
ZAP takes the opposite approach to this — skills lazy-load and only
inject when keywords match your message, MCP schemas stay out of
context until the model explicitly connects them. Base overhead for
a greeting is ~31 tokens.
Might be worth a look if the overhead here is a blocker:
https://github.com/zap-coding-agent/zap-coding-agent