feat: emit Claude Code plugin hint from CLI#5153
Merged
Conversation
Adds a claude-code-hint tag to stderr when running inside Claude Code (CLAUDECODE env var set). Claude Code strips the tag before it reaches the model and shows a one-time prompt to install the Supabase plugin. Emits on every invocation via Execute() for maximum coverage, and again after login success so users in a setup flow are reached too. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Coverage Report for CI Build 25172242271Coverage decreased (-0.04%) to 63.751%Details
Uncovered Changes
Coverage Regressions5 previously-covered lines in 1 file lost coverage.
Coverage Stats
💛 - Coveralls |
avallete
reviewed
Apr 30, 2026
Adds a claude-code-hint tag to stderr when running inside Claude Code (CLAUDECODE env var set). Claude Code strips the tag before it reaches the model and shows a one-time prompt to install the Supabase plugin. Emits on every invocation via Execute() for maximum coverage, and again after login success so users in a setup flow are reached too. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Extracts IsClaudeCode() from the existing IsAgent() check in agent.go and reuses it in SuggestClaudePlugin(). This ensures both places check the same env vars (CLAUDECODE and CLAUDE_CODE) consistently. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
avallete
approved these changes
Apr 30, 2026
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
SuggestClaudePlugin()tointernal/utils/misc.gothat returns the<claude-code-hint />tag when theCLAUDECODEenv var is set (no-op otherwise)Execute()(cmd/root.go) so everysupabaseinvocation can trigger the hintinternal/login/login.go(both token and browser paths) to catch users in a setup flowClaude Code deduplicates by plugin per session, so emitting broadly is safe. The tag is stripped from output before it reaches the model and never counts toward token usage.
Closes AI-689
References