Repository navigation
Description
Describe the feature or problem you'd like to solve
Since 2.105.0 (#15077), gh api repos/O/R/pulls/N/..., gh pr view and gh pr create print a nine-line gh event listen hint on stderr whenever an agent is detected. Nothing turns it off: gh help environment and gh config have no key for it, so the only escape is to unset AI_AGENT, CLAUDECODE and friends for every gh call, which also removes the agent from the User-Agent.
We don't poll. Our agents wait on pull requests through a self-hosted service (below), and they call gh api .../pulls/N/comments or gh pr view for one-off reads: listing unanswered review threads, fetching a comment id to reply to, checking a field. Every one of those reads now carries the hint. An agent's stderr goes straight into its context window, where it stays and is re-read on each later model call until the context is compacted.
Measured from our Claude Code transcripts between installing 2.105.0 (2026-11-18 10:54 UTC) and 2026-11-20 07:50 UTC, about 45 hours:
| Transcripts containing the hint | 38 (9 sessions and their subagents) |
| Hints printed | 162 |
| One hint | ~810 characters, ~195 tokens |
| Tokens added to context | ~32,000 |
| Tokens re-read by later model calls before compaction | ~8.0 million |
The five sessions with the most hints, each counted with its subagents:
| Session | Hints | Tokens added | Tokens re-read |
|---|---|---|---|
| A | 62 | 12,300 | 2.6M |
| B | 51 | 10,100 | 3.5M |
| C | 26 | 5,100 | 1.0M |
| D | 8 | 1,600 | 0.34M |
| E | 6 | 1,200 | 0.15M |
Method: each hint's length times the number of distinct model requests after it in the same transcript, up to the next compaction. Token counts use o200k_base as a stand-in tokenizer. Most re-reads are prompt-cache hits, so the bigger costs are context-window room and earlier compaction.
Proposed solution
- An opt-out, in the style of
GH_NO_UPDATE_NOTIFIER: for exampleGH_NO_AGENT_HINTS=1orgh config set agent_hints disabled, listed ingh help environment. - Show the hint for polling, not for the first read. Print it only when the same pull request has been read several times within a few minutes, or at most once per pull request per day, using the cache directory to remember. A single
GETof/pulls/N/commentsis not a wait loop. - Make it one line, such as
hint: to wait for this pull request, see gh event listen --help. The details are already in that help text.
Additional context
We wait on pull requests through our own watcher rather than gh event listen. What the Events API would need for us to switch is platform feedback, so it is in the Event Streams preview discussion (https://github.com/orgs/community/discussions/211595), not here. This issue is only about the hint gh prints.
Activity
cli-triage commentedon Nov 20, 2026
Version 2.105.0 documents the new agent hint, but
gh help environmentdoes not list a way to disable it. The selected source build has the same environment help. This means the requested opt-out is not currently supported through a documented environment variable. The report also identifies a clear behavior gap: one-off reads receive guidance intended for polling, and repeated multi-line stderr output can add avoidable agent context. Tracking an opt-out and less repetitive presentation as an enhancement makes sense. The exact suppression policy can be decided during design.Supporting reports
Duplicate analysis
Label reasoning
Investigation notes
Generated by issue triage.
github-actions commentedon Nov 20, 2026
Thank you for your issue! We have categorized it as an enhancement (feature or improvement) request, and it has been added to our backlog. In doing so, we are not committing to implementing this feature at this time, but, we will consider it for future releases based on community feedback and our own product roadmap.
Unless you see the help wantedContributions welcome
label, we are not currently looking for external contributions for this feature.
If you come across this issue and would like to see it implemented, please add a thumbs up! This will help us prioritize the feature. Please only comment if you have additional information or viewpoints to contribute.
explorateur : selection contextuelle par type de fichier
babakks commentedon Nov 21, 2026
Thanks for the detailed report and the numbers behind it, @shauneccles! 🙏
The measurements are really helpful, and you're right that a one-off read is not a wait loop. Here are my thoughts on each proposal:
GH_NO_UPDATE_NOTIFIER, along with a matchinggh configoption for a persistent setting, would let setups like yours, which already have their own way of waiting, turn the hint off without having to hide the agent fromgh.gh event listen --helpis not an effective way to get them to use the command, so I kept the copyable command in the hint.I'll keep this open as an enhancement and update here once I've settled on the opt-out.
@BagToad, I'd love to hear your thoughts on this.
kym6464 commentedon Nov 21, 2026
(My 2 cents in case it's helpful) With this approach, you need a way to ensure it only fires once per session. Otherwise, you are costing people money and hurting their agents' performance by wasting precious context.
In Claude Code, you could do this via a plugin + claude-state (I often use this "one-time hint" pattern to inject point-in-time context). I personally would not install a GitHub CLI plugin that does only this one thing (I'd rather create a shim that unsets these env vars). However, if the plugin had other benefits, I may consider it, and that would unlock a lot of cool use cases for the GitHub CLI team.
You could technically do this in the CLI itself: you already read the harness's env vars, and Claude Code exposes CLAUDE_CODE_SESSION_ID, so a marker file per session ID in the cache dir would work (if the write fails, fall back to today's behavior). But the CLI still can't know when the hint has left the agent's context (compaction, subagents, etc), which is why I think a proper solution requires integrating with each harness.
Blondie0123 commentedon Nov 22, 2026
aw632 commentedon Nov 24, 2026
It's incredibly annoying that
gh event listenruns all the time when event listening is not even available to all accounts, or even the vast majority of accounts. It's noise with no resolution.