How to use PostHog with Claude Code
You want PostHog inside Claude Code so it can investigate a drop in conversion, review an experiment before rollout, triage production errors, and maintain product analytics dashboards — without you copy-pasting between tabs. Here is the whole setup, once.
Create your PostHog gateway
The gateway is the thing Claude Code connects to, and it is where you decide which PostHog tools an agent may use. You create it once and every client reuses it.
-
Create an Arcade account
Sign up and open the dashboard. The free tier is enough to follow this through.
-
Create an MCP Gateway and select your PostHog tools
In the dashboard, create a gateway and pick the PostHog tools you want to expose. The gateway is what your client connects to, and it is where tool access is decided.
-
Copy your gateway URL
Every client below needs it.
https://api.arcade.dev/mcp/<YOUR-GATEWAY-SLUG>
Connect the gateway to Claude Code
-
Add the gateway as a remote HTTP MCP server
claude mcp add arcade --transport http "<YOUR_ARCADE_GATEWAY_URL>"
-
Verify it was added
claude mcp get arcade claude mcp list
-
Try it out
Open Claude Code in your project and ask it to use one of your PostHog tools.
Full Claude Code guide in the docs steps verified 2026-08-13
Get started with these PostHog prompts
Claude Code can now act on your PostHog account. Click a prompt to copy it.
Use scoped credentials and tool permissions to control which PostHog actions an agent can take. Pair it with Contextual Access policies so an agent can analyze product data without being allowed to change a feature flag, delete an insight, or archive an experiment.