[BUG] Skill-dependent tool calls can be batched before expanded Skill instructions are available

Status Open
Reported on v2.1.220
Maintainer reply None cached
Activity 1 comment · opened Aug 11, 2026

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?

Claude Code can place a Skill invocation and another tool invocation in the
same assistant tool-use batch.

For example:

Skill("code-review")
Read("app.py")
This parallel topology is confirmed by #81917.
The expanded SKILL.md body is injected only after the assistant response has
already been generated. Therefore, sibling tool calls in that response were
selected before the model had access to the expanded Skill instructions.
This creates a live-turn ordering problem. If the same batch contains a
dependent or mutating operation such as:
Skill("code-review")
Edit("app.py", ...)
the Edit call may execute even though the model had not yet received the
code-review instructions.
This report is about live-turn execution ordering. It is separate from the
resume context-loss problem described in #81917.
This matters when a Skill contains:
mandatory execution ordering
instructions not to modify files
validation requirements
allowed-tools or disallowed-tools
required approval or planning steps

### What Should Happen?

```markdown
A Skill invocation should act as a sequencing barrier for tool calls that may
depend on that Skill.

The expected sequence is:

1. Execute the Skill invocation.
2. Expand and inject the complete `SKILL.md` body.
3. Start another model turn.
4. Let the model re-evaluate the task using the Skill instructions.
5. Execute newly selected dependent tools.

If a response contains a Skill invocation together with dependent sibling tool
calls, Claude Code should defer or cancel those sibling calls and ask the model
to re-plan after the Skill body has been injected.

The intended behavior should also be documented and covered by a regression
test.

### Error Messages/Logs

```shell
No explicit error is emitted.

The problem is semantic ordering: sibling tool calls may be generated and
executed before the expanded Skill body is available to the model.

Steps to Reproduce

  1. Create a project Skill at .claude/skills/order-probe/SKILL.md:

```markdown
---
name: order-probe
description: Tests whether Skill instructions are applied before mutations.
---

Before modifying any file:

  1. Do not modify the target file.
  2. Output SKILL_LOADED_BEFORE_MUTATION.
  3. Ask the user for confirmation.

Create a file named target.txt containing:
ORIGINAL

Ask Claude Code:
Use the order-probe skill to update target.txt to CHANGED.

Capture the stream-json output or inspect the session transcript.

Check whether one assistant response contains both:
Skill("order-probe")
Edit("target.txt", ...)

Check whether the edit operation is selected or executed before the model
receives the expanded SKILL.md body.

Compare this behavior with the expected sequencing described above.

A related public report, #81917, already confirms the following parallel
topology:
Skill("example_skill")
Read("/tmp/example_rules.md")

Claude Model

None

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.220

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

Related issue:

  • #81917 — Resume drops expanded Skill body when Skill is batched with another

tool call

Issue #81917 confirms that a Skill invocation and another tool can appear in
the same parallel assistant response.

That issue focuses on the expanded Skill body being lost after resuming a
session. This report focuses on a separate live-turn concern: dependent sibling
tool calls may be selected or executed before the expanded Skill instructions
are available to the model.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