Skip to content

feat: standalone telemetry plugin - #230

Merged
carlos-marchal-ph merged 2 commits into
mainfrom
feat(aio)/standalone-telemetry-plugin
Sep 22, 2026
Merged

carlos-marchal-ph merged 2 commits into
mainfrom
feat(aio)/standalone-telemetry-plugin

Conversation

@carlos-marchal-ph

Copy link
Copy Markdown
Contributor

Problem

  • A team that wants Claude Code sessions in PostHog LLM analytics has to install the whole plugin. The plugin also loads 167 skills, an agent and the MCP server into every session.
  • The capture is already self-contained. The SessionEnd hook reads the session log and posts $ai_generation, $ai_span and $ai_trace on its own, and it imports nothing from the skills or MCP side.
  • Claude Code has no per-component toggle, so taking the hook alone meant forking the repository. #147 asks for a split.

Changes

  • claude plugin install posthog-telemetry@posthog installs session capture on its own.
  • A second marketplace.json entry points at ./telemetry, which holds the hook, the posthog_llma package, the manual ingest script, and their tests.
  • The posthog plugin behaves as before. Its manifest still auto-discovers hooks/hooks.json, which now calls the hook at its new path.
  • The hook resolves its package directory from __file__, not CLAUDE_PLUGIN_ROOT. The package sits beside the hooks/ directory in both plugins, while CLAUDE_PLUGIN_ROOT differs between them.
  • sync-skills.yml bumps the new manifest too, and now selects marketplace entries by name instead of by index. An install pins the version, so an entry that misses a bump never reaches the people who installed it.
  • tests/test_plugin_paths.py asserts that every path a manifest hands to Claude Code resolves. claude plugin validate checks manifest schema only, and passes with a source that points at a directory that does not exist.
  • The rest is a file move. 11 files change path, and only the hook's sys.path line changes content.
  • No PostHog UI changes. The new entry appears in the claude plugin marketplace listing.

Cost per session, from claude --plugin-dir <path> plugin details <name>:

plugin always-on inventory
posthog-telemetry ~0 tok 1 hook, harness-only
posthog ~30,162 tok 167 skills, 1 agent, 1 MCP server

That is the uncapped inventory. The realized cost is lowe

@carlos-marchal-ph carlos-marchal-ph self-assigned this Sep 22, 2026
@carlos-marchal-ph
carlos-marchal-ph requested a review from a team September 22, 2026 10:39
@carlos-marchal-ph
carlos-marchal-ph merged commit 469d177 into main Sep 22, 2026
11 checks passed
@carlos-marchal-ph
carlos-marchal-ph deleted the feat(aio)/standalone-telemetry-plugin branch September 22, 2026 14:07
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