Skip to content

fix: gate Claude Code plugin install on minimum CLI version#465

Draft
posthog[bot] wants to merge 1 commit into
mainfrom
posthog-code/claude-code-plugin-outdated-handling
Draft

fix: gate Claude Code plugin install on minimum CLI version#465
posthog[bot] wants to merge 1 commit into
mainfrom
posthog-code/claude-code-plugin-outdated-handling

Conversation

@posthog
Copy link
Copy Markdown

@posthog posthog Bot commented May 21, 2026

Problem

Users on outdated Claude Code installations (<1.0.88) hit an uncaught failure when the wizard tried to install the PostHog plugin. claude plugin install posthog exits non-zero with A newer version (1.0.88 or higher) is required to continue., which falls straight through to analytics.captureException in ClaudeCodeMCPClient.installPlugin() — producing a captured exception with no actionable UX (the user is told nothing, just sees a generic skip).

Error tracking caught 2 occurrences from 2 distinct users over the last 30 days. Low volume today, but growing as the 1.0.88 floor ages.

Changes

  • Cache the version detected by claude --version on the client and add MIN_PLUGIN_VERSION = '1.0.88' plus a simple semver-shape parser in src/steps/add-mcp-server-to-clients/clients/claude-code.ts.
  • installPlugin() short-circuits with { success: false, outdatedClient: true } when the CLI parses below the minimum — no analytics exception.
  • Belt-and-suspenders: also map the CLI's own newer version / is required to continue error text in the install catch block to the same outdatedClient result, so we still avoid the noisy capture when version parsing fails.
  • installPlugins in src/steps/add-mcp-server-to-clients/index.ts now returns { installed, outdated }. McpInstaller.installPlugins propagates that shape and tags the mcp plugins installed analytics event with outdated.
  • McpScreen.tsx renders a yellow "Plugin install skipped — run claude update and re-run the wizard" hint when the outdated set is non-empty, and gives the Done view an extra beat to be read.

Test plan

  • New unit tests in claude-code.test.ts:
    • Skips plugin install and returns outdatedClient when --version is below 1.0.88 (and does not call analytics.captureException).
    • Maps the CLI's own "newer version (... is required to continue)" error to outdatedClient when version parsing fails.
    • Accepts versions at the minimum (1.0.88).
  • Updated mcp-installer.test.ts for the new { installed, outdated } shape and analytics payload.
  • pnpm build && pnpm jest src/steps/add-mcp-server-to-clients src/ui/tui — all 222 tests pass; pnpm fix clean (only pre-existing warnings remain).

Created with PostHog Code

Outdated Claude Code CLIs (<1.0.88) responded to `claude plugin install
posthog` with "A newer version (1.0.88 or higher) is required to
continue." That error fell through to `analytics.captureException`,
producing a captured exception with no actionable UX for the user.

- Cache the version read from `claude --version` and short-circuit
  `installPlugin()` when it parses below MIN_PLUGIN_VERSION ("1.0.88"),
  returning `{ success: false, outdatedClient: true }` without touching
  analytics.
- As a belt-and-suspenders fallback (e.g. unparseable version strings),
  recognise the CLI's own "newer version" / "is required to continue"
  message in the install catch block and treat it the same way.
- Plumb the `outdated` set through `installPlugins`, the McpInstaller
  service, and McpScreen so the Done view renders a yellow "run
  `claude update` and re-run the wizard" hint instead of a silent skip.

Generated-By: PostHog Code
Task-Id: 6780d653-bf05-479b-83e5-d5b8f8d82fb1
@github-actions
Copy link
Copy Markdown

🧙 Wizard CI

Run the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands:

Test all apps:

  • /wizard-ci all

Test all apps in a directory:

  • /wizard-ci basic-integration
  • /wizard-ci misc
  • /wizard-ci revenue

Test an individual app:

  • /wizard-ci basic-integration/android
  • /wizard-ci basic-integration/angular
  • /wizard-ci basic-integration/astro
Show more apps
  • /wizard-ci basic-integration/django
  • /wizard-ci basic-integration/fastapi
  • /wizard-ci basic-integration/flask
  • /wizard-ci basic-integration/javascript-node
  • /wizard-ci basic-integration/javascript-web
  • /wizard-ci basic-integration/laravel
  • /wizard-ci basic-integration/next-js
  • /wizard-ci basic-integration/nuxt
  • /wizard-ci basic-integration/python
  • /wizard-ci basic-integration/rails
  • /wizard-ci basic-integration/react-native
  • /wizard-ci basic-integration/react-router
  • /wizard-ci basic-integration/sveltekit
  • /wizard-ci basic-integration/swift
  • /wizard-ci basic-integration/tanstack-router
  • /wizard-ci basic-integration/tanstack-start
  • /wizard-ci basic-integration/vue
  • /wizard-ci misc/quack-quack
  • /wizard-ci revenue/stripe

Results will be posted here when complete.

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