Repository navigation
Accept Claude Code's built-in plugin bookkeeping in the runner home - #1085
Conversation
Claude Code writes plugins/store/<name>_builtin-<hash>.json into its
CLAUDE_CONFIG_DIR during every session, even with DISABLE_TELEMETRY and
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC set. The worker-home check
refused any "plugins" entry, so after the first attempt the runner
reported the harness not ready ("claude runner home contains interactive
configuration \"plugins\"") until someone removed the directory.
Allow a plugins directory only when it holds nothing but regular
store/*_builtin-<hex>.json files. Marketplaces, installed plugins, other
store files, nested directories and symlinks are still refused.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Review of #1085 at Findings: none at Critical, Warning or Note level. Unverified: the PR relies on Claude Code treating Checked
|
The runner home accepted any regular file named plugins/store/<name>_builtin-<hex>.json, checking only the name. Also require the content to look like the bookkeeping Claude Code writes: a JSON object of at most 64 KiB whose values are all scalars. A store file with nested objects or arrays (the shape a manifest describing hooks, commands or servers would need), non-JSON, or an oversized body now makes the home unsafe. Addresses review on #1085. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Addressed the unverified point in d5b20d8: |
The runner home accepted any regular file named plugins/store/<name>_builtin-<hex>.json, checking only the name. Also require the content to look like the bookkeeping Claude Code writes: a JSON object of at most 64 KiB whose values are all scalars. A store file with nested objects or arrays (the shape a manifest describing hooks, commands or servers would need), non-JSON, or an oversized body now makes the home unsafe. Addresses review on #1085. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Problem
The Claude runner refuses a worker home (
CLAUDE_CONFIG_DIR) that contains apluginsentry (unsafeHomeEntries, introduced in #765). Claude Code itself createsplugins/store/<name>_builtin-<hash>.jsonduring every session — e.g.cc-plugin-agents-md_builtin-b049b47b3618.json, holding only{"usage-rows-queued": "… claude-md-or-agents-md ok"}— even though the runner already setsDISABLE_TELEMETRY=1andCLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1. So after the first attempt the harness probe fails and the runner stays not ready:The only workaround was deleting the directory by hand, and the next session put it back. The #765 policy is meant to keep project-controlled code out of the home; it rejects this file because the check is broad, not because the file is a risk.
Change
ensureHomeaccepts apluginsdirectory only when it holds nothing but regular files matchingstore/<name>_builtin-<hex>.json. Everything else underpluginsis still refused: marketplaces,installed_plugins.json, non-builtin store files, nested directories, and a symlinkedstore. The other unsafe entries and the top-level symlink rule are unchanged.Testing
go test -count=1 ./pkg/runner/harness/claude/— a new case accepts a home with only the built-in bookkeeping and rejects each near-miss above; the existing rejection of apluginsentry with other content still holds.make lint— 0 issues.ready: true(claude-code 2.1.322). That restart happened with nopluginsdirectory present, so the next attempt that recreates the bookkeeping file is the live check of the acceptance path.🤖 Generated with Claude Code