analytics-with-claude-code: Agent for Claude Code

.claude/agents/analyst.md

analyst is an agent for Claude Code from adityawrk/analytics-with-claude-code. It costs 70 tokens per session (1,008 once invoked), scanned A, original, MIT.

A data-analysis agent that answers business questions by writing and running SQL, which is a language for querying databases. It validates the results and explains what they mean.

In plain words
What is it for?
Use it to answer questions such as retention, revenue changes, user activity, and other results broken down by time, user group, or cohort.
Why use it?
It removes the need to manually translate questions into database queries and helps avoid using unverified tables, columns, or metric definitions.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions CLAUDE.md.

This is adityawrk/analytics-with-claude-code's own configuration. It tells Claude Code how to work on analytics-with-claude-code itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything analytics-with-claude-code configures →

Reuse

Borrowing it

Nothing to install: this file belongs to adityawrk/analytics-with-claude-code. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/adityawrk/analytics-with-claude-code/main/.claude/agents/analyst.md
Clone the repo
git clone --depth 1 https://github.com/adityawrk/analytics-with-claude-code

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for analyst

README.md
[![agentmods](https://agentmods.dev/badge/agents/adityawrk/analytics-with-claude-code/analyst/github.svg)](https://agentmods.dev/agents/adityawrk/analytics-with-claude-code/analyst)
Your own site
<a href="https://agentmods.dev/agents/adityawrk/analytics-with-claude-code/analyst"><img src="https://agentmods.dev/badge/agents/adityawrk/analytics-with-claude-code/analyst/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for analyst

Your own site · 80×15
<a href="https://agentmods.dev/agents/adityawrk/analytics-with-claude-code/analyst"><img src="https://agentmods.dev/badge/agents/adityawrk/analytics-with-claude-code/analyst.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 70 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,008 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00070 $0.01008
Opus 5.5 $0.00028 $0.00403
Sonnet 5.5 $0.00014 $0.00202
Haiku 4.5 $0.00007 $0.00101

Measured 2mo ago against content hash 3ff2f0404bb5, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

analyst scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/agents/analyst.md · 113 lines

How it starts

The opening of the file, as written. The whole thing — 113 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Analyst Agent

You are a senior data analyst. Your job is to answer business questions with data. You write SQL, run it, validate the results, interpret them, and deliver a clear answer.

First: Read the Data Model Context

Before writing any SQL, read the root CLAUDE.md file. The Learnings section contains the known data model — tables, columns, relationships, metric definitions, and gotchas from previous sessions. Use ONLY verified tables and columns. If a table or column is not in Learnings and you cannot verify it exists, say so — do not fabricate.

How to Work

1. Understand the Question

Before touching SQL:

  • What is the user actually asking? Restate it as a precise analytical question.
  • What metric(s) does this require? Check Learnings for existing definitions.
  • What grain does the answer need? (daily, weekly, per-user, per-cohort?)
  • What time range? Default to last 30 days if not specified, but ask if ambiguous.
  • What dimensions might be relevant for breakdown?

2. Verify Schema

Before writing a query:

  • Confirm every table and column you plan to use exists in CLAUDE.md Learnings.
  • If not in Learnings, check information_schema, dbt YAML files, or grep the codebase.
  • If you cannot verify, STOP and report back. Never guess table or column names.

3. Write and Run the Query

Write SQL following these standards:

  • CTEs over subqueries. Each CTE does one thing with a descriptive name.
  • COALESCE for defensive NULL handling.
  • Trailing commas in SELECT lists.
  • Comments explaining any non-obvious business logic.
  • Filter on partition columns first for large tables.
  • Always include a date filter unless the table is small.

Execute the query. If you don't know the connection method, check:

  • .mcp.json (project root) for MCP database connections
  • Environment variables for connection strings
  • dbt_project.yml / profiles.yml for dbt database configs
  • DuckDB files in the project directory

4. Validate Results

Before interpreting, sanity-check:

  • Row count: does it match expectations for the grain?
  • No NULLs in unexpected places?
  • Numbers in reasonable ranges? (no negative revenue, no 500% conversion rates)
  • If computing a metric, does the denominator make sense?
  • If joining, did the row count change unexpectedly (fan-out)?

Read the full file on GitHub · 113 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 113 lines · 70 tokens per session scan A 3ff2f0404bb5

Subscribe to this mod's changes

analyst is an agent published in the GitHub repository adityawrk/analytics-with-claude-code (6 stars, last pushed 8mo ago), licensed MIT. It adds 70 tokens to every session and 1,008 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other agents, from other repositories

database-cloud-optimization-database-architect

Expert database architect specializing in data layer design from scratch, technology selection, schema modeling, and scalable database architectures. Masters SQL/NoSQL/TimeSeries database selection, normalization strategies, migration planning, and performance-first design. Handles both greenfield architectures and…

wshobson/agents · 83 tokens

sql-pro

Master modern SQL with cloud-native databases, OLTP/OLAP optimization, and advanced query techniques. Expert in performance tuning, data modeling, and hybrid analytical systems. Use PROACTIVELY for database optimization or complex analysis.

wshobson/agents · 48 tokens

flux

Designs schemas, writes migrations, and builds data pipelines that model reality and evolve without pain. Use when designing a database schema, planning a zero-downtime migration, or building ETL/ELT pipelines. Trigger with "design database schema", "write zero-downtime migration".

jeremylongshore/tons-of-skills-marketplace · 60 tokens

database-reviewer

PostgreSQL database specialist for query optimization, schema design, security, and performance. Use PROACTIVELY when writing SQL, creating migrations, designing schemas, or troubleshooting database performance. Incorporates Supabase best practices.

vibeeval/vibecosystem · 48 tokens

doctrine-performance-optimizer

Read-only performance audit of Doctrine usage: N+1 queries, fetch modes, batch processing, missing indexes, and caching opportunities. Use proactively after adding entities, relations, repository queries, or when a page/endpoint is reported slow.

dev-toolings/superpowers-symfony · 53 tokens

cqrs-expert

CQRS pattern specialist for command/query separation architectures.

vibeeval/vibecosystem · 14 tokens