claude-code - 💡(How to fix) Fix Custom slash commands that chain other slash commands drop remaining steps after the first nested invocation [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#47140Fetched 2026-04-13 05:40:24
View on GitHub
Comments
2
Participants
2
Timeline
6
Reactions
0
Author
Timeline (top)
labeled ×4commented ×2

When a user-defined slash command instructs Claude to run multiple nested slash commands in sequence, Claude reliably stops after the first nested command completes and returns to the user instead of continuing with the remaining steps in the parent plan.

Root Cause

When Claude invokes a nested skill via the Skill tool, the sub-skill's prompt becomes the dominant instruction in context. After the sub-skill completes, Claude treats the parent command's remaining steps as already-satisfied because the sub-skill's own "execute this plan" instruction was the most recent one followed. The @CLAUDE: Execute each command fully before moving to the next instruction in the parent skill is a prompt nudge the harness does not enforce.

Fix Action

Workaround

I've edited my local end-session.md to include an explicit reminder block and step 3 that verifies all three artifacts landed before returning to the user. That cut the failure rate for me personally, but I can tell it's still a model-discipline problem — the instruction has to be repeated in every chain-parent command rather than being a harness guarantee.

Code Example

# command: end-session

   Run all three session wrap-up commands in sequence.

   Steps:
   1. Execute `/update-brain`
   2. Execute `/update-daily`
   3. Execute `/update-memory`

   @CLAUDE: Execute each command fully before moving to the next.
RAW_BUFFERClick to expand / collapse

Summary

When a user-defined slash command instructs Claude to run multiple nested slash commands in sequence, Claude reliably stops after the first nested command completes and returns to the user instead of continuing with the remaining steps in the parent plan.

Reproduction

  1. Create ~/.claude/commands/end-session.md containing a chain of three sub-commands:

    # command: end-session
    
    Run all three session wrap-up commands in sequence.
    
    Steps:
    1. Execute `/update-brain`
    2. Execute `/update-daily`
    3. Execute `/update-memory`
    
    @CLAUDE: Execute each command fully before moving to the next.
  2. Create three sibling commands in the same directory: update-brain.md, update-daily.md, update-memory.md. Each contains its own multi-step plan with file reads/edits.

  3. In a Claude Code session, run /end-session.

Expected

All three sub-commands run in sequence; all three resulting artifacts (brain file, daily note, memory entries) are present afterward.

Observed

/update-brain completes and produces its artifact. Claude then returns to the user with a summary of what it did, without invoking /update-daily or /update-memory. The user has to remind Claude to continue the chain for the second and third steps.

Confirmed four times on 2026-04-12 by a single user running the same /end-session command across different sessions, using claude-opus-4-6[1m]. Pattern is consistent, not intermittent.

Hypothesis

When Claude invokes a nested skill via the Skill tool, the sub-skill's prompt becomes the dominant instruction in context. After the sub-skill completes, Claude treats the parent command's remaining steps as already-satisfied because the sub-skill's own "execute this plan" instruction was the most recent one followed. The @CLAUDE: Execute each command fully before moving to the next instruction in the parent skill is a prompt nudge the harness does not enforce.

Suggested fixes

  1. Model-side (higher leverage, but slower to ship): train Claude to re-read parent slash-command plans for remaining steps after each nested Skill tool call returns, before addressing the user.

  2. Harness-side (faster): track a "parent command stack" — when a slash command invokes another via Skill, surface a system-reminder after the nested skill completes telling Claude "you are still inside /parent-command, remaining steps: …". This is analogous to the existing <system-reminder> reminders the harness already emits for plan mode, todos, etc.

  3. Documentation-side (workaround): document that user-defined slash commands should not assume chain continuation; tell users to either inline the work or explicitly instruct Claude to re-check the parent plan after each sub-invocation.

Workaround

I've edited my local end-session.md to include an explicit reminder block and step 3 that verifies all three artifacts landed before returning to the user. That cut the failure rate for me personally, but I can tell it's still a model-discipline problem — the instruction has to be repeated in every chain-parent command rather than being a harness guarantee.

Environment

  • Claude Code CLI, latest
  • Model: claude-opus-4-6[1m] (Opus 4.6, 1M context)
  • OS: macOS (darwin 25.4.0)

extent analysis

TL;DR

Implement a "parent command stack" to track and remind Claude of remaining steps after nested skill completion.

Guidance

  • Consider the Model-side fix: train Claude to re-read parent slash-command plans for remaining steps after each nested Skill tool call returns.
  • Implement the Harness-side fix: track a "parent command stack" and surface a system-reminder after the nested skill completes, telling Claude "you are still inside /parent-command, remaining steps: …".
  • As a temporary workaround, edit user-defined slash commands to include an explicit reminder block and step to verify all artifacts landed before returning to the user.

Example

No code snippet is provided as the issue does not contain sufficient code details.

Notes

The provided fixes and workarounds may have varying degrees of effectiveness, and the Model-side fix may take longer to implement.

Recommendation

Apply the Harness-side workaround: track a "parent command stack" and surface a system-reminder after the nested skill completes, as it is a faster solution that can be implemented without modifying the model.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Custom slash commands that chain other slash commands drop remaining steps after the first nested invocation [2 comments, 2 participants]