Skip to content

feat(harness-ops): add the control-claude-code control skill - #10187

Merged
melodic-automation-lanes[bot] merged 2 commits into
mainfrom
work-resolve-issue/issue-9592-40262045154-1
Oct 26, 2026
Merged

melodic-automation-lanes[bot] merged 2 commits into
mainfrom
work-resolve-issue/issue-9592-40262045154-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Refs: #9592

Summary

Opened by the work-resolve-issue lane. The run's own summary:

Adds harness-ops' control-claude-code hub (Launch, Ready, Capture, Cleanup, attended runs only, no account switching), config/defaults.json with pluginDir, eight feature folders (mods band/toast/panel, skills/invoke, hooks/output, commands/slash, dialogs/permission, desktop/mod-harness), with every Claude Desktop entry point not driven: terms, plus evals. Ready and log capture need a print-mode run with the launch's exact flags and environment, so the driver gains ready (doctor lines, session state, init event; exits 1 unless apiKeySource is none and the plugin under test is listed) and log <prompt> (stream-json to --out). Both stop Claude Code's whole process group early or at --timeout. The attended prove run is left for the owner.

Remaining work

  • Attended prove run against one mod with the owner present: drive a mods feature through /app-control:drive, attach the screenshots and MP4 to the PR, and confirm the init event's apiKeySource is "none" and the evidence files exist after cleanup

Not verified

  • The driver's node test suite (driver.test.sh / driver.test.mjs) was not run: this lane runs only the named wrappers and check-affected runs without --tests. Left to the PR's test lane.
  • bash plugins/app-control/skills/map/scripts/check-map.sh plugins/harness-ops/skills/control-claude-code was not executed (no wrapper for it in this lane); its rules were applied by hand with no findings.
  • check-affected skipped changed-skills (/skill-quality check-skill.sh on the new skill), the cheatsheet drift check, typos and the mods test; left to CI.
  • Ready is not strictly read-only as the contract words it: it starts one print-mode turn and stops it at the init event. The hub says so rather than avoiding the prompt.
  • The permission-dialog feature waits on dialog wording that is not recorded yet; the first attended run reads it from the video and hands it back as a Gotchas lesson.
  • No model-run eval baseline or trigger measurement for the new skill (user-invoked, read by drive); the evals were linted only.

