
Posthog Instrumentation
posthog/posthog-for-claudeOfficial
Guided addition of PostHog event tracking, identification, and feature flags across JavaScript, Python, and React code.
- skills.sh installs
- 2.3K
- GitHub stars
- 13
- last updated
- Jul 14, 2026
Own this skill? Claim it
What it does
- Covers the workflow of identifying the framework, checking for an existing PostHog setup, then adding instrumentation
- Includes code patterns for
posthog.capture,posthog.isFeatureEnabled, andposthog.identifyin JavaScript/TypeScript, plus Pythonfeature_enabledand ReactusePostHog - Recommends snake_case event naming, attaching relevant properties to events, and identifying users early in the session
- Designed for developers adding analytics or gradual feature-flag rollouts to an existing codebase
Install
$ npx -y skills add posthog/posthog-for-claude --skill posthog-instrumentation -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
PostHog Instrumentation Skill
Help users add PostHog analytics, event tracking, and feature flags to their code.
When to Use
- User asks to "add PostHog" or "add analytics"
- User wants to track events or user actions
- User needs to implement feature flags
- User asks about instrumenting their code
Workflow
- Identify the framework (React, Next.js, Python, Node.js, etc.)
- Check for existing PostHog setup
- Add appropriate instrumentation
Code Patterns
JavaScript/TypeScript
// Event tracking
posthog.capture('button_clicked', { button_name: 'signup' })
// Feature flags
if (posthog.isFeatureEnabled('new-feature')) {
// Show new feature
}
// User identification
posthog.identify(userId, { email: user.email })
Python
from posthog import Posthog
posthog = Posthog(api_key='<ph_project_api_key>')
# Event tracking
posthog.capture(distinct_id='user_123', event='purchase_completed')
# Feature flags
if posthog.feature_enabled('new-feature', 'user_123'):
# Show new feature
React
import { usePostHog } from 'posthog-js/react'
function MyComponent() {
const posthog = usePostHog()
Details
- Repository
- github.com/posthog/posthog-for-claude
- Categories
- Marketing, SEO & Ads, Frontend & UI Code
- First seen
- Apr 16, 2026
Similar to Posthog Instrumentation
More Marketing, SEO & Ads
instrument-product-analyticsSkillposthog/skills886 installsGuided PostHog analytics instrumentation that adds meaningful capture events, user identification, and error tracking across frameworks.
instrument-feature-flagsSkillposthog/skills623 installsGate new functionality behind PostHog feature flags, with SDK setup handled when PostHog is absent.
posthog-analyticsSkillalinaqi/maggy736 installsAnalytics setup skill for PostHog covering event tracking, user identification, feature flags, and dashboards.
PostHogMCP serverposthog41K starsProduct analytics, feature flags, experiments, and error data from PostHog, with read and write tools.
setup-agent-analyticsPluginanthropics/claude-plugins-official47.9K starsDetect AI agents in your codebase and instrument them with Pendo Agent Analytics via the best-fit path: Python SDK, TypeScript SDK, client-side trackAgent(), or