Skip to main content
I abused PostHog's setup wizard to get free Claude access

I abused PostHog's setup wizard to get free Claude access

· 12 min read
Software engineer and technical writer

PostHog is a platform for product analytics and more. They're known for pushing boundaries (just look at their website) and being a leader in UX patterns, especially at the frontier of how to work with agents. I use the free tier for some side projects, but recently did a from-scratch set up while working on a comparison guide.

They have a newish "wizard" to set up their product for you. I used this for the first time and figured out how to abuse it to become a full on LLM provider for Pi, a coding agent harness similar to Claude Code. For a while, I got the thrill of enjoying apparently unlimited Anthropic tokens, but instead of seeing how far I could push that I reported it to PostHog and got a free T-shirt instead.

Pi configured with PostHog as an LLM provider
Pi configured with PostHog as an LLM provider

This post is a bit about onboarding in the age of LLMs, as I have some thoughts about that, and a bit about how I got free tokens, because it was fun and interesting.

What is the PostHog wizard

The PostHog Wizard is a creative way to get started with PostHog. While other companies are writing LLMs.txt files and some other basics to help agent-first devs use their stuff, PostHog has really taken it to the next level.

If you're old, you'll remember Microsoft's setup wizards that actually had a wizard character and some next-next-next GUI dialogues to help you set up software. The PostHog wizard is nothing like that. It installs a full-blown Sonnet-powered agent on your machine, analyzes your codebase, figures out not just how to integrate PostHog into your codebase, but also what kind of metrics you'd probably be interested in tracking, what it makes sense to name them, and a whole bunch of other stuff. It's wild. And scary. And apparently it has unlimited access to Sonnet.

You just run npx -y @posthog/wizard@latest --region eu and take the leap of faith. They hijack your machine and project with an agent, it autonomously edits your codebase to integrate PostHog, and as a dev you just sit there wondering about things like "Universal Basic Income" while looking at the two hours of work done in eight minutes.

I didn't time it, but this looks like a hyped marketing claim before using it, but not at all afterwards.

PostHog wizard running in terminal

My experience using the PostHog wizard

I have a toy coffee ordering web app that I use to test out various developer tools in a realistic (if very small) setting. It's deliberately over-engineered to run on Kubernetes, have separate services, and a queueing system to make observability testing more realistic.

Toy coffee ordering web app used for testing

I simply changed to the frontend directory and ran the wizard command.

Maybe it's just my setup (pretty vanilla iTerm2) but it was quite janky. At first I thought it had frozen as I couldn't interact with any of the controls on what looked like a TUI, but I eventually figured that it uses scrolling to update and I could manually scroll down a million terminal screens to see it progressing.

PostHog wizard running and progressing in terminal

I was expecting it to look at my project, analyze the framework, and tell me how to integrate PostHog. Or maybe even do the basics of the integration and tell me how to set it up from there. I hadn't read about it, I was just following the default and suggested options while signing up for a new account and starting a new project.

I wasn't expecting it to run a full blown agent on my codebase, figure out what my project does and what kind of metrics would make sense to track, fully one-shot integrate all the needed PostHog library installs and code changes, and let me just visit a functional analytics dashboard page. But it did all of that. Probably in about the claimed 8 minutes. I forgot to time it.

PostHog setup complete confirmation

Here's what I saw after logging into the PostHog dashboard.

PostHog dashboard showing analytics after wizard setup

And this isn't just a hello-world page counting setup. The agent really understood my app and what makes sense to track. It set up events for things like 'Menu category filtered' and 'cart quantity updated' — actual functionality from my app that makes sense to track.

PostHog events showing meaningful tracking like menu category filtered and cart quantity updated

Wow.

Is this the future of onboarding?

I don't think so. It's good, but it doesn't make sense for every company to build this. I run Claude Code already so I'd have preferred a skill or even just a prompt to copy-paste and probably get the same effect, without having to relinquish control of my codebase to a third party, or send my data to yet another server.

But I'm still part of what is probably a quite small minority of developers who has been actively using command line agents in yolo --dangerously-skip-permissions mode since June 2025. So from PostHog's perspective, it makes sense to control the experience to make it consistent for everyone no matter what tooling they're using or what flows they're used to seeing.

My guess is that a lot of onboarding in future will look quite similar to this, but it will be guided by the company (docs, skills, prompts, MCP, whatever) but executed by the developer's own agent, not a slightly scary script that sends everything back to the product company's servers.

Which takes me to...

