Query S3 and Athena from the AWS CLI with Claude Code

Watch Claude Code use the AWS CLI to load S3 data and query it with Athena, no console needed.

Who it's for: Data engineers, analysts and BI analysts whose data lives in S3 and gets queried with Athena.

The problem: Analyzing S3 data means finding the files, setting up an Athena external table and refining the query, all while navigating the AWS console.

With the AWS CLI, IAM credentials and jq set up and noted in CLAUDE.md, one plain English prompt has Claude Code upload IMF climate data to S3, set up Athena, write the queries and save the results in about five minutes.

Takeaways:

  • At minimum, give the CLI user S3 read and Athena query access.
  • Note the AWS CLI in CLAUDE.md for every session.
  • Your main job becomes QC of the results.
  • To pivot data in Athena, use cross join unnest.

Resources