querying-aws-athena

querying-aws-athena is a skill for Claude Code from aws/agent-toolkit-for-aws. It costs 192 tokens per session (6,388 once invoked), scanned A, original, Apache-2.0.

A workflow for querying Amazon Athena's query history, stored as an Apache Iceberg table in Amazon S3 Tables. Athena is AWS's service for running SQL over data, while the history records details such as query text, timing, errors, scanned data, and accessed tables.

In plain words
What is it for?
Query completed Athena executions, examine data scanned and timing, find errors and accessed tables, and analyze query activity by user, workgroup, or period.
Why use it?
It makes account query history easier to analyze with SQL than fetching each query through separate API calls. The stored records can help investigate usage, cost, failures, and performance.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Good fit Query completed Athena executions, examine data scanned and timing, find errors and accessed tables, and analyze query activity by user, workgroup, or period.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/aws/agent-toolkit-for-aws/querying-aws-athena
About the project

Agent Toolkit for AWS is a collection of AWS-supported MCP servers, skills, plugins, commands, and hooks that help AI coding agents build, deploy, and manage applications on AWS. It is used by developers working with AWS services through agents such as Claude Code, Codex, Cursor, and Kiro. The catalogue entries are the toolkit's own agent extensions for AWS development and operations.

aws/agent-toolkit-for-aws · 3,609 stars · on GitHub

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.

Any agent
npx skills add aws/agent-toolkit-for-aws --skill querying-aws-athena
Clone the repo
git clone --depth 1 https://github.com/aws/agent-toolkit-for-aws

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 querying-aws-athena

README.md
[![agentmods](https://agentmods.dev/badge/skills/aws/agent-toolkit-for-aws/querying-aws-athena/github.svg)](https://agentmods.dev/skills/aws/agent-toolkit-for-aws/querying-aws-athena)
Your own site
<a href="https://agentmods.dev/skills/aws/agent-toolkit-for-aws/querying-aws-athena"><img src="https://agentmods.dev/badge/skills/aws/agent-toolkit-for-aws/querying-aws-athena/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 querying-aws-athena

Your own site · 80×15
<a href="https://agentmods.dev/skills/aws/agent-toolkit-for-aws/querying-aws-athena"><img src="https://agentmods.dev/badge/skills/aws/agent-toolkit-for-aws/querying-aws-athena.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 192 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,388 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. Third-party audits
  • Socket pass 6 Nov 2026
  • Snyk warn 6 Nov 2026
How audits are shown
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.00192 $0.06388
Opus 5.5 $0.00077 $0.02555
Sonnet 5.5 $0.00038 $0.01278
Haiku 4.5 $0.00019 $0.00639

Measured 23d ago against content hash b0216adad07a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

querying-aws-athena 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 23d 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.

skills/specialized-skills/system-table-skills/querying-aws-athena/SKILL.md · 413 lines

How it starts

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

Query Amazon Athena System Tables

Overview

Works best with the AWS MCP server for sandboxed execution and audit logging. All commands below use the AWS CLI and work in any environment with configured AWS credentials. Use IAM roles or temporary credentials; avoid long-lived access keys.

Amazon Athena system tables are Apache Iceberg tables that Athena automatically creates and populates with account usage data. The query_executions system table records one row per completed query with the metadata from GetQueryExecution plus additional fields that GetQueryExecution does not return. The tables are read-only and stored as fully managed Amazon S3 Tables in the service-managed aws-athena S3 table bucket in your account and Region, and are queryable with Athena SQL (the focus of this skill) or any other Iceberg-compatible engine, such as Amazon Redshift.

The system table is preferred over the raw Athena APIs (ListQueryExecutions, GetQueryExecution) because:

  • ListQueryExecutions returns only query IDs and paginates; GetQueryExecution must then be called once per ID. Reconstructing "how much did each user scan last month" means thousands of sequential API calls. The system table answers it with one GROUP BY.
  • The APIs offer no SQL, no aggregation, and no joins, and cover only a rolling 45-day window. The system table retains data for as long as you configure through S3 Tables record expiration and supports arbitrary SQL, including window functions and cross-table joins.
  • principal_arn (the IAM user or role that ran the query) is not included in the GetQueryExecution response — obtaining it otherwise requires a CloudTrail join. It is a first-class column here.
  • tables_accessed (the tables and views referenced by each query) is likewise not included in the GetQueryExecution response, enabling lineage and "who queried what table" analysis directly.

Decision Tree

User intent Use this skill? Column / approach Alternative
How many queries ran, and cost/data-scanned trends Yes data_scanned_size, submission_date_time —
Who ran a specific query, or who scans the most Yes principal_arn —
Which tables are queried most / by whom Yes tables_accessed (UNNEST) —
Slowest queries / time breakdown / regressions Yes timing *_duration columns —
Failed-query analysis, error patterns Yes state_enum, error_* columns —
Query history older than 45 days Yes system table (API window is 45 days) —
Status of a single in-flight/running query No — GetQueryExecution (system table has completed queries only)
Look up one known query by ID, ad hoc Maybe one-row WHERE query_execution_id = GetQueryExecution (no setup)
Enable / disable the system table Yes see Enable section —
Query the data inside S3 tables No — querying-data-lake

Read the full file on GitHub · 413 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 23d ago First seen · 413 lines · 192 tokens per session scan A b0216adad07a

Subscribe to this mod's changes

querying-aws-athena is a skill published in the GitHub repository aws/agent-toolkit-for-aws (3,609 stars, last pushed today), licensed Apache-2.0. It adds 192 tokens to every session and 6,388 once invoked, about $0.0008 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-11-07.

Related

querying-aws-athena compared with skills from other repositories

querying-aws-athena next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
querying-aws-athenaaws/agent-toolkit-for-awsSkill3.6ktodayApache-2.0A192Claude Code
create-prprisma/ormSkill48ktodayApache-2.0A47Claude Code, Codex
schema-explorationlangchain-ai/deepagentsSkill32ktodayMITA57Claude Code, Codex
atlas-mssqlariga/atlasSkill8.9k4d agoApache-2.0A163Claude Code
ha-data-storesshiwenwen/hope-agentSkill1.9kyesterdayMITA115Claude Code, Codex
pentesting-mysqlxalgorix/xalgorixSkill1.5kyesterdayApache-2.0A65Claude Code, Codex
nornicdb-cypher-queriesorneryd/NornicDBSkill938todayMITA79Claude Code, Codex