Skill prompt rendered twice during Skill tool definition building
Summary
When a plugin has skills, each skill is rendered twice during session initialization. With 11 skills, we see 22 Skill prompt: showing log entries instead of 11.
Reproduction
- Install a plugin with skills:
``json``
// In .claude.json plugins array:
{
"source": "https://github.com/pproenca/dot-claude",
"path": "plugins/dev-workflow"
}
- Start Claude Code with debug logging:
``bash``
claude --debug
- Check
~/.claude/debug/*.txtfor duplicate skill rendering
Debug Log Evidence
Session Timeline (lines 137-229)
Line 137: SessionStart hook triggered
Line 143: SubagentStart with query: Explore ← First subagent launched
Line 146: SubagentStart with query: Plan ← Second subagent launched (parallel)
Line 202: Stream started - received first chunk ← Stream 1 begins
Line 203: Stream started - received first chunk ← Stream 2 begins (17ms later)
Lines 204-214: [First batch: 11 skill prompts rendered]
Line 215: Skills and commands included in Skill tool: [summary]
Lines 216-226: [Second batch: same 11 skill prompts rendered again]
Lines 227-229: SubagentStop hook triggered
Actual Log Output (lines 202-226)
2025-12-30T19:27:27.287Z [DEBUG] Stream started - received first chunk
2025-12-30T19:27:27.304Z [DEBUG] Stream started - received first chunk
2025-12-30T19:27:27.425Z [DEBUG] Skill prompt: showing "dev-workflow:test-driven-development"
2025-12-30T19:27:27.425Z [DEBUG] Skill prompt: showing "dev-workflow:pragmatic-architecture"
2025-12-30T19:27:27.425Z [DEBUG] Skill prompt: showing "dev-workflow:testing-anti-patterns"
2025-12-30T19:27:27.425Z [DEBUG] Skill prompt: showing "dev-workflow:systematic-debugging"
2025-12-30T19:27:27.425Z [DEBUG] Skill prompt: showing "dev-workflow:finishing-a-development-branch"
2025-12-30T19:27:27.425Z [DEBUG] Skill prompt: showing "dev-workflow:root-cause-tracing"
2025-12-30T19:27:27.425Z [DEBUG] Skill prompt: showing "dev-workflow:getting-started"
2025-12-30T19:27:27.425Z [DEBUG] Skill prompt: showing "dev-workflow:condition-based-waiting"
2025-12-30T19:27:27.425Z [DEBUG] Skill prompt: showing "dev-workflow:receiving-code-review"
2025-12-30T19:27:27.425Z [DEBUG] Skill prompt: showing "dev-workflow:verification-before-completion"
2025-12-30T19:27:27.425Z [DEBUG] Skill prompt: showing "dev-workflow:defense-in-depth"
2025-12-30T19:27:27.425Z [DEBUG] Skills and commands included in Skill tool: [16 items listed]
2025-12-30T19:27:27.425Z [DEBUG] Skill prompt: showing "dev-workflow:test-driven-development"
2025-12-30T19:27:27.425Z [DEBUG] Skill prompt: showing "dev-workflow:pragmatic-architecture"
2025-12-30T19:27:27.425Z [DEBUG] Skill prompt: showing "dev-workflow:testing-anti-patterns"
2025-12-30T19:27:27.425Z [DEBUG] Skill prompt: showing "dev-workflow:systematic-debugging"
2025-12-30T19:27:27.425Z [DEBUG] Skill prompt: showing "dev-workflow:finishing-a-development-branch"
2025-12-30T19:27:27.425Z [DEBUG] Skill prompt: showing "dev-workflow:root-cause-tracing"
2025-12-30T19:27:27.425Z [DEBUG] Skill prompt: showing "dev-workflow:getting-started"
2025-12-30T19:27:27.425Z [DEBUG] Skill prompt: showing "dev-workflow:condition-based-waiting"
2025-12-30T19:27:27.425Z [DEBUG] Skill prompt: showing "dev-workflow:receiving-code-review"
2025-12-30T19:27:27.425Z [DEBUG] Skill prompt: showing "dev-workflow:verification-before-completion"
2025-12-30T19:27:27.425Z [DEBUG] Skill prompt: showing "dev-workflow:defense-in-depth"
Key Observations
- Same timestamp: All 22 skill renders occur at exactly
19:27:27.425Z(sub-millisecond)
- Asymmetric pattern: Summary log appears after first batch only, not after second batch
- Two subagents launched: Explore and Plan agents start in parallel (lines 143, 146)
- Two streams started: Lines 202-203 show two streams beginning
The Question
Two subagents were launched, each with its own context window. We see skills rendered twice.
Is this expected behavior?
- If yes: Each subagent legitimately needs its own Skill tool definition
- If no: There's a bug causing double rendering within a single process
Why we're unsure: The summary log only appears once (after first batch), not twice. If two independent subagents were each building tool definitions, we'd expect two summaries.
Impact
| Metric | Value |
|--------|-------|
| Skills in plugin | 11 |
| Actual renders | 22 |
| Overhead | 100% |
| Performance | Minimal (<1ms total) |
| Scales with | Number of skills × number of subagents |
Environment
- Claude Code: 2.0.76
- Platform: macOS (Darwin 24.6.0)
- Plugin: pproenca/dot-claude (plugins/dev-workflow)
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