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
Skills descriptions bloat system prompt (~600KB / ~150K tokens), breaking Bedrock and small-context models #20647
OpenCode injects ALL installed skill descriptions (name + description XML blocks) into the system prompt on every request, regardless of whether they're needed. With ~1,500 skills from opencode-skills-antigravity, this adds ~580KB / ~147K tokens to every system prompt.
This causes:
BadRequestError on AWS Bedrock models (Kimi K2.5, Qwen3 480B, Qwen3 30B) when the total prompt exceeds their 262K token context window
56% of the context window consumed before the user even types anything
All models in the fallback chain exhausted, resulting in "All configured models are currently unavailable"
Multi-turn conversations with tool results fail even faster as context accumulates
Evidence
From NadirClaw raw request logs:
system_prompt_length: 595,269 chars (595KB)
OpenCode's own instructions: ~9KB
Skill descriptions: ~580KB (1,539 <skill> XML blocks)
CLAUDE.md user config: ~5KB
Approximate tokens: ~148,817 (56% of 262K context window)
Expected behavior
Skill descriptions should NOT be injected into the system prompt. Skills should be loaded on-demand via the skill tool, with only a lightweight index (skill names) available for discovery.
Environment
OpenCode with opencode-skills-antigravity plugin (~1,330 skills)
NadirClaw proxy routing to AWS Bedrock (eu-west-2)
Models: Kimi K2.5, Qwen3 480B, Qwen3 30B (all 262K context)
LiteLLM 1.83.0
Workaround
Move skills out of ~/.config/opencode/skills/ to a directory that OpenCode's built-in scanner doesn't check. Use @zenobius/opencode-skillful plugin for lazy discovery from the alternate path.
This issue might be a duplicate of existing issues. Please check:
[FEATURE]: Lazy-load agent/skill lists instead of inlining into tool descriptions #13188: Describes the same root problem — skill and agent descriptions being statically inlined into tool descriptions on every turn, with the same proposed solution of lazy/on-demand loading. That issue includes code-level analysis of skill.ts and task.ts, and proposes a two-step discovery pattern identical to what you're requesting.
If your issue is specifically about the scale of the problem (1,500+ skills from a large skill pack exhausting the context window entirely vs. the more modest overhead described in #13188), it may be worth adding a comment there with your evidence and environment details rather than tracking it separately.
ZAP's skill system is built around this exact problem — skills are
keyword-triggered, only the matching ones inject per turn. 100
skills installed = ~0 tokens overhead unless your message triggers
them.
Activity
github-actions commentedon Apr 2, 2026
This issue might be a duplicate of existing issues. Please check:
skill.tsandtask.ts, and proposes a two-step discovery pattern identical to what you're requesting.If your issue is specifically about the scale of the problem (1,500+ skills from a large skill pack exhausting the context window entirely vs. the more modest overhead described in #13188), it may be worth adding a comment there with your evidence and environment details rather than tracking it separately.
eugenio commentedon Apr 2, 2026
Closing as duplicate of #13188 — added evidence and measurements there.
sanjeev23oct commentedon Jun 17, 2026
ZAP's skill system is built around this exact problem — skills are
keyword-triggered, only the matching ones inject per turn. 100
skills installed = ~0 tokens overhead unless your message triggers
them.
https://github.com/zap-coding-agent/zap-coding-agent