feat: emit Claude Code plugin hint for the official Pinecone plugin#100
Merged
Conversation
Add support for the Claude Code plugin-hint protocol (https://code.claude.com/docs/en/plugin-hints). When `pc` runs inside a Claude Code session, it writes a one-line `<claude-code-hint />` marker to stderr recommending the official `pinecone@claude-plugins-official` plugin. Claude Code strips the marker before it reaches the model and shows the user a one-time install prompt. - New `internal/pkg/utils/pluginhint` package gated on the CLAUDECODE and CLAUDE_CODE_CHILD_SESSION env vars, emitting at most once per process. - Wired into root Execute() so it fires for every invocation (including --help and unknown-command errors) regardless of subcommand PreRun hooks. - Unit tests for emission, no-op-outside-Claude-Code, emit-once, and protocol conformance. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Keep the protocol-rule comments a reader can't infer from the code (package doc, hintLine constraints, env-var semantics) and drop the per-symbol restatements. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
austin-denoble
approved these changes
Jun 24, 2026
austin-denoble
left a comment
Collaborator
There was a problem hiding this comment.
LGTM, thanks @hdworld11 for taking the time to get this spun up!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the Claude Code plugin-hint protocol. When
pcruns inside a Claude Code session, it writes a one-line marker to stderr recommending the official Pinecone plugin:Claude Code strips this line from the command output before it reaches the model (so it never appears in the conversation or counts toward tokens) and shows the user a one-time prompt to install the plugin. Installation always requires explicit user confirmation.
What the user sees
pcdirectly in a terminal: no change at all — emission is gated on env vars that Claude Code sets, so a no-op otherwise.pcthrough Claude Code: a one-time install prompt naming thepineconeplugin. Rate-limited to once per plugin (ever) and once per Claude Code session.Changes
internal/pkg/utils/pluginhintpackage:CLAUDECODEorCLAUDE_CODE_CHILD_SESSIONbeing set.sync.Once-guarded — emits at most once per process.root.Execute()so it fires for every invocation (including--helpand unknown-command errors), regardless of any subcommandPersistentPreRunoverrides.Notes for reviewers
pineconeis listed in the officialclaude-plugins-officialmarketplace. Hints pointing at any other marketplace are silently dropped by Claude Code. If the official listing uses a different name, updatehintLineinpluginhint.go(and the matching test assertion).go build/go test/go vetlocally (Go isn't installed on the dev machine). Please confirm CI is green before merging.🤖 Generated with Claude Code
Note
Low Risk
Behavior is gated on Claude Code env vars and only adds optional stderr output with no changes to auth, API calls, or normal terminal usage.
Overview
Adds Claude Code plugin-hint support so
pccan suggest installingpinecone@claude-plugins-officialwhen the CLI runs inside a Claude Code session.A new
pluginhinthelper writes a single protocol line to stderr only whenCLAUDECODEorCLAUDE_CODE_CHILD_SESSIONis set, guarded bysync.Onceso it fires at most once per process. Outside Claude Code it is a no-op.root.Execute()callspluginhint.Emit()before Cobra runs so the hint applies to every invocation (including--helpand unknown commands), not only subcommands that runPersistentPreRun. Unit tests cover env detection, no-op behavior, emit-once, and the hint string format.Reviewed by Cursor Bugbot for commit 6eb1bd9. Bugbot is set up for automated code reviews on this repo. Configure here.