Skip to content

Sub-agents inherit full skill context, degrading performance #766

Closed

Description

@MartinRamdane

When Claude spawns sub-agents (via the Agent tool), each sub-agent receives the entire gstack context in its system prompt — all skill descriptions, instructions, and MCP tool listings. This
significantly bloats the sub-agent's context window, leaving less room for the actual task and degrading output quality.

Expected behavior:
Sub-agents should receive a minimal context — only what's relevant to their specific task. Skills and MCP tool listings that aren't needed by the sub-agent should be excluded or lazily loaded.

Current behavior:
Every sub-agent gets the full list of 50+ skill descriptions, MCP server instructions, and all deferred tool names, regardless of whether they're relevant. A simple "Explore" agent searching for a
file pattern gets the same gstack payload as the main conversation.

Impact:

  • Sub-agents produce worse results due to context dilution
  • Slower responses from processing unnecessary tokens
  • Makes complex multi-agent workflows (parallel research, test runners) less reliable

Possible approaches:

  • Filter system-reminder content before injecting into sub-agent prompts
  • Only pass skills/tools that match the sub-agent type
  • Lazy-load skill descriptions (keep only names, fetch full description on demand)

Activity

  1. time-attack commented on Jul 15, 2026

    @time-attack
    Contributor

    @16francej Please close this issue as resolved for GStack. #1712 removed most long routing prose from always-loaded skill metadata and cut that context by more than half. Any remaining host-added context belongs upstream.

  2. capy-ai commented on Oct 8, 2026

    @capy-ai
    Contributor

    Thanks for raising this. #1712 cut always-loaded skill metadata by about 56%, so sub-agents inherit far less context. Closing; please open a new issue with numbers if bloat is still a problem.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions