AugmentClaude

Datachain Jobs Analytics

Track Studio job metrics including compute hours, spend, failures, and cluster usage.

Installation

  1. Make sure Claude is on your device and in your terminal.

    Skills load from ~/.claude/skills/ when Claude Code starts up β€” so you need it on your machine first. If you don't have it yet, install it once with the command below, then run claude in any terminal to verify.

    One-time setup
    npm i -g @anthropic-ai/claude-code

    Already have it? Skip ahead.

  2. Paste into Claude Code or into your terminal.

    This copies the whole skill folder into ~/.claude/skills/datachain-jobs-datachain-ai/ β€” the SKILL.md plus any scripts, reference docs, or templates the skill ships with. Safe default: works for every skill.

    Faster alternative (instruction-only skills)

    Skips the clone and grabs only the SKILL.md file. Don't use this if the skill ships Python scripts, reference markdowns, or asset templates β€” they won't be downloaded and the skill will fail when it tries to load them.

    Quick install (SKILL.md only)
    Sign up to copy
  3. Restart Claude Code.

    Quit and reopen Claude Code (or any other agent that loads from ~/.claude/skills/). New skills are picked up on startup.

  4. Just ask Claude.

    Skills auto-activate when your request matches the skill's description β€” no slash command needed. Trigger phrases live in the skill's own frontmatter; you can read them in the β€œWhat this skill does” section above.

Prefer to read the source first? Open on GitHub.

When Claude uses it

Use when asked about Studio job analytics β€” compute hours, user spend, failure rates, cost estimation, cluster usage. Generates and maintains dc-knowledge/jobs/index.md.

What this skill does

You are now loaded with the datachain-jobs skill. Maintain a jobs analytics file at dc-knowledge/jobs/index.md. Follow the 3-step flow below exactly.


Step 1 β€” Check Staleness

python3 {skill_dir}/scripts/jobs.py --plan
  • If "studio_available": false β†’ report the error message and stop.
  • If "up_to_date": true β†’ skip to Step 3.
  • If "up_to_date": false β†’ continue to Step 2.

Step 2 β€” Fetch & Write

python3 {skill_dir}/scripts/jobs.py --fetch [--days N] [--limit N] [--enrich]
  • Use --days N from the user's request if stated (e.g. "last 7 days" β†’ --days 7). Default: --days 30.
  • Add --enrich only when the question requires duration, workers, or cluster data AND enriched: false in an existing index β€” tell the user it makes one API call per terminal job.
  • If the script fails β†’ report the error and stop.

Write dc-knowledge/jobs/index.md using EXACTLY this format:

---
generated: <generated from script output>
days_covered: <days_covered>
total_jobs: <filtered_count>
failed_count: <failed_count>
complete_count: <complete_count>
running_count: <running_count>
other_count: <other_count>
enriched: <true|false>
duration_note: "Wall-clock duration (submit→finish). Null when enriched=false or job still running."
truncated: <true|false>
---

## Clusters

| Name | Cloud | Max Workers | Default |
|------|-------|-------------|---------|
| <name> | <cloud_provider> | <max_workers> | <yes if is_default else no> |

## Jobs

| Date | ID | Name | Status | User | Workers | Duration | Cluster | Python |
|------|----|------|--------|------|---------|----------|---------|--------|
| <created_display> | <id> | <name> | <status> | <created_by> | <workers> | <duration_str or β€”> | <cluster_name or β€”> | <python_version or β€”> |

Section rules:

  • Omit ## Clusters if the clusters array is empty.
  • Duration cell: duration_str value (e.g. "9000s") when known, β€” when null.
  • Workers: always a number (workers field, defaults to 1).
  • Cluster, Python: use β€” when null.
  • Date column: created_display (YYYY-MM-DD HH:MM UTC).
  • Rows: newest-first (already sorted by script).
  • If truncated: true, add after the table: _(Results truncated at <limit> jobs. Use --limit N for more.)_

Step 3 β€” Answer

Read dc-knowledge/jobs/index.md and answer the user's question.

Duration arithmetic

Duration cells contain plain seconds strings like "9000s". Parse the integer before s, sum, then convert:

  • Example: filter rows for user "alice" in the last 7 days, sum all Duration values β†’ total seconds β†’ divide by 3600 for hours.
  • If all Duration cells are β€” (enriched: false) β†’ say: "Duration data requires enrichment. Re-fetch with: python3 {skill_dir}/scripts/jobs.py --fetch --enrich" and offer to do so.

Failure rate

  • Overall: failed_count / total_jobs * 100 from frontmatter.
  • Per user or per day: count rows matching Status = failed in the table.

Price estimation

When the user asks for cost:

  1. If hourly rate unknown β†’ ask: "What is the instance hourly rate in $/hr? (e.g. 3.20 for $3.20/hr)"
  2. If Workers column is all β€” β†’ ask: "How many workers per job?" or compute single-worker cost and note it.
  3. Compute per job: duration_seconds / 3600 Γ— rate Γ— workers. Group by user/day/cluster as requested.
  4. Present as a table: User | Compute-hours | Est. cost (@$X/hr Γ— N workers)

Per-cluster / per-user analytics

Filter the Jobs table by the Cluster or User column. Aggregate (Ns) Duration values for totals.

Related skills