Emit Claude Code plugin hint at module load time - #1
Open
johno-stripe wants to merge 4 commits into
Open
Conversation
Update generated code for v2349 and 44014016ec56efb57a8cf6d0ee0771c2e6b4eebe Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
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.
Why?
Claude Code supports a plugin hint feature, where if we detect the
CLAUDECODEorCLAUDE_CODE_CHILD_SESSIONenvironment variables, emitting the following string will prompt the user to install our official plugin:<claude-code-hint v="1" type="plugin" value="stripe@claude-plugins-official" />Our plugin's source code can be found here.
What?
Note that while this will fire frequently, Claude Code will automatically hide these log lines and keep the user from being re-prompted:
My first approach was to emit this using a post-install script, but npm unfortunately hides the output from the installing process, so those error logs didn't successfully reach Claude.
See Also
Key source here is the documentation on how plugin hints work:
Changelog
CLAUDECODEorCLAUDE_CODE_CHILD_SESSIONenvironment variables are detected.