Skip to content

Emit Claude Code plugin hint to stderr#1550

Merged
tomer-stripe merged 4 commits intomasterfrom
tomer/claude-code-plugin-hint
Apr 28, 2026
Merged

Emit Claude Code plugin hint to stderr#1550
tomer-stripe merged 4 commits intomasterfrom
tomer/claude-code-plugin-hint

Conversation

@tomer-stripe
Copy link
Copy Markdown
Collaborator

Summary

  • When the Stripe CLI detects it's running inside Claude Code (CLAUDECODE env var), it emits a <claude-code-hint /> tag to stderr
  • Claude Code strips the hint from output and may prompt users to install the official Stripe plugin
  • Protocol spec: https://code.claude.com/docs/en/plugin-hints

Test plan

  • Unit tests for hint emission (set/unset env var)
  • go build ./... compiles
  • Verified hint is stripped by Claude Code when running inside it

🤖 Generated with Claude Code

When running inside Claude Code (CLAUDECODE env var is set), emit a
<claude-code-hint /> tag to stderr so Claude Code can prompt users to
install the official Stripe plugin from the marketplace.

See https://code.claude.com/docs/en/plugin-hints for the protocol.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Committed-By-Agent: claude
@tomer-stripe tomer-stripe requested a review from a team as a code owner April 17, 2026 00:27
Copy link
Copy Markdown
Contributor

@bernerd-stripe bernerd-stripe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small suggestion, otherwise LGTM

Comment thread pkg/cmd/claudecodehint.go Outdated
Comment thread pkg/cmd/claudecodehint.go
tomer-stripe and others added 3 commits April 21, 2026 15:11
Address review feedback: reuse the existing useragent.DetectAIAgent
helper to check for Claude Code rather than reading the env var directly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Committed-By-Agent: claude
@tomer-stripe tomer-stripe merged commit 69cf2f7 into master Apr 28, 2026
10 checks passed
@tomer-stripe tomer-stripe deleted the tomer/claude-code-plugin-hint branch April 28, 2026 23:59
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.

2 participants