posthog

posthog is a skill for Claude Code, Codex from ashish7802/awesome-api-skills. It costs 0 tokens per session (530 once invoked), scanned A, original, MIT.

A product analytics service and Node.js toolkit for recording events, identifying users, and checking feature flags, which turn features on or off for selected users.

In plain words
What is it for?
Use it to track backend actions such as sign-ups or subscription purchases, identify users, and gate beta features.
Why use it?
It helps you understand how people use an application and control feature rollouts without hard-coding every release decision.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to track backend actions such as sign-ups or subscription purchases, identify users, and gate beta features.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ashish7802/awesome-api-skills/posthog
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ashish7802/awesome-api-skills --skill posthog
Clone the repo
git clone --depth 1 https://github.com/ashish7802/awesome-api-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for posthog

README.md
[![agentmods](https://agentmods.dev/badge/skills/ashish7802/awesome-api-skills/posthog/github.svg)](https://agentmods.dev/skills/ashish7802/awesome-api-skills/posthog)
Your own site
<a href="https://agentmods.dev/skills/ashish7802/awesome-api-skills/posthog"><img src="https://agentmods.dev/badge/skills/ashish7802/awesome-api-skills/posthog/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for posthog

Your own site · 80×15
<a href="https://agentmods.dev/skills/ashish7802/awesome-api-skills/posthog"><img src="https://agentmods.dev/badge/skills/ashish7802/awesome-api-skills/posthog.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 530 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00530
Opus 5 $0.00000 $0.00265
Sonnet 5 $0.00000 $0.00106
Haiku 4.5 $0.00000 $0.00053

Measured 8d ago against content hash f047d4eb4fc2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

posthog scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

The scan reads SKILL.md. This mod also ships 4 executable files (examples/basic.py, examples/capture.ts, examples/flag.ts, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/posthog/SKILL.md · 57 lines

How it starts

The opening of the file, as written. The whole thing — 57 lines — stays where its author put it; the contents beside it link to each section on GitHub.

PostHog API Skill

Quick Start

PostHog provides complete product analytics. The Node.js SDK allows you to capture events, identify users, and evaluate feature flags from your backend.

npm install posthog-node

Common Workflows

User Identification and Events

When a user signs up, call posthog.identify() to map their internal DB ID to their analytics profile. Then, call posthog.capture() for key backend actions (e.g., 'Subscription Created').

Production Patterns

Feature Flag Evaluation

Evaluate feature flags on the backend before returning UI states. Use posthog.getFeatureFlag(flagKey, distinctId) to gate beta features securely. Local evaluation can dramatically speed up flag checks without hitting the API.

Error Recovery

The posthog-node SDK batches events and flushes them asynchronously. Ensure you call await posthog.shutdown() during your application's graceful shutdown sequence, or you will lose pending events.

Security Notes

Do not log PII (Passwords, SSNs, raw financial data) to PostHog. Scrub payloads before capture. Utilize PostHog's proxy capabilities to bypass ad-blockers securely.

Performance Considerations

Backend feature flag evaluation requires a network round-trip unless you configure Local Evaluation, which periodically syncs flag definitions and evaluates them entirely in-memory.

Testing Guidance

Disable PostHog in unit tests by passing a dummy API key and setting enable: false in the client configuration, or mock the posthog module entirely.

Troubleshooting

If events are missing in the dashboard, verify that you are flushing the queue before the serverless function (e.g., AWS Lambda) terminates. Standard asynchronous event capture will be killed instantly in Lambda.

References

Why use this skill

Use this when your agent works with posthog — structured patterns beat pasted docs and prevent common hallucinations.

Read the full file on GitHub · 57 lines

Files

What ships with it

7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 57 lines · 0 tokens per session scan A f047d4eb4fc2

Subscribe to this mod's changes

posthog is a skill published in the GitHub repository ashish7802/awesome-api-skills (13 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 530 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.