Every time one of your saved PostHog queries runs it leaves a single line saying how it went; this pulls those lines up to show why a run failed, came back empty, or took too long.
WHEN TO USE
SCOPE
USE FOR
Find out why one saved query suddenly started failing, and what the error was.
Check whether recent runs reused a cached result or recomputed from scratch.
See how many rows a run actually returned when the answer looked wrong.
Pin a new problem to the version of the query that was published that day.
NOT FOR
Decide whether to raise a slow endpoint's cache TTL or materialise it (use diagnosing-endpoint-performance instead).
Audit endpoint health across a whole project rather than one endpoint's logs (use auditing-endpoints instead).
This is a saved copy of the skill's SKILL.md instructions. It may differ from the upstream file or the version you install.
Exploring endpoint execution logs
Every endpoint run emits one execution log entry to PostHog's log_entries store. This skill
reads those entries for a specific endpoint to answer "what happened when it ran?". It is the
log-level counterpart to diagnosing-endpoint-performance (which reasons about cache/materialisation
strategy from config and query_log).
When to use this skill
"Why is my endpoint failing / erroring?"
"Show me the logs / recent runs for endpoint X"
"Did the last run hit cache? How many rows did it return?"
"What happened the last time endpoint Y ran?"
If the question is "this endpoint is slow, what should I change?", use
diagnosing-endpoint-performance. If it's project-wide ("what can I clean up?"), use
auditing-endpoints.
What an execution log entry looks like
Each run produces exactly one entry. The level is INFO on success and ERROR on failure, and the
message carries the extra data as searchable key=value tokens:
Whether the query result cache was used (omitted for ducklake)
duration_ms
integer
Wall-clock execution time
rows
integer
Number of result rows returned
version
integer
Which endpoint version ran
error
e.g. ResolutionError, HogVMException
Error class / HogQL code name (failures only)
Each run gets a distinct instance_id, so logs group one-per-execution in the viewer.
Available tools
Tool
Purpose
endpoint-logs
Primary. Execution log entries for one endpoint by name. Filter by level, search, time range, instance_id; limit up to 500.
endpoint-get
Endpoint config for context (current version, materialisation, query kind)
execute-sql
Fallback / aggregation directly against log_entries (log_source='endpoints')
Filtering
endpoint-logs exposes the standard log filters:
level — comma-separated, e.g. ERROR to see only failed runs, or INFO,ERROR for all.
search — case-insensitive substring over the message. Because the extra data is in
key=value tokens, you can search cache=miss, path=inline, error=ResolutionError, or a
specific version=3.
after / before — ISO timestamps to bound the time range.
instance_id — pin a single execution.
limit — 1–500 (default 50).
Workflow
Identify the endpoint by name. If given a URL, parse it from
/api/projects/{team_id}/endpoints/{name}/run.
Start broad: endpoint-logs for the endpoint with a recent time range. Skim levels and tokens.
Narrow to the symptom:
Failures → level=ERROR; read the error= token and path= to see where it broke.
Cache concerns → search=cache=miss to see how often runs miss cache.
Wrong results → compare rows= across runs, and version= to spot a regression after a
version bump.
For counts/trends across many runs (e.g. error rate over a week), drop to execute-sql against
log_entries:
SELECT toDate(timestamp) AS day, upper(level) AS level, count() AS runs
FROM log_entries
WHERE log_source = 'endpoints' AND log_source_id = '<endpoint_uuid>'
GROUP BY day, level ORDER BY day DESC
Get the endpoint UUID from endpoint-get (the log_source_id is the endpoint id, not its name).
Summarize: what's failing, since when, on which version/path, and whether it's a config issue
(hand off to diagnosing-endpoint-performance) or a query bug.
Example interaction
User: "weekly_signups started erroring this morning"
Agent steps:
- endpoint-logs weekly_signups, level=ERROR, after=<this morning>
→ several "Endpoint execution failed · path=inline error=ResolutionError version=5"
- endpoint-get weekly_signups → current version is v5 (bumped today)
- endpoint-logs weekly_signups, level=INFO, before=<this morning>
→ prior runs: "path=inline cache=hit ... version=4" succeeded
- "v5 (created this morning) is failing with a ResolutionError on the inline path — it can't
resolve a table or field reference. v4 ran fine. This looks like a bad query in the new
version. Want me to pull the v5 query (endpoint-versions) so we can fix it, or roll back to v4?"
Important notes
One entry per run. Don't expect step-by-step traces — endpoints log a single completion line.
The detail lives in the tokens, not in multiple lines.
log_source_id is the endpoint UUID, not the name. For execute-sql, fetch it via
endpoint-get first.
Logs are retained ~90 days (the log_entries TTL). Older runs won't appear.
Execution logs ≠ query performance.endpoint-logs tells you what happened and why a run
failed; for "should I materialise / bump cache TTL?" use diagnosing-endpoint-performance, which
reasons over config and query_log cost metrics.
Best-effort emission. A log line is emitted after each run but never blocks it — if a run
succeeded for the caller but no log shows, the emit was dropped, not the query.
MCP connection required
1 FOR YOU
01
Connect the PostHog MCP server
Connect PostHog's MCP server so the skill can read the endpoint's execution log entries via endpoint-logs and related tools.
🔌 This skill ships inside the PostHog AI Plugin. Listed package contents include 3 slash commands, 1 agent, hooks and an MCP server. Installed components and skill versions may vary by AI tool.
Install just this skill
Run this outside your AI tool, using Node.js 22.20.0 or newer. Skills CLI 1.7.2 skips skill selection; prompts cancel installation without an interactive terminal. If choosing Project when asked about installation scope, open your project's folder before running this.
Install checklist
Check selected tools if a picker appears; Claude Code may be unchecked under Additional agents. ↑/↓ moves, Space toggles selections, Enter confirms.
Without a tool picker, check Installing to: for your intended tool. Stop if it names a different tool.
If asked, choose Symlink (Recommended) for shared files or Copy to all agents for separate copies; review the summary before confirming installation.
Install the find-skills skill? defaults to Yes, adding another skill for all projects. Choose No if you don't want that extra installation.
Skills CLI 1.7.2 sends install data to skills.sh by default, including the source, skill names, target tools and file details; GitHub sources are reported only when GitHub confirms the repository is public, while other remote sources can also be reported. Confirmed-public GitHub sources also trigger a security-audit request. Before installing, set the environment variable DO_NOT_TRACK=1 or DISABLE_TELEMETRY=1 to disable both.
After installing for Claude Code, open it in the installation project if you chose Project; Global makes the skill available across projects on this computer. Once Claude Code loads the skill, its description helps Claude decide when to use it.
If installation created a top-level skills folder that did not exist when your Claude Code session started, run /reload-skills in that session. Run it again after later changes in that folder.
MCP server required
The skill's steps call for tools from the PostHog MCP server. Installing just this skill doesn't add that connection; set it up in your AI tool if it isn't there yet: PostHog MCP setup. Installing the whole plugin instead includes the connection settings.
Requirements for the PostHog MCP server
Connecting is free; sign in with your PostHog account.
Some tools use AI internally and may incur PostHog AI charges. Those tools require AI data processing to be enabled in your organization settings.
Install the whole plugin
This route installs the posthog plugin package selected for your AI tool.
Claude Code
Add PostHog's marketplace, then install the plugin
Run both lines in a terminal. They install PostHog's posthog plugin: this skill, PostHog's other skills, and a connection to PostHog's hosted MCP server.
01
claude plugin marketplace add PostHog/ai-plugin
02
claude plugin install posthog@posthog
Installation and loading
The plugin installs for you in every project and loads the next time you start Claude Code, or after /reload-plugins in an open session.
To connect your PostHog account, start claude, type /mcp, select plugin:posthog:posthog and follow the browser prompts.
Good to know
The plugin includes PostHog's session-capture hook; PostHog's README says it sends sessions to LLM Analytics only when POSTHOG_LLMA_CC_ENABLED=true and POSTHOG_API_KEY are both set.
If you use the separate posthog-telemetry plugin, PostHog says to keep only one of the two, because both register the same hook.
On a self-hosted PostHog, this route's MCP connection won't reach your instance: the plugin's config is fixed to https://mcp.posthog.com/mcp, which routes to PostHog's US or EU region. POSTHOG_MCP_URL works only for the Gemini CLI extension.
Sync columns from a synced data warehouse table onto PostHog person or group properties, so warehouse data becomes usable anywhere person and group properties already work: feature flag targeting, cohorts, insight filters and breakdowns, surveys, session replay filters, workflows, and the person profile. Use when the user wants to "add a person property from my warehouse", "enrich people with Stripe/Postgres/Salesforce data", "put ARR or plan tier on my persons", "target a feature flag by a warehouse column", "sync warehouse columns onto groups or organizations", or wants to inspect, backfill, disable, or debug an existing warehouse-backed person or group property.Read full description
Analyze the most expensive users in AI observability and explain why they cost so much. Use when the user asks about top spenders, expensive users, per-user LLM cost, user-level cost drivers, or patterns behind high AI observability spend.Read full description
Analyze session replay patterns across experiment variants to understand user behavior differences. Use when the user wants to see how users interact with different experiment variants, identify usability issues, compare behavior patterns between control and test groups, or get qualitative insights to complement quantitative experiment results. Also covers pairing the observed behavior with a linked survey when the user wants qualitative feedback beyond what recordings show.Read full description
Assesses what a page's heatmap is telling you and recommends concrete changes. Pulls click / rageclick / scroll-depth data for a URL, names the hot elements by cross-referencing autocapture events on the same page, and can create a saved heatmap the user opens in PostHog, then summarizes the behavior and proposes improvements.
TRIGGER when: user asks what a heatmap shows, why people aren't clicking something, where users rage-click, how far they scroll, what to change on a page based on heatmap/click data, or to 'analyze/assess/review the heatmap' for a URL.
DO NOT TRIGGER when: the user only wants to create a saved heatmap screenshot with no analysis (use heatmaps-saved-create directly), or is asking about session replay in general (use investigating-replay).Read full description
Audit every endpoint in a PostHog project for staleness, failed materialisations, and unused materialised versions. Use when the user asks "what endpoints can I clean up?", "are any of my endpoints broken?", "which materialised versions are still being called?", or wants a one-shot cleanup pass over the Endpoints product. Produces a prioritised report grouped by issue type, with recommended actions but does not modify anything without explicit confirmation.Read full description
Audit PostHog experiments and feature flags for configuration issues, staleness, and best-practice violations. Read when the user asks to audit, health-check, or review experiments or feature flags, check flag hygiene, or verify experiment setup.Read full description