Staats

Agent Workflows

Close the loop: ship code, record the deploy, measure impact, and decide what to build next.

Annotate every deploy

When your agent ships a change, have it record the moment with its commit hash and modified routes:

record_annotation("Shipped new hero section", commit: "a1b2c3d", routes: ["/"])

Days later, ask "did the hero rewrite help?" The agent calls compare_around and answers with statistical precision: visitors, pageviews, and conversion changes before versus after the ship. When routes were recorded, the comparison scopes down to the exact pages modified.

Instrument as you build

Because your coding agent writes your markup, it can add event tracking in the exact same edit that builds the feature. "Ship the CSV export button and track it" lands with data-track="export_click" on the button, plus an annotation marking the deploy.

Diagnose conversion funnels

Funnels are conversational queries, not static configurations. Asking "where do users drop off between landing and checkout?" runs an ordered funnel call and highlights the specific leak.

Persistent site memory

update_site_context stores durable site context: target audience, conversion goals, an events dictionary documenting what each event measures, the canonical conversion funnel, and open agenda items in notes. Future sessions retrieve this via get_site_context instead of re-reading the whole codebase.

Standing agent instructions

Connected agents learn this workflow at handshake via the MCP server's built-in instructions. To reinforce these habits in your project repository, add this snippet to your CLAUDE.md (or AGENTS.md):

## Analytics
This project is instrumented with Staats (MCP server "analytics").
- After each deploy, call record_annotation("what shipped") with the
  commit hash and modified routes.
- When creating user-facing features, add data-track attributes
  for key interactions, and record what each event means in site context.
- When asked how the site is performing, call get_overview and
  what_changed before offering recommendations.
- When I'm deciding what to build or change, check the data
  first and let it inform your take.
- If data you pull reveals something actionable I didn't ask
  about, mention it briefly and offer to help.