analytics

A read-only skill for checking data from PostgreSQL, local token records, Prometheus metrics, GitHub CI, and Kubernetes.

In plain words
What is it for?
Use it to query production database data, token costs, monitoring metrics, GitHub workflow results, and Kubernetes pod status.
Why use it?
It gathers operational information from several systems without changing them, so you can inspect application, cost, build, and cluster status in one workflow.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/stoa-platform/stoa/analytics
Any agent
npx skills add stoa-platform/stoa --skill analytics
Clone the repo
git clone --depth 1 https://github.com/stoa-platform/stoa

Made for: Claude Code, Codex.

Per session 29 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,179 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 findings. Scan, not verified.
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 $0.00029 $0.01179
Opus 5 $0.00015 $0.00589
Sonnet 5 $0.00006 $0.00236
Haiku 4.5 $0.00003 $0.00118

Measured 2d ago against content hash 2ac58c6f866a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

analytics scanned grade B with 2 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 2d 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

cat ~/.claude/stats-cache.json | python3 -m json.tool

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s https://pushgateway.gostoa.dev/metrics | grep gateway_arena
.claude/skills/analytics/SKILL.md · 157 lines

How it starts

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

Analytics Skill

Query STOA platform data across 5 sources. All queries are read-only.

Data Sources

# Source Access Auth
1 PostgreSQL (OVH Managed) psql direct Infisical /prod/database
2 Token Observatory Local files None (filesystem)
3 Pushgateway / Prometheus HTTP API None (IP-whitelisted)
4 GitHub CI gh CLI GitHub token (ambient)
5 Kubernetes kubectl kubeconfig (ambient)

Connection Patterns

PostgreSQL

eval $(infisical-token)
DB_URL=$(infisical secrets get DATABASE_URL --env=prod --path=/database --plain 2>/dev/null)
psql "$DB_URL" -c "<QUERY>"

Fallback (direct):

psql "<POSTGRES_CONNECTION_STRING>"

Token Observatory

# Today's stats
cat ~/.claude/stats-cache.json | python3 -m json.tool

# Historical (metrics.log)
grep "TOKEN-SPEND" ~/.claude/projects/-Users-torpedo-hlfh-repos-stoa/memory/metrics.log

Pushgateway

curl -s https://pushgateway.gostoa.dev/metrics | grep gateway_arena

GitHub CI

gh run list --limit 10 --json name,status,conclusion,startedAt,updatedAt
gh run view <run-id> --log-failed

Kubernetes

kubectl get pods -n stoa-system -o wide
kubectl top pods -n stoa-system

Pre-Built Queries

1. tenant-count — Total tenants

SELECT COUNT(*) AS total_tenants FROM tenants WHERE deleted_at IS NULL;

2. api-count — APIs by tenant

SELECT t.name AS tenant, COUNT(a.id) AS apis
FROM apis a JOIN tenants t ON a.tenant_id = t.id
WHERE a.deleted_at IS NULL
GROUP BY t.name ORDER BY apis DESC;

3. user-count — Active users

SELECT COUNT(*) AS total_users FROM users WHERE is_active = true;

4. gateway-instances — Registered gateways

SELECT name, gateway_type, status, base_url, last_health_check
FROM gateway_instances ORDER BY last_health_check DESC;

5. recent-deployments — Last 10 API deployments

SELECT a.name AS api, d.status, d.gateway_type, d.created_at
FROM deployments d JOIN apis a ON d.api_id = a.id
ORDER BY d.created_at DESC LIMIT 10;

Read the full file on GitHub · 157 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. 2d ago First seen · 157 lines · 29 tokens per session scan B 2ac58c6f866a

Subscribe to this mod's changes

analytics is a skill published in the GitHub repository stoa-platform/stoa (5 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 29 tokens to every session and 1,179 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 2 findings (reads agent configuration directories, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.