[BUG] Nested skills dont return to invoking skill context on finishing but to main context
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When invoking a skill from another skill the workflow execution from the invoking (main) skill is discontinued.
I have experimented with this behavior and used the new context: fork and agent: with the nested skill to define a different model (Haiku) for the invoked skill. The main skill was invoked with a command and a different model (Sonnet). After the skill finished, the session returned to the main context (Opus). This also happens without the context forking.
A skill with a workflow that delegates a task to another skill (forked or not) cannot continue the workflow. Manually asking to continue it shows that Opus is used (Strg + O/E).
The invoked skill did not contain directives to finish or create a report or something similar.
What Should Happen?
The execution should return to the skill and not the main session. If the behavior is intended, the limitations of context nesting should be documented.
Error Messages/Logs
Steps to Reproduce
- Create a skill that invokes another skill explicitly (
Skill(...)). - Create a command with a different model than the main session that invokes the main skill explicitly.
- Run the command and observe the used model in the session transcript
Claude Model
Not sure / Multiple models
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.3
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
_No response_
5 Comments
Indeed, this is breaking attempts to create a custom ralph wiggum implementation, where after execution of a skill, control is returning to human interaction and so breaks my ralph's autonomous loop.
I experienced the same issue.
My
/git-pull-requestskill calls/git-commit --pushas a pre-processing step before creating a PR. After/git-commitcompleted successfully (committed and pushed), the workflow stopped and returned to the main session instead of continuing with the PR creation.Claude even said "Commit and push completed. I'll create the PR." but didn't actually proceed to call the next tool. I had to manually prompt it to continue.
This confirms the behavior described in this issue - nested skills don't return to the invoking skill context.
I also experienced exactly the same issue (#21672 )
This is a bit unfortunate, because working with sub-skills is really powerful for bigger tasks.
Platform is Windows in my case. Also doesnt matter if its in VS Code plugin or the CLI.
Same issue here. It happens when skills call other skills. I can't get a prompt calling a list of N skills to complete. After skill 1 is run, it ends the turn.
Two skills in ~/.claude/skills/skill1 and 2:
Behavior: stops after skill1 and never invokes skill2
Version: 2.1.37
OS: MacOS
Could a maintainer share whether a fix is in progress and approximate priority?
The issue's been open since January with
has reproandarea:core; a status signal would help us decide how much more workaround infrastructure to invest in.We're hitting this in production with Claude Code (Agent SDK via
claude-code-actionin CI). We've tried several per-skill workarounds across ~10 orchestrator skills — instructing the model to load the sub-skill'sSKILL.mddirectly via theReadtool instead of invoking it — and still see the bug fire whenever the model doesn't comply with the prose. Example workaround pattern:Two production runs failed four days after we deployed that workaround: the model invoked
Skill(...)anyway, the bug fired (cleanstop_reason: end_turn, but the orchestrator's remaining workflow steps never executed).