Skip to content

Claude Code plugin: load on Claude Code 2.1.287 and later, with a second small plugin for guarded sessions on 2.1.329+ - #4283

Merged
backnotprop merged 18 commits into
mainfrom
fix/claude-code-mod-loads-on-old-and-new
Nov 30, 2026
Merged

backnotprop merged 18 commits into
mainfrom
fix/claude-code-mod-loads-on-old-and-new

Conversation

@backnotprop

@backnotprop backnotprop commented Nov 30, 2026 •

Copy link
Copy Markdown
Owner

What this does

Plannotator's Claude Code plugin loads on every Claude Code from 2.1.287 again, as it did in 0.29.8. A second, small plugin from the same marketplace, plannotator-run (apps/hook-run), carries the one hook that only Claude Code 2.1.326 and later can load. Plannotator installs that second plugin by itself. Nobody is told about it and nobody has to do anything.

Nothing changes for users. No new step, setting, prompt or instruction. Every place a person reads a minimum Claude Code version says 2.1.287 again, word for word as at v0.29.8 (README, apps/hook/README.md, the site's docs, the Inbox agent pages, plannotator inbox --help, the Inbox setup hint).

What each Claude Code range gets

  • Before 2.1.287: no change from 0.29.8 (the classic hook, the skills, the CLI).
  • 2.1.287 to 2.1.325: the whole mod, as in 0.29.8. These versions refuse a module that names tool.run, so the main plugin names none. If the companion is somehow installed, Claude Code refuses only the companion, and the main plugin is not affected. Plannotator never installs it on these versions.
  • 2.1.326 to 2.1.328: the whole mod. Behind Claude Code's guard, the mod's own hook opens a held call. The companion may hear the call too, but the call opens once.
  • 2.1.329 and later: the whole mod. Behind the guard (Team and Enterprise logins, managed settings), a held plannotator call or a taken-over Bash command opens through the companion. Where no guard holds calls, the companion changes nothing.

Opening through the companion after /resume, /clear and in a second process

The mod marks which module load is live, so that a module replaced by a reload never opens a call from its old state. The mark is in the process's own environment (PLANNOTATOR_RUN_LOAD), written each time the mod makes a session's instance: at session start, after /clear, after an in-process /resume, after a fork.

  • Only a newer load in the same process can replace the mark. A replaced module stands down; the companion passes the call on.
  • A second process on the same session (claude --resume or -c in another terminal, the Inbox's start again) has its own environment, so each process opens the calls it hears.
  • A mark that could not be written, cannot be read, or was inherited from a parent Claude Code never makes the live module refuse.
  • A call is never opened twice: the in-process once-only gate, plus the taken call ids in $.store across a reload.

An earlier round kept this mark per session in the shared store, written only at the first session start. After an in-process /resume, or once another process opened the same session, every call that reached the companion was refused. That is fixed here, with tests for each case.

The three silent install points

Each one acts only on Claude Code 2.1.326 or later, only next to a user-scope plannotator@plannotator, and prints nothing about the companion, on success or on failure.

  1. The installers (install.sh, install.ps1, install.cmd). After the main plugin's update, they run claude --version with its own 20-second limit. Then they run claude plugin install plannotator-run@plannotator --scope user, or plugin update if it is already installed, with its own 60-second limit. A timeout or an unknown version does nothing, prints nothing and never fails the install.
  2. The Inbox's Update, which runs the same installer.
  3. A once-a-day check (packages/server/claude-run-companion.ts), from the CLI and from the Inbox.
    • At most once a day: the day is claimed with an exclusive create, so two processes starting together run it once. A failed or cut-short install is tried again the next day.
    • The CLI starts it only inside a Claude Code session, never for Codex, OpenCode, Pi or Gemini sessions, and never from a source or dev run. It runs in a detached child of the same binary (its own process group, no stdio). The CLI neither waits for it nor kills it when it exits, and nothing reaches the hook's output.
    • claude runs from the home folder, never the project folder.
    • Once a check has seen the companion installed, a later check that finds it gone leaves it gone: the person removed it. plannotator uninstall, or the main plugin being gone, forgets that.
    • One line to update.log. Off when update checks are off, under tests, and with the installers' Claude Code plugin opt-outs.

Uninstall

plannotator uninstall removes the companion with the main plugin (user scope only). The step is optional: a failure is a warning, never an error, because older installs never had the companion. It also clears the daily check's memory that the companion was seen. The installers have no uninstall of their own.

Who can still be without the companion

These people see exactly what released 0.29.8 shows. On 2.1.329+ behind the guard, that means Claude Code's own "no hook answered this call" for the tool, and a Bash plannotator annotate|review|last runs as written.

  • Installs at project scope or local scope only.
  • Organisation plugin allowlists that refuse plannotator-run.
  • OpenPackage installs and claude --plugin-dir.
  • The installer opt-outs (--skip-claude-plugin, PLANNOTATOR_SKIP_CLAUDE_PLUGIN_UPDATE, skipInstall.claudePlugin), and a --version pin together with update checks off.
  • claude not found.
  • Someone who removed it after a check saw it (the installers' next update still adds it back).
  • Someone whose Plannotator binary has not updated yet, or who never runs a CLI session inside Claude Code nor the Inbox.
  • Until Claude Code restarts, the session that was already running when the companion was added.

What was seen run, and where

All on macOS arm64, with real Claude Code in a throwaway home.

  • The engine test kit (claude plugin test, this head's plugin parts): 93 pass, 0 fail on 2.1.287, 2.1.325, 2.1.329 and 2.1.330. plugin validate passes for the main plugin on all four.
  • Bun tests: the early-run tests drive the real hooks of both plugins on a fake engine: /resume, /clear, a fork, two processes on one session, a broken store, an inherited mark, a reload then a resume. Each opens exactly once, and a replaced module stands down. The daily check's tests include one through the real spawn path: a parent process starts the detached child and exits at once. Nothing reaches its stdout or stderr, and the child still finishes the install with a harmless fake claude, from the home folder.
  • The self-install, earlier round, with the real ensureRunCompanion: on 2.1.329 and 2.1.330 it installed the companion at user scope and a second run ran nothing; on 2.1.287 and 2.1.325 only --version ran.
  • Installer tests (scripts/install.test.ts, the Claude Code plugin cases): 45 pass locally. The PowerShell and cmd cases run only in CI (no pwsh on this machine).

Not proven

  • A real Team or Enterprise login with Claude Code's real guard. Every guarded proof uses stand-in guards.
  • Whether /reload-plugins or the mod's auto reload runs engine.create again. The test kit cannot drive a reload. If it does not, a guarded 2.1.329+ session gets the companion path back after Claude Code restarts, which is what 0.29.8 gives. It is never opened twice either way.
  • Whether the environment reads back across a reload in a real engine. The repo's session tag relies on it. If it did not, every load would open, and the once-only gates still keep a call from opening twice.
  • The Windows installers beyond their tests.
  • The detached daily check run by a real released binary inside a real Claude Code session.

For the release note

  • Do not claim the fix reaches every guarded user. It needs the companion installed and a Claude Code start after that (see the list above).
  • Do not claim the "tool.describe hook was skipped" line is gone.

…en held calls through a second plugin, plannotator-run

The mod hooks tool.* again (as in 0.29.8), so Claude Code 2.1.287-2.1.325 load
it. The one tool.run hook moves to a new plugin, plannotator-run (apps/hook-run),
which asks the mod to open the call through a named action the mod adds in
engine.create. Where both hear a call (2.1.326-2.1.328) it opens once.
No dependency link between the two plugins; the companion's version is bumped
with the others.
…gin beside it

Every engine: the mod's module loads and its suite passes. 2.1.287 and 2.1.325:
the companion is refused by claude plugin validate for naming tool.run.
2.1.326 and later: with the companion, a held call opens exactly once for
annotate, review, last and the Bash take-over; without it, from 2.1.329 the mod
alone opens nothing (the control).
The mod's module loads from 2.1.287 (the first Claude Code with hooks modules)
now that its tool.run hook lives in the plannotator-run plugin, so Settings ->
Agents, the one-time update dialog and New message's held Start fire only
below 2.1.287. A held Start names the higher of the two floors (launch needs
2.1.314), the version that makes Start work.
… later

When the plannotator plugin is installed, after the marketplace and plugin
update, one claude --version decides: 2.1.326 or later installs
plannotator-run@plannotator (or updates it when it is there); an older or
unknown version leaves it alone. A failing step prints a note and never fails
the install; the pin and the opt-out skip it with the main plugin.
… companion's action; a call taken before a reload is never opened again
…, at most once a day, from the CLI and the Inbox
…ocess

The live mark was written per session in the shared store at the first
session.start only, so after an in-process resume, or when another process
opened the same session, every call reaching the companion was refused.
The mark now lives in the process's own environment and is written each
time a new instance is made; a module stands down only when a newer load
in the same process replaced it, and any doubt opens.
The CLI now claims the day with an exclusive create and starts one
detached child of its own binary (own process group, no stdio, unref'd)
so process.exit neither waits for nor kills the install. It starts only
inside a Claude Code session and only for a released build. claude runs
from the home folder. Once a check has seen the companion installed, a
later absence is left alone; finding the main plugin gone or running
plannotator uninstall forgets that.
A hung plugin install or update for plannotator-run could hold an
install silently for up to 11 minutes. It now stops after 60 s (an
internal knob for the tests), prints nothing and the install goes on.
@backnotprop
backnotprop marked this pull request as ready for review November 30, 2026 17:35
@backnotprop backnotprop added the ci:e2e Run the full browser suite (Inbox window e2e) on this PR label Nov 30, 2026
@backnotprop
backnotprop merged commit d4c8c3e into main Nov 30, 2026
92 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:e2e Run the full browser suite (Inbox window e2e) on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant