Skills

Compare Cache Runs

Compares two `tuist cache` runs to identify cache hit rate changes and root-cause...

Install

npx skills add tuist/tuist --skill compare-cache-runs -g -a claude-code -y
Repository
tuist/tuist5.9k
Category
Engineering
Updated
3d ago
License
See repository
Context cost
Lightabout 1,279 tokens
Runs scripts
No, instructions only

What it does

Compares two `tuist cache` runs to identify cache hit rate changes and root-cause analysis of cache invalidation. Can be invoked with cache run IDs, dashboard URLs, or branch names.

Compare Cache Runs

Quick Start

You'll typically receive two cache run identifiers. Follow these steps:

  1. Run tuist cache-run list --json to find cache runs on each branch.
  2. Run tuist cache-run show <id> --json for both base and head cache runs.
  3. Compare duration, status, and cache hit rates.
  4. Summarize cache changes with root cause analysis.

Step 1: Resolve Cache Runs

If base/head are cache run IDs or dashboard URLs

Fetch each directly:

tuist cache-run show <base-id> --json
tuist cache-run show <head-id> --json

If base/head are branch names

List recent cache runs on each branch:

tuist cache-run list --git-branch <base-branch> --json --page-size 1
tuist cache-run list --git-branch <head-branch> --json --page-size 1

Then fetch full details with tuist cache-run show <id> --json.

Defaults

  • If no base is provided, use the project's default branch (usually main).
  • If no head is provided, detect the current git branch.

Step 2: Compare Top-Level Metrics

After fetching both cache runs, compare:

MetricWhat to check
durationFlag if head is >10% slower
statusFlag if base succeeded but head failed
cacheable_targetsNote if target count changed
local_cache_target_hitsCompare local hit counts
remote_cache_target_hitsCompare remote hit counts
is_ciNote if one is CI and the other local

Compute cache hit rates:

  • Base: (local_hits + remote_hits) / cacheable_targets * 100
  • Head: same formula
  • Delta: head_rate - base_rate

Step 3: Analyze Cache Invalidation

If cache hit rate dropped, the key question is: which target(s) caused the invalidation cascade?

Read the whole SKILL.md on GitHub

More in Engineering