What Is AgentFirstStack? The Beginner's Guide to Agent-Native Analytics, Session Replay, and Email
CodexFuse Team · 2026-11-05T01:05:03.644Z · 12 min read min read
What is AgentFirstStack? It is free, open-source infrastructure that an AI agent can set up by itself — cookieless web analytics, a tag manager with server-side ad conversion tracking, email inboxes the agent creates for itself, and session replay the agent reads as text instead of watching as video. The project's own homepage says it best: "Like Google Analytics, Google Tag Manager and Hotjar, plus email inboxes your agent can use. Paste one prompt and your coding agent creates the account, adds everything to your site and checks it works. No signup form, no dashboard. Free and open source." (agentfirststack.com, fetched 2026-11-05).
The core idea is the setup model, not any single feature. "One request gets a key that works on every service. No email, password or verification," per the homepage — so a coding agent can go from nothing to a fully instrumented site without a human filling in a form. If your agent runs long sessions on an always-on box, our VPS hosting guide covers the natural home for that workload. This agentfirststack explained guide covers the four services, the prompt-driven install arc, the mail and replay systems, the fair-use limits, and the honest caveats — including one license correction you should know before repeating the launch claims.
What Is AgentFirstStack, Exactly?
AgentFirstStack is infrastructure built for the llms.txt era: "Everything is a REST call and an MCP tool," per the root https://agentfirststack.com/llms.txt (fetched 2026-11-05). The same key works on every service — the site's manual says to send it as an Authorization Bearer header — over REST and through one MCP server. The site describes itself as "Free, open-source analytics, tag management with server-side conversion tracking, email inboxes and session replay that an AI agent sets up by itself over REST and MCP."
The unusual claim is who does the onboarding. Its own comparison pages say the agent should "set everything up with no person's email or login," and the home page advertises "A manual in plain text: /llms.txt lists every endpoint, tool and field" — per-service manuals for analytics, tags, mail, and replay hang off the root one. When the human eventually wants to see the data, they claim the account with a Google sign-in via a claim link — but the agent never needed a person to exist first.
AgentFirstStack Explained: The Four Services on One Key
The "Four services, one key" section of the homepage lists analytics instead of Google Analytics, tags instead of Google Tag Manager, mail inboxes, and session replay as readable transcripts instead of video. The table below is built only from what the site's own pages say each one does.
| Service | What it replaces | The one-line job (per agentfirststack.com) |
|---|---|---|
| Analytics | Google Analytics | Cookieless-by-default web analytics the agent creates from nothing — key, site, snippet, verify check |
| Tags | Google Tag Manager | Server-side conversion tracking to GA4, Google Ads, Meta, and TikTok, "counted once" with one event id |
| AgentMail (for verification codes) | Agent-created inboxes; wait for an email and "get the verification code or link back, from authenticated senders only" | |
| Replay | Microsoft Clarity / Hotjar | "Read sessions instead of watching them" — transcripts an agent can search, with text masked in the browser before anything is sent |
How Does an Agent Install AgentFirstStack?
This is the part the project calls "Add analytics with Claude Code in one prompt," and it is the snippet this article is built around. The flow works for any coding agent — Claude Code, Cursor, or Codex — because the whole onboarding is prompts plus plain HTTP. In short, the agentfirststack install arc is five steps:
- Paste the setup prompt. The guides give copy-paste prompts like: "Add analytics to this project with AgentFirstStack. It's free, open-source analytics built for agents, and you can do all of it yourself: there is no signup form, and no email or verification is needed." For replay, the prompt asks you first: "Ask me first whether to record sessions on this site; it's a privacy decision."
- Read the manual. The agent fetches https://agentfirststack.com/llms.txt, then the per-service manual it links to (for example, https://analytics.agentfirststack.com/llms.txt for analytics).
- Get the key. One POST returns the account:
curl -X POST https://agentfirststack.com/v1/signup— the mail guide shows the response as an api_key plus account_id. The guides describe the alternative with an email, but the point is the agent never needs one. - Create the service and wire it in. For analytics: create a site, add the tracking snippet to the page layout, and deploy. For replay: create a replay site for the production domain — if the site already runs AgentFirstStack analytics, pass its analytics_site_id and there is nothing else to paste. For mail: create an inbox with a second POST.
- Verify and answer. The agent deploys, runs the project's verify check until events arrive, then answers traffic questions from the terminal over MCP. For replay, it writes the replay site id in an AGENTFIRSTSTACK.md file — never the key — and creates a claim link with POST https://agentfirststack.com/v1/claim-link so a person can see the dashboard later.
If the agent itself is new to you, our Claude Code beginner guide walks through the first session before you hand it a stack like this one.
What Is AgentFirstStack Analytics?
AgentFirstStack analytics is the Google Analytics replacement the agent creates itself, and the key property is the absence of accounts: the project contrasts its own model with Google's, where an agent "reads reports from GA4 properties you already have" — properties a person had to create first. The analytics manual the homepage points to "lists every endpoint, tool and field in plain text," so the agent can run the whole lifecycle — key, site, snippet, verify — without a dashboard.
The privacy posture is cookieless by default, and the hosted service carries fair-use limits the site states openly: "10 sites, 10 tag containers and 10 inboxes per account; 5 replay sites." The site's comparison pages say AgentFirstStack is narrower than a product platform like PostHog — "No feature flags, experiments or surveys" — and that is deliberate: it covers web analytics, ad conversion tracking, inboxes, and session replay, and tells you to use the big platform when you need flags and experiments.
How Do AgentFirstStack Tags Work?
AgentFirstStack Tags is the tag-manager half of the stack, positioned against Google Tag Manager setups an agent would otherwise need an existing account for: the project's GTM comparison notes that Stape's open-source GTM MCP server lets an agent edit a GTM account "you already have" — sign in with Google first — while "AgentFirstStack Tags is a tag manager an agent creates from nothing, with server-side delivery to Meta, Google Ads, TikTok and GA4 built in." The server-side part is the point: "Sent from the browser and the server with one event id, so each platform counts it once," which is the honest fix for the double-counting that plagues client-side-only tagging.
The setup prompt mirrors the analytics one — "Set up AgentFirstStack conversion tracking for this project. It's a free, open-source tag manager with server-side conversion APIs, built for agents. You can do the setup yourself: there is no signup form, and no email or verification is needed" — and the fair-use budget is the same account-wide pool: 10 tag containers per account.
What Is AgentFirstStack Mail?
AgentFirstStack Mail gives your agent email inboxes for one specific job: signing the agent up for services and reading back verification codes. The mail guide's own example creates an inbox like [email protected] with a second POST, then fetches the code with curl -s "$M/v1/inboxes/$INBOX/latest-code?from=github.com&timeout=60" -H "$H" — where M is the mail API host and H is the Authorization header carrying the key. The guide's own sample response shows "code": "482913", "link": "https://...", "link_kind": "verify", "auth_verdict": "pass".
The blocking behavior is what makes it agent-friendly: "latest-code blocks on the server until a message with a code or verification link arrives, or the timeout passes (up to 120 seconds), so the agent doesn't write a polling loop. It only accepts mail whose sender domain passed authentication, so a forged email can't feed the agent a code." Over MCP, the same steps are the create_inbox and get_latest_code tools. One hard rule for framing this feature: these inboxes are for your own agents handling your own signups — never for harvesting anyone else's mail.
The hosted limits for mail are stated plainly: 10 inboxes per account (5 until a person claims the project), shared-domain inboxes that "reply only to addresses that emailed them" at 20 sent recipients a day, and mail kept 14 days, "up to 100 messages per inbox."
AgentFirstStack vs AgentMail: What Is Different?
The project's own agentmail-alternative page opens with the exact claim: "AgentFirstStack Mail is a free, open-source (AGPL-3.0) alternative to AgentMail." Read that license part twice, because an early queue note for this article said "MIT" — the site's actual wording is AGPL-3.0 for the service, and MIT applies only to the browser scripts your pages load. Anyone repeating "MIT" for the product itself is quoting a stale note, not the source.
The page's comparison table, built only from what it publishes (AgentMail details "checked on its site on 4 November 2026"), lands like this:
| Row | AgentMail | AgentFirstStack Mail |
|---|---|---|
| Pricing | Free; Developer $20 a month; Startup $200 a month; Enterprise custom | Free hosted with fair-use limits; no paid tiers found |
| Inboxes | 3 on Free, 10 on Developer, 150 on Startup | 10 per account (5 until a person claims the project) |
| Mail MCP tools | 47 tools | 29 mail tools |
| Shared inboxes | Not comparable | Reply only to addresses that emailed them; 20 sent recipients a day per account |
| Retention | Not stated here | Shared-domain mail deleted after 14 days |
| Blocking code retrieval | Not stated here | latest-code blocks up to 120 seconds; forged mail rejected by sender-auth check |
The page is also honest about where it loses: "AgentMail has more mailbox features, higher paid sending volume and a SOC 2 report." AgentFirstStack's pitch is not feature parity — it is that the agent gets the inbox with one POST and never files a signup form.
What Is AgentFirstStack Session Replay?
AgentFirstStack Replay is session replay rewritten for the reader, not the watcher: "open-source session replay built for AI agents: the agent sets it up through an API, text and inputs are masked in the browser by default, and each session comes back as a readable transcript instead of a video." The recorder "captures changes to the page (with rrweb), not video" — a 2 KB loader decides whether a tab is recorded and loads the recorder, "about 29 KB gzipped, after the page's load event."
The masking model is the part to understand before you record anything. "All text is masked in the visitor's browser before anything is sent. Each character becomes *, so the layout survives and the content doesn't." Typed values are masked in every mode, and "Password, payment-card and one-time-code fields can never be unmasked." Query strings and fragments are stripped from every URL, and id-like path segments (emails, long numbers, tokens) become :id. The project's Clarity comparison states the contrast directly: Microsoft Clarity masks "numbers and email addresses" by default, while AgentFirstStack Replay masks "all text and inputs," strict from the start.
Reading the data is an MCP affair: search_sessions (by page, signal, error, device, country, or frustration), get_session_transcript, summarize_sessions, get_heatmap, list_errors, and get_funnel_dropoffs — and when a person wants to watch one, create_replay_link returns an expiring player URL. Summaries "group patterns across up to 1,000 sessions, such as top rage-click targets, JS errors, elements clicked that aren't clickable and exit pages, each with example session ids" — and the guide notes that "No model is involved" in the summarization. Limits: 5 replay sites per account (2 until a person claims the project), 200 recorded sessions per site a day (100 until claimed), recordings kept up to 14 days.
What Do the Free Fair-Use Limits Actually Cover?
There are no paid tiers to escape to — the site states the hosted service is free and publishes the fair-use ceilings, with a self-host escape hatch throughout: "Need different limits? Self-host it: every service is an open-source (AGPL-3.0) Cloudflare Worker." Collecting the numbers the guides publish in one place: 10 analytics sites, 10 tag containers, and 10 inboxes per account; 5 replay sites per account (2 until a person claims the project); 200 recorded sessions per replay site per day (100 until claimed); mail on shared addresses kept for 14 days, up to 100 messages per inbox; shared-domain inboxes reply only to addresses that emailed them, at 20 sent recipients a day per account.
The claiming model is what raises the ceilings: the guides say you write the replay site id in an AGENTFIRSTSTACK.md file (never the key) and create a claim link so a person signs in with Google and sees the dashboard — the agent keeps working the whole time. And the open-source side of the bargain is explicit on the homepage: "Open source under AGPL-3.0 (the scripts your pages load are MIT). Four commands deploy it to your own Cloudflare account."
Where Does AgentFirstStack Fit Next to Harneo and Arvre?
The Claude Code ecosystem keeps splitting into lanes, and AgentFirstStack is the infrastructure lane: telemetry and onboarding machinery the agent builds for the site, not for itself. Harneo is the capabilities lane — installable skill modules that teach the agent new tricks per repository. arvre is the navigation lane — finding and resuming the sessions the agent already accumulated, drawn as a tree with their forks.
They are never rivals. The natural division is: Harneo stocks what the agent can do, arvre organizes the work orders the agent already produced, and AgentFirstStack builds the product telemetry around the thing being built — the analytics, conversion tracking, inboxes, and replay of the site itself. Different jobs, one toolchain.
Sources
- agentfirststack.com — homepage ("Like Google Analytics, Google Tag Manager and Hotjar, plus email inboxes your agent can use..."; "One request gets a key that works on every service"; four-services-one-key; AGPL-3.0/MIT scripts wording; fair-use limits). Fetched 2026-11-05.
- agentfirststack.com/llms.txt — root manual ("Everything is a REST call and an MCP tool"; Authorization Bearer header; per-service manuals; GitHub source StartGlobal-AI/agentfirststack). Fetched 2026-11-05.
- agentfirststack.com/agentmail-alternative — AgentFirstStack Mail vs AgentMail (verbatim claim "a free, open-source (AGPL-3.0) alternative to AgentMail"; signup/inbox/latest-code routes with verbatim quotes; comparison table; "AgentMail details were checked on its site on 4 November 2026"). Fetched 2026-11-05.
- agentfirststack.com/guides/session-replay-for-ai-agents — session replay guide (rrweb, masking, password/OTP/password-card rules, MCP tool names, limits, Clarity comparison). Updated 2026-11-04, fetched 2026-11-05.
- agentfirststack.com/guides/add-analytics-with-claude-code — "Add analytics with Claude Code in one prompt" (setup arc; analytics_site_id linking; claim-link route). Updated 2026-11-04, fetched 2026-11-05.
- agentfirststack.com/microsoft-clarity-mcp — Microsoft Clarity MCP comparison (masking defaults; list-session-recordings 1-to-250 per call; Data Export 10 requests/project/day). Updated 2026-11-04, fetched 2026-11-05.
Frequently Asked Questions
Is AgentFirstStack really free?
Yes, the hosted service is free with published fair-use limits — 10 analytics sites, 10 tag containers, 10 inboxes, and 5 replay sites per account, with tighter numbers until a person claims the project. There are no paid tiers to upsell into: when you outgrow the hosted limits, the intended path is self-hosting the open-source (AGPL-3.0) services yourself on Cloudflare Workers.
What license is AgentFirstStack under?
The services are open source under AGPL-3.0; only the browser scripts your pages load are MIT. This matters because early notes about the project floated "MIT" — the site's actual wording is "Open source under AGPL-3.0 (the scripts your pages load are MIT)," and the AgentMail-alternative page says "a free, open-source (AGPL-3.0) alternative to AgentMail."
Does AgentFirstStack replace Google Analytics?
It replaces the account model, not the data model. Its own GA4 comparison says Google's MCP lets an agent "read reports from GA4 properties you already have" — properties a person created. AgentFirstStack is for the case where no person exists yet: the agent creates the analytics itself with one key. If you already live in GA4 with years of history, it is not asking you to move.
Can my agent read my visitors' emails?
AgentFirstStack Mail inboxes belong to your agent's own signups — it creates inboxes like [email protected] and blocks until a verification code arrives. For the replay side, the masking is aggressive by design: every character becomes an asterisk in the browser before anything is sent, typed values stay masked in every mode, and password, payment-card, and one-time-code fields can never be unmasked. The inboxes are for your own agents' verification flows, never for harvesting anyone else's mail.
How is AgentFirstStack session replay different from Microsoft Clarity?
Three differences per the project's own comparison: setup (Clarity needs a person to create a project and hand the agent a token; AgentFirstStack Replay is set up by the agent itself from nothing), masking (Clarity's default masks numbers and email addresses; AgentFirstStack masks all text and inputs by default), and the output (Clarity returns recordings to watch; AgentFirstStack returns sessions as text transcripts an agent can search with search_sessions and summarize with summarize_sessions).