Fix

  • plugins/harness-ops/skills/control-claude-code/SKILL.md: new hub with App, Driving tool, Attended runs only., the no-account-switching line, Launch, Ready, Capture (screenshot, video, logs as stream-json; trace/cpu/heap/threads/aria none), Cleanup, Next, Gotchas, and the eight-line feature index
  • plugins/harness-ops/skills/control-claude-code/features/{mods/band,mods/toast,mods/panel,skills/invoke,hooks/output,commands/slash,dialogs/permission,desktop/mod-harness}/README.md: feature files with the contract's six sections; each Claude Desktop entry point is not driven: terms, and desktop/mo
  • plugins/harness-ops/skills/control-claude-code/config/defaults.json: environment, pluginDir (plugins/context-budget), timeouts (launchSeconds, readyMs, stepMs, logMs), empty credentials, safety floors at safe values
  • plugins/harness-ops/skills/control-claude-code/config/.gitignore: ignores local.json
  • plugins/harness-ops/skills/control-claude-code/evals/evals.json: four cases (Desktop not driven, Ready refusing an API-key session, no account switching, capture uses only the named tools)
  • plugins/harness-ops/skills/control-claude-code/driver/driver.mjs: new ready and log verbs, buildPrint, runPrint (own process group, SIGTERM then SIGKILL, --timeout, guarded write, UTF-8 decoder), the --out option, and a pointer record for the stream-json flags and ApiKeySource
  • plugins/harness-ops/skills/control-claude-code/driver/driver.test.mjs: tests for buildPrint, usage errors, ready pass/API-key/plugin-not-listed/no-init/timeout, log full run/exit 3/API-key stop of a non-exec child/claude missing from PATH, and the config floors
  • plugins/harness-ops/skills/control-claude-code/driver/driver.test.sh: test-scope line covering config/*, so the selector maps config/.gitignore
  • plugins/harness-ops/README.md: skill count eighteen to nineteen, and a skills-table row for control-claude-code
  • scripts/cheatsheet-config.mjs: exclusion entry for harness-ops/control-claude-code (the contract allows a control skill no metadata key)
  • .github/standards/dependabot-policy/policy.json: driver.mjs line numbers in the tui-test basis moved to :278, :453-455 and :99
  • .changes/harness-ops/feat-9592-control-claude-code-9592c3c1.md: minor fragment (written by hand: new-changelog-fragment refused because HEAD is detached)

Verification

The runner ran each check from the base copy against f99ef25:

  • scripts/check-changelog-fragments.sh --check: passed

The run reports:

  • /home/runner/work/claude-code-plugins/claude-code-plugins/.lane/checks/bin/check-changelog-fragments: All 4 changelog fragment(s) under .changes/ are valid
  • /home/runner/work/claude-code-plugins/claude-code-plugins/.lane/checks/bin/check-affected: 10 passed, 7 skipped over 19 changed files (markdown, shellcheck, exec-bit, changelog-fragments, validate-plugins among the passes; typos, ruff, changed-skills and four validate-plugins steps skipped)
  • check-evals-quality on the new evals.json: PASS, 0 warnings
  • cant-fail-scan --file driver.test.mjs --check: PASS, 37 test blocks parsed, no gating findings
  • check-map.sh rules applied by hand to plugins/harness-ops/skills/control-claude-code (this lane cannot run the script): no findings. 8 index lines resolve, entry counts 2/2/2/4/3/3/3/2 match, six sections in order everywhere, every entry line ends driven or not driven: <reason>, all source glo
  • Fresh-context review subagent over the whole diff: no check-map findings. Findings fixed: unbounded runPrint (timeout plus SIGKILL), kill reaching only the direct child (process group), uncaught writeSync, split UTF-8 chunks, Ready passing without the plugin loaded, Ready not reporting the session,
  • read https: //code.claude.com/docs/en/plugins/mods/test: claude plugin test runs a mod's *.test.ts files with no session, sign-in or network; $.ui.mount draws a render site for surface 'terminal' or 'desktop'; exits 1 on a failed test
  • read https: //code.claude.com/docs/en/plugins/mods/interface: the band above the prompt every mod shares (Pick where to draw); a pane a mod opens on its own waits for a wider terminal (Open a pane at the right time); holdToasts
  • read https: //code.claude.com/docs/en/plugins/mods/api: $.ui.toast shows the mod's name and disappears after a few seconds (Show something without starting a turn); commands are registered in session.start before the first prompt (Add a command or a tool)
  • read https: //code.claude.com/docs/en/cli-reference: claude doctor; --output-format stream-json and --verbose for print mode; --plugin-dir; --restricted removes command and code tools and loads only managed settings and --settings; --strict-mcp-config
  • read https: //code.claude.com/docs/en/agent-sdk/typescript: SDKSystemMessage init carries apiKeySource, claude_code_version and plugins[{name,path}]; ApiKeySource none means no API key (claude.ai login, bearer token or cloud provider)
  • read https: //www .anthropic.com/legal/consumer-terms: section 3 Use of our Services bars access through automated or non-human means except via an API key or where explicitly permitted (effective Oct 8, 2025), the basis cited for not driven: terms
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/40262045154

Left out: the items under Not verified.

Related

#9592

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review needs no new review of 2d3f364dd9f51e0ab8c8e2c658d6ceeeee1102f9: no file of this pull request changed since the review of f99ef25.

No security findings in this pull request.

critical-findings: 0

What I read: the full diff (19 files) and the PR context, plus UNSET_VARS, LAUNCH_FLAGS and buildLaunch in the head driver.mjs. The protected-class register at docs/conventions/instruction-exception-register/README.md was not consulted, because the diff removes no standing instruction.

Trusted paths: no changed file matches .github/standards/trusted-actors/**, .github/actions/check-trusted-trigger/**, **/CODEOWNERS or **/.gitmodules.

Manifests: neither plugin.json nor marketplace.json changed, so there are no manifest <field> lines. config/defaults.json is a skill config, not a plugin userConfig. Its safety floors stay at the safe values: unattendedWrites: false and empty credentials, recipients, signInAttempts and production.

Instruction surface: the diff adds instructions and deletes none. The only edit to an existing file under .github/standards/ is dependabot-policy/policy.json, which changes line numbers inside a basis string.

