Skip to content

feat(harness-ops): probe ${CLAUDE_EFFORT} in a skill a subagent loads through the Skill tool - #10626

Merged
kyle-sexton merged 7 commits into
mainfrom
feat/probe-skill-tool-effort-6908
Oct 28, 2026
Merged

kyle-sexton merged 7 commits into
mainfrom
feat/probe-skill-tool-effort-6908

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Closes #6908

Summary

Problem: ${CLAUDE_EFFORT} in a skill preloaded into a subagent expands to the session effort, and nobody had probed a skill a subagent loads through the Skill tool. This adds a behavior-probes case for that path and records its live result: the Skill-tool path expands to the subagent's own effort (low pin, session medium), while the preloaded path still gives the session's level.

Fix

  • New case subagent/skill-tool-skill-placeholder-effort: a subagent pinned effort: low, with tools: Bash, Skill and no skills preload, loads print-effort through the Skill tool and runs the echo effort=${CLAUDE_EFFORT} it names. Its scaffold removes the shared preloading agents, so a driver cannot measure the preloaded path by mistake.
  • records.md gains record 14 (Skill-tool path gives the subagent's level) and record 15 (preloaded control on the same version still gives the session's level), each refreshed on 2.1.312.
  • Effect on the issue's skill list: only the preloaded case, discovery:research in discovery:researcher, reads the session level, and plugins/discovery/reference/parent-contract.md already states that ("${CLAUDE_EFFORT} in a preloaded skill is the session's level"). The eight skills that load through the Skill tool get the subagent's level, so none needs a change.

Verification

  • probe.py validate: 42 cases, 0 problems. probe.py run --dry-run on both cases: pass. probe.test.sh: exit 0. python3 -m unittest test_probe: 56 tests OK.
  • Live, Claude Code 2.1.310 (2026-10-25): the new case and the preloaded control, one run each, both pass after expect.json was corrected to the observed effort=low.
  • Live, Claude Code 2.1.312 (2026-10-28): probe.py run --live --max-runs 2 --max-cost-usd 4 --keep over both cases: 2 runs, both pass. In the raw stream, the subagent's Skill call returned Launching skill: print-effort, then it ran echo effort=low, and no literal ${CLAUDE_EFFORT} reached a command. Hook effort.log shows effort=low for both subagents; the preloaded one ran echo effort=medium.

Left out: other subagent-area cases, which this change does not touch.

Related

🤖 Generated with Claude Code

kyle-sexton and others added 7 commits October 25, 2026 17:17
…he Skill tool in a subagent

Adds behavior-probes case subagent/skill-tool-skill-placeholder-effort and
record 14. One capped live run on Claude Code 2.1.310 showed the placeholder
expands to the subagent's own effort pin (low), not the session level
(medium) that record 13 found for a preloaded skill.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… 2.1.310

Record 15: the preloaded case still reads the session's medium while the
subagent's hook payload reports low, so the Skill-tool and preloaded paths
differ on the same version. Record 14 and the changelog fragment cite it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton marked this pull request as ready for review October 28, 2026 07:37
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T07:39:19.383544Z 80a817a Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed 80a817af893cbf60f43057da757c9a742f3bc534: 0 finding(s), 0 as inline comments.

