
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:
- Run
tuist cache-run list --jsonto find cache runs on each branch. - Run
tuist cache-run show <id> --jsonfor both base and head cache runs. - Compare duration, status, and cache hit rates.
- 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:
| Metric | What to check |
|---|---|
duration | Flag if head is >10% slower |
status | Flag if base succeeded but head failed |
cacheable_targets | Note if target count changed |
local_cache_target_hits | Compare local hit counts |
remote_cache_target_hits | Compare remote hit counts |
is_ci | Note 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?
