Skip to content

fix(cli): suppress Claude Code hint when stderr is not a terminal#5219

Open
1wos wants to merge 1 commit intosupabase:developfrom
1wos:fix-issue-5212-claude-code-trailer-when-stderr-not-tty
Open

fix(cli): suppress Claude Code hint when stderr is not a terminal#5219
1wos wants to merge 1 commit intosupabase:developfrom
1wos:fix-issue-5212-claude-code-trailer-when-stderr-not-tty

Conversation

@1wos
Copy link
Copy Markdown

@1wos 1wos commented May 10, 2026

Fixes #5212.

SuggestClaudePlugin() now skips the hint when stderr is not a terminal, so it can no longer contaminate redirected output such as supabase gen types > out.ts 2>&1. Verified inside a Claude Code session and added a unit test.

When the CLI runs inside Claude Code with stdout (or stderr via 2>&1)
redirected to a file, the plugin-hint trailer was being written to the
captured stream and corrupting outputs such as `supabase gen types > out.ts`.

Gate the trailer behind `term.IsTerminal` on stderr so it is only emitted
to interactive terminals.

Fixes supabase#5212.
@1wos 1wos requested a review from a team as a code owner May 10, 2026 13:31
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.

supabase gen types corrupts redirected output with <claude-code-hint /> trailer when CLAUDECODE=1

1 participant