Figuring out how PostHog built this and what else I can use it for

Analyzing a codebase and integrating a well-documented SDK is table stakes for agents these days, but there are still relatively few that can one-shot it like PostHog's wizard did, and do it so cleanly.

I asked my Claude Code how it works. It checked the source folder and told me there is no wizard or third-party AI at all — it had cleaned up after itself well.

Claude Code reporting it can't find any wizard or third-party AI in the project

Hmm, let's do some more investigation. Claude initially told me it was just a skill and was using my existing agent setup to do the work, but after some pushing, it looked deep enough to figure out how it actually works. PostHog sets up their own LLM gateway and pushes everything through that.

Claude Code discovering PostHog uses their own LLM gateway

Does that mean what I think it means? I asked if that just means we have free LLM tokens and Claude confirmed that we probably could, but gave me a lecture in ethics at the same time.

Confirmation that PostHog is using Claude Sonnet under the hood

Interesting. Sonnet — exactly the model I use most of the time anyway, and the one that Claude Code is running to figure this out. Opus would be nice, but I guess even PostHog has to work within a budget.

I did a few more tests.

Further tests confirming PostHog's Anthropic-compatible API gateway

At this point, I'm not actually saving many tokens here because I'm using my Claude tokens to talk to the PostHog gateway, to use their tokens. Only Anthropic is winning out of this. But if it's an Anthropic-compatible API, that means it should be quite straightforward to set it up directly with an actual coding agent.

After a few more weirdly brain-hurting meta prompts of asking Claude Code to set up Pi with a custom PostHog endpoint and we're running a full coding agent subsidized by PostHog!

I was still thinking of Claude's ethical nudge — that maybe this wasn't a cool thing to do, but my weekly limits were looking very tight. I'm not yet an addict, but it was too tempting to not try this out a little bit more. Maybe they set a token limit per user and it's no big deal if I use up whatever they've allocated me in this creative way?

Pi coding agent configured to use PostHog's LLM gateway endpoint

Using PostHog to set up Mixpanel 😈

The article I was meant to be working on was to compare the onboarding experience of PostHog and Mixpanel, so I continued with that now using PostHog's tokens to set up both services.

That post covers things in a lot more detail, but basically Mixpanel also offers an agent setup, but more along the lines I would expect. They give you a prompt, you copy it into your agent, and that does the setup for you.

Mixpanel's agent setup approach: a prompt you paste into your own agent

Not as fun, and a lot less ambitious (no analyzing the codebase to set up meaningful events, it just gets stuff connected), but a lot closer to how I expect things to work in future.

Does this thing have limits?

I kept expecting to hit a limit but the tokens kept flowing. Eventually I got Error: 401 {"detail":"Authentication required"} and figured the party was over, but another quick journey back to my own Claude tokens and we figured out that the PostHog token simply expires each hour with an easy way to refresh, so I kept going.

I know PostHog aims to be the 'all in one' platform for building products, but I'm probably the first person to use them as a provider for my agent?

Continuing to use PostHog's LLM gateway well beyond the initial setup

We kept going for several hours, testing out all the basic features of both PostHog and Mixpanel, using the browser to simulate traffic, watching session replays. I usually use Sonnet through a monthly subscription so I'm not sure how much this cost. I guess I should stop and responsibly disclose it to them now.

Maybe I'll get some swag to make up for my loss of unlimited tokens.

PostHog responsible disclosure page mentioning swag as a reward Meme: free swag from PostHog vs unlimited Anthropic tokens

PostHog's response

I sent a draft of this article to the PostHog team and asked if they had any concerns about me publishing it, and whether they wanted any time to tighten their limits or monitoring before it went live. I got a response immediately on LinkedIn within hours thanking me for the submission, and a bit later confirming that they'd fixed it.

we've implemented a limit to stop this happening!

A bit later I got the official response, which was in-character enthusiastic about it all.

PostHog's response clarifying how their LLM gateway works

The official response makes it sound like those limits were always in place, but I suspect things are more locked down now than when I was playing around. They also sent me a $50 swag voucher which I used to buy a t-shirt and a mug from their merch store.

The wizard being fully open source was the part I didn't realize before. Looks useful if you want to copy the pattern for your own product.

I haven't tried abusing the gateway again. The line between "lots of wiggle room" and "block users who misuse it" is a bit vague for me, and I don't particularly like sending PostHog all my tokens for monitoring anyway, but I am missing being able to use Pi, which has some nice quality-of-life features over Claude Code, without paying per token.