feat(agent): exclude Code from the "PostHog resources used" bar#2546
Merged
Conversation
The "Code" chip was added to the resources-used bar on every file read, which means it showed up on essentially every task. Since the user is by definition already using PostHog Code, the chip carried no information and its link (posthog.com/code landing page) was confusing. Removes the `code` product entirely: the onCodeFileRead PostToolUse hook and its plumbing through claude-agent / options, the `code` entry in POSTHOG_PRODUCTS, and the icon/doc-url entries in the renderer bar. Generated-By: PostHog Code Task-Id: 76097881-cedd-478b-bfa0-eb96cf4d9e11
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
Contributor
|
Reviews (1): Last reviewed commit: "feat(agent): exclude Code from the "Post..." | Re-trigger Greptile |
tatoalo
approved these changes
Jun 9, 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.
Problem
The "PostHog resources used" bar above the composer surfaced a Code chip on essentially every task — it was added on any file read. Since a user driving PostHog Code is already, by definition, using Code, the chip carried no information, and its link to the
posthog.com/codelanding page left people confused about what it was telling them (per the Slack thread that prompted this).Changes
Removes the
codeproduct from the resources-used display entirely:onCodeFileReadPostToolUse hook and its plumbing throughclaude-agent.tsandsession/options.ts.codeentry fromPOSTHOG_PRODUCTSand the corresponding icon / doc-URL entries inSessionResourcesBar.Other PostHog product chips (Experiments, Feature flags, SQL, …) are unaffected.
How did you test this?
pnpm --filter agent typecheckandpnpm --filter code typecheck— clean.pnpm --filter agent exec vitest runonhooks.test.tsandposthog-products.test.ts(91 tests) — pass.pnpm --filter code exec vitest runonaccumulateSessionResources.test.ts(3 tests) — pass.Automatic notifications
Created with PostHog Code from a Slack thread