No findings. I read the full diff and the PR context, and checked the sibling effort-probe.sh fixture, the sibling expect.json and the heading structure of records.md. I did not run anything: the PR's probe.py and live-run results are author-claimed and unverified by me.

  • Closing issue fix: skills reading ${CLAUDE_EFFORT} inside a subagent may get the session effort #6908. The issue's criterion is to add a behavior-probes case for ${CLAUDE_EFFORT} in a skill loaded through the Skill tool inside a subagent, and to run it live, capped. The change meets it.
    • The case is added.
    • scaffold.sh removes the two shared agents that preload print-effort, so the case can't measure the preloaded path.
    • The subagent has tools: Bash, Skill and no skills key.
    • The session effortLevel is medium and the pin is low, so effort=low can only come from the subagent's level.
    • The max_turns and the --max-cost-usd 4 run are within the decision's "capped".
    • The "per-skill change" step in the issue is covered in the PR body: the eight Skill-tool skills need no change.
  • Records. Records 14 and 15 follow the file's existing pattern: a "Basis for record N" section comes before the record, with Claim, Recheck trigger and a results table. The claims match the recorded observations. I found no case index elsewhere that needs a new row. parent-contract.md already says the preloaded path gives the session's level.
  • Changelog fragment. bump: minor fits a new probe case.
  • Manifests. The diff changes no plugin.json or marketplace.json, so none of the manifest checks apply.
  • Trusted paths. None of the six changed files matches a trusted-path glob.
  • Embedded instructions. The PR context contains no embedded instructions aimed at the lane.
  • Spend. The change adds a probe case that spends prepaid API credit or subscription usage only when someone runs it live. It is not a hold.

@github-actions

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 80a817af893cbf60f43057da757c9a742f3bc534: 0 finding(s), 0 as inline comments.

No security issues found.

critical-findings: 0

The change adds a behavior-probes case and two records. The case is subagent/skill-tool-skill-placeholder-effort, and the records are in records.md. No file in the diff matches a trusted path. The diff has no workflow, action, token, kill-switch, merge-hold or plugin-manifest change, so there are no manifest lines to report.

  • Fixture: scaffold.sh writes only under $PROBE_WORKDIR, which probe.py sets and the script requires (:?). It removes two agent files in that directory and writes one agent file with tools: Bash, Skill. The tool grant is narrow and covers only the throwaway probe workdir.
  • Hooks: the hook commands in settings.json run python3 "${PROBE_WORKDIR}/.claude/hooks/log-effort.py". That path is a fixture the shared effort-probe.sh creates. The command takes no input from the PR text or other untrusted sources.
  • permission_mode: "auto" matches every sibling case under cases/subagent/.
  • PR text: the PR context carries no embedded instructions aimed at the lane.
  • Spend: the live probe runs spend prepaid API credit, capped at --max-cost-usd 4. This is not a hold.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Oct 28, 2026
Merged via the queue into main with commit 45b4ff4 Oct 28, 2026
87 checks passed
@kyle-sexton
kyle-sexton deleted the feat/probe-skill-tool-effort-6908 branch October 28, 2026 13:37
@github-actions

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

Killed 1, survived 6, timeout 0, no coverage 0, invalid 0, not run 0.
Covered-code score 14%; mutation score 14%.

File Killed Survived Timeout No coverage Invalid Not run
plugins/harness-ops/skills/behavior-probes/cases/subagent/skill-tool-skill-placeholder-effort/scaffold.sh 1 6 0 0 0 0

Surviving mutants

Location Operator Disposition Cause
plugins/harness-ops/skills/behavior-probes/cases/subagent/skill-tool-skill-placeholder-effort/scaffold.sh:2 SBR productive input-gap
plugins/harness-ops/skills/behavior-probes/cases/subagent/skill-tool-skill-placeholder-effort/scaffold.sh:3 other arid none
plugins/harness-ops/skills/behavior-probes/cases/subagent/skill-tool-skill-placeholder-effort/scaffold.sh:9 SBR productive no-assertion
plugins/harness-ops/skills/behavior-probes/cases/subagent/skill-tool-skill-placeholder-effort/scaffold.sh:10 other productive no-assertion
plugins/harness-ops/skills/behavior-probes/cases/subagent/skill-tool-skill-placeholder-effort/scaffold.sh:14 other productive no-assertion
plugins/harness-ops/skills/behavior-probes/cases/subagent/skill-tool-skill-placeholder-effort/scaffold.sh:15 other productive no-assertion

The run's summary has the full report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: skills reading ${CLAUDE_EFFORT} inside a subagent may get the session effort

1 participant