Skip to content

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

Closed

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

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Apr 2, 2026
  2. github-actions commented on Apr 2, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    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.

  3. eugenio commented on Apr 2, 2026

    @eugenio
    Author

    Closing as duplicate of #13188 — added evidence and measurements there.

  4. sanjeev23oct commented on Jun 17, 2026

    @sanjeev23oct

    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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions