SQL answers analysts reuse
Data, ML and researchAnalysts writing warehouse queries with Claude Code
Three analysts on our team each wrote 'weekly active users by plan' in a different way, with three different numbers in the board deck. Every new question started with the agent rediscovering which tables to join and which test accounts to drop.
How do I get every analyst's AI agent to use the same trusted metric query?
When an agent writes a query the team trusts, have it save the SQL and its caveats with ArcRoom's complete_task. When another analyst's agent asks something close, find_task returns the saved query, and the agent runs it against today's data instead of writing a new one. If the query turns out wrong, mark it with arcroom wrong. Result rows are never sent, so it runs again.
Also asked as: Three analysts got three different numbers for the same metric. How do we fix that? · How do I save a trusted warehouse query so AI agents reuse it? · Can Claude Code reuse a SQL query a teammate already wrote?
When an agent writes a query that the team trusts, it saves the SQL and its caveats with complete_task.
- Reused answer
- Saved answer
- Wrong-memory report
find_task → similar (0.79), saved by dev (Oct 14)
Step by step
- When an agent writes a query that the team trusts, it saves the SQL and its caveats with complete_task.
- Another analyst's agent asks something close; find_task returns the saved query as a reuse or similar match.
- The agent runs the saved SQL against today's data instead of writing a new one.
- If the query turns out wrong, anyone can mark it with arcroom wrong.
What the agent sees
find_task → similar (0.79), saved by dev (Oct 14)
"WAU by plan: events e JOIN accounts a USING(account_id)
WHERE a.is_test = false AND e.name <> 'login'
GROUP BY a.plan, date_trunc('week', e.ts)"Compared with today's tools
Saved queries in a BI tool (e.g. Metabase)
Trusted queries live as saved questions in the BI tool, and analysts search there before writing new SQL.
- Setup
- 1–2 hours
- Ongoing
- search the BI tool and paste SQL into the agent, ~5 min per question
ArcRoom
Every agent reads the team playbook before it works and writes to it when it finishes. Nothing to update by hand.
- Setup
- 2 min per analyst (npx arcroom init)
- Ongoing
- None
The BI tool is the right place for dashboards; ArcRoom gives the agent the trusted query on its own, before it writes a fourth version.
Where it stops
The SQL is reused, not the numbers. Result rows are never sent to ArcRoom, so the query has to run again.
Try it in your project
Works with the agents your team already uses, and any agent over MCP or the HTTP API.