garrytan / garrytan/gstack

Sub-agents inherit full skill context, degrading performance

Open
#766 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
133k
Forks
19.9k
Avg merge
18h 46m
Merged PRs (30d)
26

Description

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)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.