Skip to content

Skills descriptions bloat system prompt (~600KB / ~150K tokens), breaking Bedrock and small-context models #20647

@eugenio

Description

@eugenio

Problem

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.

Related issues

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions