Skip to main content
skill CX Codex

checking-freshness — Claude Code skill: check if your data is stale

The skill checks when a table was last updated and tells you whether the data is safe to use.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add astronomer/agents --skill checking-freshness -a claude-code
Open on GitHub

What checking-freshness does

It looks for a timestamp column in the table: _loaded_at, updated_at, load_date, event_date and similar names. When column names aren't obvious, the agent queries INFORMATION_SCHEMA.COLUMNS. From there it computes the age of the newest row in hours and minutes, and groups row counts by day for the past week so you can see whether loading happens at all.

Age maps to a status: under 4 hours is fresh, 4 to 24 hours is stale, over a day is very stale, and no timestamp column means freshness can't be determined. The report is a plain block per table: name, last update time, age, status.

When data is stale, the skill turns to Airflow. It finds the source DAG with af dags list, checks whether the DAG is paused and whether the last run failed, then hands the investigation to the **debugging-dags** skill. The 4-hour line is the skill's own guidance rather than a rule for every pipeline — for a nightly batch load, a day-old table is normal, so read the status next to the schedule.

What it helps with

  • find out when a table was last updated
  • check whether data is too old for a report
  • locate the timestamp column in an unfamiliar schema
  • see daily row counts for the past week
  • trace why a table stopped refreshing

Example prompts for the agent

  • Is analytics.orders fresh enough for this morning's report?
  • marketing.events looks stale — find the source DAG and tell me what's wrong with it
  • Quick check: was sales.daily updated today?

How to install checking-freshness

1Skills CLI (Vercel)

npx skills add astronomer/agents --skill checking-freshness -a claude-code

2Manually: put the files in place

~/.claude/skills/checking-freshness/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/checking-freshness/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about checking-freshness

How do I install checking-freshness in Claude?

Run npx skills add astronomer/agents --skill checking-freshness -a claude-code. The skill lands in ~/.claude/skills/checking-freshness/SKILL.md.

What does checking-freshness do?

It finds the timestamp column, computes how old the latest row is and reports a status: fresh, stale or very stale. If data is stale, it checks the Airflow DAG behind the table.

What does the skill need to diagnose stale data?

Access to Airflow and the af CLI, which it uses to list DAGs and read run stats. Without that it stops at the freshness report.

Source text

SKILL.md · Apache-2.0
---
name: checking-freshness
description: Quick data freshness check. Use when the user asks if data is up to date, when a table was last updated, if data is stale, or needs to verify data currency before using it.
---

# Data Freshness Check

Quickly determine if data is fresh enough to use.

## Freshness Check Process

For each table to check:

### 1. Find the Timestamp Column

Look for columns that indicate when data was loaded or updated:
- `_loaded_at`, `_updated_at`, `_created_at` (common ETL patterns)
- `updated_at`, `created_at`, `modified_at` (application timestamps)
- `load_date`, `etl_timestamp`, `ingestion_time`
- `date`, `event_date`, `transaction_date` (business dates)

Query INFORMATION_SCHEMA.COLUMNS if you need to see column names.

### 2. Query Last Update Time

```sql
SELECT
    MAX(<timestamp_column>) as last_update,
    CURRENT_TIMESTAMP() as current_time,
    TIMESTAMPDIFF('hour', MAX(<timestamp_column>), CURRENT_TIMESTAMP()) as hours_ago,
    TIMESTAMPDIFF('minute', MAX(<timestamp_column>), CURRENT_TIMESTAMP()) as minutes_ago
FROM <table>
```

### 3. Check Row Counts by Time

For tables with regular updates, check recent activity:

```sql
SELECT
    DATE_TRUNC('day', <timestamp_column>) as day,
    COUNT(*) as row_count
FROM <table>
WHERE <timestamp_column> >= DATEADD('day', -7, CURRENT_DATE())
GROUP BY 1
ORDER BY 1 DESC
```

## Freshness Status

Report status using this scale:

| Status | Age | Meaning |
|--------|-----|---------|
| **Fresh** | < 4 hours | Data is current |
| **Stale** | 4-24 hours | May be outdated, check if expected |
| **Very Stale** | > 24 hours | Likely a problem unless batch job |
| **Unknown** | No timestamp | Can't determine freshness |

## If Data is Stale

Check Airflow for the source pipeline:

1. **Find the DAG**: Which DAG populates this table? Use `af dags list` and look for matching names.

2. **Check DAG status**:
   - Is the DAG paused? Use `af dags get <dag_id>`
   - Did the last run fail? Use `af dags stats`
   - Is a run currently in progress?

3. **Diagnose if needed**: If the DAG failed, use the **debugging-dags** skill to investigate.

### On Astro

If you're running on Astro, you can also:

- **DAG history in the Astro UI**: Check the deployment's DAG run history for a visual timeline of recent runs and their outcomes
- **Astro alerts for SLA monitoring**: Configure alerts to get notified when DAGs miss their expected completion windows, catching staleness before users report it

### On OSS Airflow

- **Airflow UI**: Use the DAGs view and task logs to verify last successful runs and SLA misses

## Output Format

Provide a clear, scannable report:

```
FRESHNESS REPORT
================

TABLE: database.schema.table_name
Last Update: 2024-01-15 14:32:00 UTC
Age: 2 hours 15 minutes
Status: Fresh

TABLE: database.schema.other_table
Last Update: 2024-01-14 03:00:00 UTC
Age: 37 hours
Status: Very Stale
Source DAG: daily_etl_pipeline (FAILED)
Action: Investigate with **debugging-dags** skill
```

## Quick Checks

If user just wants a yes/no answer:
- "Is X fresh?" -> Check and respond with status + one line
- "Can I use X for my 9am meeting?" -> Check and give clear yes/no with context

© astronomer · Apache-2.0 · astronomer/agents

Similar skills

All skills for Data and databases →

From the same set24

debugging-dags Walks an agent from a failed Airflow task to the actual root cause, then to a fix and a way to keep it from recurring. Handy when a DAG won't parse or a task dies without an obvious reason. CX Codex +1 1,200installs authoring-dags Guides the creation and validation of Apache Airflow DAGs across a six-phase workflow. Useful when writing new data pipelines or adding downstream tasks to existing DAGs. CX Codex +1 1,200installs setting-up-astro-project A skill that walks the agent through creating an Airflow project with the Astro CLI: folder layout, dependencies, connections and variables. CX Codex +1 1,100installs migrating-airflow-2-to-3 Walks Airflow 2.x DAG code through the move to 3.x: imports, operators, hooks, metadata access. Useful when the upgrade is due and hunting breaking changes by hand is tedious. CX Codex +1 1,100installs tracing-downstream-lineage The skill finds everything downstream of a table or DAG and shows what breaks when you change it. Run it before touching a schema. CX Codex +1 1,000installs profiling-tables Profiles specific database tables through targeted SQL queries. It inspects schema, gathers column statistics, and evaluates data quality. CX Codex +1 1,000installs tracing-upstream-lineage A skill that answers "where does this data come from" by finding the producing DAG, reading its source and walking the chain back to external systems. CX Codex +1 1,000installs cosmos-dbt-core Turns a dbt Core project into an Airflow DAG or TaskGroup with Astronomer Cosmos. Useful when your models need a schedule and retries. CX Codex +1 962installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor