filtering-bot-traffic — Claude Code skill: what it does
filtering-bot-traffic splits human traffic from bots and AI crawlers in PostHog. Use it to clean a metric or to see how much of the traffic runs on autopilot.
no license 208 installs ★ 101 updated 2026-10-24
npx skills add PostHog/ai-plugin --skill filtering-bot-traffic -a claude-codeWhat filtering-bot-traffic does
The skill hands the agent a classification map for PostHog traffic. Requests get sorted by user agent into four buckets: Regular, AI Agent, Bot, Automation. From there the agent either drops the noisy part from an insight or measures how much came from crawlers and which company runs them.
Inside the insight builder and filters you get virtual properties: $virt_is_bot, $virt_traffic_type, $virt_traffic_category, $virt_bot_name, $virt_bot_operator. They read the user agent on their own. In hand-written SQL the same answers come from isLikelyBot, getTrafficType, getBotType and the rest.
One thing breaks quietly in HogQL: the argument has to be the plain properties.$raw_user_agent. Wrap it in coalesce(...) and events from server and mobile SDKs lose their exemption for an empty user agent, so bot counts inflate. Filtering changes the numbers in a query only; stored events stay untouched. Real-time questions and the Live tab tiles belong to the exploring-live-traffic skill.
What it helps with
- drop bots from pageview and session counts
- measure the share of traffic coming from AI crawlers
- list which crawlers and operators reach the site
- split a trend by traffic type
- build a dashboard with human visitors only
Example prompts for the agent
- Filter crawlers out of the signup funnel: keep only events where
$virt_is_botis false. - What share of last month's traffic was AI agents? Break it down by
$virt_bot_name. - Which bot operators hit our docs most often?
How to install filtering-bot-traffic
1Skills CLI (Vercel)
npx skills add PostHog/ai-plugin --skill filtering-bot-traffic -a claude-code2Manually: put the files in place
~/.claude/skills/filtering-bot-traffic/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/filtering-bot-traffic/
1Skills CLI (Vercel)
npx skills add PostHog/ai-plugin --skill filtering-bot-traffic -a codex2Manually: put the files in place
.agents/skills/filtering-bot-traffic/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add PostHog/ai-plugin --skill filtering-bot-traffic -a cursor2Manually: put the files in place
.cursor/skills/filtering-bot-traffic/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install PostHog/ai-plugin skills/filtering-bot-traffic2Manually: put the files in place
.github/skills/filtering-bot-traffic/SKILL.md1Skills CLI (Vercel)
npx skills add PostHog/ai-plugin --skill filtering-bot-traffic -a gemini-cli2Platform CLI
gemini skills install https://github.com/PostHog/ai-plugin --path skills/filtering-bot-trafficManually: put the files in place
.devin/skills/filtering-bot-traffic/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add PostHog/ai-plugin --skill filtering-bot-traffic -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about filtering-bot-traffic
How do I install filtering-bot-traffic in Claude Code?
Run npx skills add PostHog/ai-plugin --skill filtering-bot-traffic -a claude-code. The skill lands in ~/.claude/skills/filtering-bot-traffic/SKILL.md.
What does filtering-bot-traffic do?
It tells the agent how to use PostHog virtual properties and HogQL functions to exclude bots from an insight or to size up automated traffic and who sends it.
Does it cover real-time numbers?
No. This one is for historical windows, saved insights, dashboards and filters. Questions about the last few minutes and the Live tab tiles go to exploring-live-traffic.