posthog

Capture PostHog events, evaluate feature flags, and run HogQL queries.

1|Updated Mar 11, 2026
One-click install
npx skills add https://github.com/antonyfmunoz/OS --skill posthog-antonyfmunoz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: posthog
Source: https://github.com/antonyfmunoz/OS/tree/main/skills/tools/posthog
Command: npx skills add https://github.com/antonyfmunoz/OS --skill posthog-antonyfmunoz

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

PostHog Skill helps you reliably capture product analytics, evaluate feature flags and experiments, and run analysis queries (including HogQL) so you can see what users do and ship changes safely.

Core Features & Use Cases

  • Product event capture & grouping: emit capture() events keyed by distinct_id, enrich with properties and groups (e.g., company), and support $identify / $set patterns for stable user profiles.
  • Feature flags, experiments, and local eval: evaluate flags locally using the personal API key to avoid /decide/ on hot paths, with staged rollouts for skills and agents.
  • Insights via HogQL and REST queries: run ClickHouse-flavored HogQL escape-hatch queries against events, persons, groups, and cohorts using the PostHog query endpoints.
  • LLM observability: wrap OpenAI/Anthropic (and Gemini via posthog.ai) calls to automatically emit $ai_generation events with tokens, latency, cost, and trace/span IDs.

Quick Start

Use the posthog skill to capture an event from Python using your project API key with distinct_id set to the user identifier and then query the resulting funnel or retention with HogQL.

Frequently Asked Questions about posthog

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I capture product analytics events with distinct_id and user properties?

Capture product analytics events by emitting capture() events keyed by distinct_id, enriching them with properties and groups, and using $identify and $set patterns to maintain stable user profiles in PostHog.

How do I evaluate feature flags locally to avoid hitting the /decide/ endpoint on hot paths?

Evaluate feature flags locally using your personal API key to bypass the /decide/ endpoint on hot paths, enabling staged rollouts for skills and agents directly within your application.

Can I run HogQL queries directly against PostHog events and persons data?

Yes, you can run ClickHouse-flavored HogQL escape-hatch queries against events, persons, groups, and cohorts using PostHog query endpoints to retrieve insights and funnel data.

How do I set up LLM observability to track token usage and latency for AI generation events?

Set up LLM observability by wrapping OpenAI, Anthropic, or Gemini calls to automatically emit $ai_generation events containing token counts, latency, cost, and trace span IDs.

Do I need specific API keys and host-region pinning for PostHog instrumentation?

Yes, correct usage requires phc_ or phx_ project API keys and host-region pinning to ensure events, feature flags, and experiments align with posthog-python SDK behavior.

What is the best way to track session replay and product experiments in Python?

Track session replay and experiments by configuring session replay settings and utilizing feature flag workflows alongside product event capture to safely ship and monitor changes.