New driver verbs (ready, log):

  • claude is started with spawn and an argv array, so there is no shell. A prompt that starts with - is refused in buildPrint, so it can't become a flag such as --dangerously-skip-permissions.
  • The child environment goes through buildLaunch, which clears ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN, ANTHROPIC_BASE_URL, ANTHROPIC_CUSTOM_HEADERS and the CLAUDE_CODE_USE_* switches. It launches with --restricted --strict-mcp-config.
  • The code stops a run whose apiKeySource is not none. ready exits 1 unless apiKeySource is none and the plugin under test is listed. log stops the process group and exits 1 when apiKeySource is not none.
  • --out is opened with mode 0600. --timeout accepts only a positive integer and is capped at MAX_TTL_S.
  • Stopping reaches the whole process group (SIGTERM, then SIGKILL after a grace period).
  • Ready prints the plugin names from the init event. That is data from the local claude process and is only printed.

Residual notes, not findings:

  • ready runs one print-mode turn. The init event is emitted before the model request, but if the stop loses a race, one prompt could reach the subscription. The PR text says as much.
  • loaded() accepts a match by manifest name alone, so a different plugin with the same name would satisfy it. This is a correctness gap in an attended tool, with no exploitable path in this diff.
  • Hooks of the plugin under test run in the ready and log turns. That is expected for the named plugin and the skill is attended-only.

Spend: ready and log use subscription usage only. There is no billing change, so no hold.

@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

claude-review needs no new review of 2d3f364dd9f51e0ab8c8e2c658d6ceeeee1102f9: no file of this pull request changed since the review of f99ef25.

Review of #10187 (control-claude-code control skill, ready and log driver verbs). I read the whole diff and the PR context, and checked the changed driver.mjs against the head file. Nothing here was run by me, and the driver tests were not run. The author says they were not run either.

I found no correctness bug in the driver's new code. Checked:

  • The policy.json line references (driver.mjs:278, :453-455, :99) match the head file.
  • runPrint's process-group stop, timeout clamp and write guard behave as the tests describe.
  • ready exits 0 only when apiKeySource is none and the plugin is listed.

The two findings are inline: an unread launchSeconds config key and a Gotcha that contradicts the Ready section. Both are small.

Not a finding: the closing issue (#9592) is only referenced ("Refs"), and its text is not in the PR context file. I could not check the change against its acceptance criteria, so those criteria are unread, not met. The PR's own "Remaining work" (the attended prove run) is still open.

Cost: nothing here starts a real charge. ready and log run Claude Code print-mode turns, which spend subscription usage only.

Manifest items: no plugin.json or marketplace.json changed, so none apply.

Trusted-path files: none of the changed files match the listed globs.

critical-findings: 2

Findings not posted inline (their lines are not in the diff):

  • plugins/harness-ops/skills/control-claude-code/config/defaults.json:5 (RIGHT): timeouts.launchSeconds has no reader. The driver never reads config/* (the --timeout values are passed by the agent), and SKILL.md names only stepMs, readyMs and logMs as the --timeout sources. The Launch command passes no launch timeout, and launch has no such option. So changing this value does nothing. Either remove the key, or wire it into Launch and say where it applies. The test at driver.test.mjs for the config floors does not check timeouts, so nothing would catch the drift.
  • plugins/harness-ops/skills/control-claude-code/SKILL.md:119 (RIGHT): This Gotcha says "Ready stops before any request", but the Ready section (lines 82-84) says it "starts one print-mode turn with the launch's flags" and stops it at the init event. The PR's own Not verified list says Ready is not strictly read-only. The driver sends SIGTERM only after it has parsed the init event, so a model request can already be in flight by then. Nothing in the driver or the tests guarantees "before any request". The attended person may rely on this line to expect no usage and no transcript. Reword it to what is guaranteed, for example: Ready stops Claude Code at the init event and does not wait for a reply, so it does not show the session is signed in.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head 2d3f364dd9f51e0ab8c8e2c658d6ceeeee1102f9.

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Oct 26, 2026
Merged via the queue into main with commit 1ce3bd4 Oct 26, 2026
38 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-9592-40262045154-1 branch October 26, 2026 06:06
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.

0 participants