analyzing-expensive-users

analyzing-expensive-users is a skill for Claude Code, Codex from PostHog/posthog-foss. It costs 57 tokens per session (4,167 once invoked), scanned A, original, MIT.

A procedure for finding the users who generate the highest AI costs and explaining the reasons behind those costs. AI observability means tracking how AI systems behave, including their requests, responses, and spending.

In plain words
What is it for?
Use it to investigate expensive users, compare their usage with normal users, inspect example traces, and identify cost drivers.
Why use it?
A cost ranking alone does not explain what drives spending, such as request volume, model choice, retries, or large prompts and responses.

Skill for Claude CodeCodex

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

Good fit Use it to investigate expensive users, compare their usage with normal users, inspect example traces, and identify cost drivers.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/posthog/posthog-foss/analyzing-expensive-users
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 PostHog/posthog-foss --skill analyzing-expensive-users
Clone the repo
git clone --depth 1 https://github.com/PostHog/posthog-foss

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 analyzing-expensive-users

README.md
[![agentmods](https://agentmods.dev/badge/skills/posthog/posthog-foss/analyzing-expensive-users/github.svg)](https://agentmods.dev/skills/posthog/posthog-foss/analyzing-expensive-users)
Your own site
<a href="https://agentmods.dev/skills/posthog/posthog-foss/analyzing-expensive-users"><img src="https://agentmods.dev/badge/skills/posthog/posthog-foss/analyzing-expensive-users/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 analyzing-expensive-users

Your own site · 80×15
<a href="https://agentmods.dev/skills/posthog/posthog-foss/analyzing-expensive-users"><img src="https://agentmods.dev/badge/skills/posthog/posthog-foss/analyzing-expensive-users.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 57 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,167 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.00057 $0.04167
Opus 5.5 $0.00023 $0.01667
Sonnet 5.5 $0.00011 $0.00833
Haiku 4.5 $0.00006 $0.00417

Measured today against content hash 9176eef86cdc, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

analyzing-expensive-users 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 today.

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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

products/ai_observability/skills/analyzing-expensive-users/SKILL.md · 403 lines

How it starts

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

Analyzing expensive users

Use this skill when the user wants to understand the most expensive users in AI observability. The job is not just to rank users by cost. The useful answer explains what makes the top users expensive: volume, model choice, prompt size, output size, cache behavior, retries/errors, trace type, feature or tenant dimensions, and representative trace examples.

For general cost rollups, also use exploring-llm-costs. For reading individual traces, also use exploring-llm-traces.

Tools

Tool Purpose
posthog:execute-sql Rank users and compare their metrics against the project baseline
posthog:query-llm-traces-list Find high-cost traces for a specific user (by person UUID)
posthog:query-llm-trace Read representative traces to explain what actually happened
posthog:read-data-schema Discover custom event or person properties before grouping by them
posthog:generate-app-url Build region- and project-qualified links back to the UI

Core rules

  • Start with a bounded time range. If the user does not specify one, use the last 30 days and say so. If the user provides a link or existing filters, preserve the date range, test-account filter, and property filters.
  • Start from generated-call spend. The per-user ranking query groups $ai_generation rows by distinct_id, with traces, generations, errors, total_cost, first_seen, and last_seen. This is the best first pass for finding expensive users.
  • For full spend by user, include embeddings deliberately. Broader cost rollups should include event IN ('$ai_generation', '$ai_embedding'), but call out when the event set changes.
  • Filter trace-id defaults when interpreting users. Some SDKs use $ai_trace_id as distinct_id when no user is set. For identified users, exclude distinct_id = properties.$ai_trace_id and flag how much spend becomes unattributed.
  • Do not guess custom dimensions. Discover event and person properties before grouping by feature, tenant_id, plan, workflow_name, or similar customer-specific fields.
  • Read traces before explaining causality. Aggregates identify suspects; representative traces show whether the user is expensive because of a real workflow, retries, loops, large context, tool-heavy generations, or other behavior.

Read the full file on GitHub · 403 lines

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. today Changed · +2 lines 9176eef86cdc
  2. 20d ago Changed · +3 lines 42a9f0bded33
  3. 1mo ago Changed · +46 lines 9d6794b9cc42
  4. 2mo ago First seen · 352 lines · 57 tokens per session scan A cb1861d8e057

Subscribe to this mod's changes

analyzing-expensive-users is a skill published in the GitHub repository PostHog/posthog-foss (734 stars, last pushed today), licensed MIT. It adds 57 tokens to every session and 4,167 once invoked, about $0.0002 per session on Opus 5.5. 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.

Related

analyzing-expensive-users compared with skills from other repositories

analyzing-expensive-users next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
analyzing-expensive-usersPostHog/posthog-fossSkill734todayMITA57Claude Code, Codex
agent-platform-model-registrygoogle/skillsSkill25ktodayApache-2.0A60Claude Code, Codex
llm-evaluationsickn33/agentic-awesome-skillsSkill51ktodayMITA25Claude Code
google-cloud-solution-agentic-analytics-spark-knowledge-cataloggoogle/skillsSkill25ktodayApache-2.0A132Claude Code, Codex
training-checkwanshuiyin/Auto-claude-code-research-in-sleepSkill20kyesterdayMITA35Claude Code
foundry-config-setupmicrosoft/agent-frameworkSkill15k13d agoMITA65Claude Code, Codex
tao-run-inference-serviceNVIDIA/skillsSkill4.2ktodayApache-2.0A92Claude Code