Claude Code
Updated 2026-11-02
Let Claude Code do the setup
Paste this into Claude Code from your site's repo:
Read https://headstream.app/agent.md and set up Headstream on this site.
Claude Code reads the guide at headstream.app/agent.md, then:
- Starts a connection and shows you a link and a code to approve.
- Saves an API key to
~/.config/headstream/key. - Creates a project from your production domain.
- Puts the snippet in your shared
<head>. - Confirms events are arriving before it calls the job done.
- Finds your main conversion, confirms it with you, and creates a goal.
- Looks for a "how did you hear about us?" question.
- Gives you a link to connect Stripe, which is in beta.
Add the MCP server
Create a key under Organization, in the API and MCP card, or use the one the agent saved. Then run:
claude mcp add --transport http headstream https://headstream.app/api/mcp \
--header "Authorization: Bearer hsk_YOUR_KEY"
Keys reach every project in your organization, so treat them as secrets and keep them out of your repo.
What to ask
Once connected, Claude Code can read your reports and act on them:
- "What's the top fix for this project?"
- "Which landing pages brought in the most revenue last quarter?"
- "Why did visitors drop this week? Check the change log."
- "Build a dashboard with traffic, a signup funnel and revenue by channel."
The fix loop is the most useful part. get_top_fix returns a ranked change with evidence. Claude Code makes the change, calls mark_fix_applied, and later uses check_fix to see if it worked.
The full list of tools is in the MCP docs.