Agent skill

Cache Trace Analyzer

by ben-manes in ben-manes/caffeine

Analyzes a cache trace file for the Caffeine simulator, characterizes its access pattern and recommends which eviction policies to compare.

Apache-2.0Auto-check: notesDevelopment

Install Cache Trace Analyzer

skills CLI
$ npx skills add ben-manes/caffeine --skill sim-analyze -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ben-manes/caffeine sim-analyze --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ben-manes/caffeine.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/sim-analyze .claude/skills/sim-analyze && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
sim-analyze
GitHub stars
18k
Token cost
~702 tokens
SKILL.md length
280 words
Files
1
Skills in repo
33
Repo updated
First seen
Licence
Apache-2.0

At a glance

Analyzes a cache trace file for the Caffeine simulator, characterizes its access pattern and recommends which eviction policies to compare.

  • Works in 6 steps: Identify the trace format and read the… → Compute trace statistics. Write a small… → Characterize the workload → …
  • Understanding what a new cache trace looks like
  • SKILL.md covers Input and Workflow
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Given a trace file, the skill first works out its format, whether keys only or weighted and whether timestamps exist, and counts accesses and distinct keys. It then measures working set size, windowed working sets, how skewed the frequency distribution is, how often recent keys repeat, bursts of sequential unique keys and shifts in what is popular over time.

From those measurements it labels the workload as frequency-biased, recency-biased, mixed, scan-heavy or shifting and maps each label to suitable policies such as TinyLFU, LRU, W-TinyLFU, S3-FIFO or a hill climber. It suggests cache sizes at 10%, 25% and 50% of distinct keys, checks the idea with a single-size run of ./gradlew simulator:run, and ends with a report and a suggested /sim-compare follow-up.

When your agent uses it

  • Understanding what a new cache trace looks like
  • Choosing which eviction policies to simulate
  • Deciding on cache sizes from the working set size
  • Detecting sequential scans in an access log

Example prompts

  • “Analyze this cache trace and tell me whether it is frequency or recency biased.”
  • “Which eviction policies should I simulate for this trace?”
  • “Check the trace for scans and recommend cache sizes.”

Requirements

  • The Caffeine repository with its Gradle simulator
  • Java for running ./gradlew
  • Pre-approved tools (allowed-tools): Read, Grep, Glob, Bash

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Identify the trace format and read the trace
  2. Compute trace statistics. Write a small analysis script or use
  3. Characterize the workload
  4. Recommend policies for comparison
  5. Run a quick validation. Execute a single-size simulation using
  6. Report

What it can do on your machine

Read from SKILL.md and the folder at commit e972fb0. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Grep
    • Glob
    • Bash

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are bash).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Cache Trace Analyzer loads about 702 tokens when it runs. Until then it costs about 24 tokens; SKILL.md has 280 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~24
When it runs · the whole SKILL.md, loaded when a task matches
~702

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Read, Grep, Glob, Bash

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from ben-manes/caffeine at commit e972fb0, republished under its Apache-2.0 licence (© ben-manes). 280 words, ~702 tokens.

Download SKILL.mdSave it as .claude/skills/sim-analyze/SKILL.md (or your agent's skills folder).
name
sim-analyze
description
Analyze a cache trace file to understand its characteristics and recommend policies
allowed-tools
Read, Grep, Glob, Bash
argument-hint
<trace-file>
context
fork
disable-model-invocation
true

Analyze the given cache trace to understand its access pattern characteristics and recommend which cache policies would perform best.

Input

Trace file: $ARGUMENTS

Workflow

  1. Identify the trace format and read the trace:

    • Check file extension, try to parse first lines
    • Determine: key-only or weighted? Timestamps included?
    • Count total accesses and distinct keys
  2. Compute trace statistics. Write a small analysis script or use the simulator's synthetic tools to characterize:

    • Working set size: number of distinct keys
    • Temporal working set: distinct keys in sliding windows
    • Frequency distribution: how many keys account for 80% of accesses? (Zipfian? Uniform? Bimodal?)
    • Recency patterns: what fraction of accesses are repeats within the last N accesses?
    • Scan detection: are there bursts of sequential unique keys?
    • Temporal shifts: does the popular set change over time? (Compare first half vs second half frequency rankings)
  3. Characterize the workload:

    • Frequency-biased: few hot keys dominate → LFU/TinyLFU excel
    • Recency-biased: recent items are reaccessed → LRU/LIRS excel
    • Mixed: both signals matter → W-TinyLFU, ARC
    • Scan-heavy: sequential scans pollute → scan-resistant policies (S3-FIFO, 2Q)
    • Shifting: popular set changes over time → adaptive policies (hill climber)
  4. Recommend policies for comparison:

    • Match trace characteristics to policy strengths
    • Suggest cache sizes based on working set (10%, 25%, 50% of distinct keys)
    • Predict which policies will likely win and why
  5. Run a quick validation. Execute a single-size simulation using simulator:run (not simulator:simulate which does multi-size):

    bash
    ./gradlew simulator:run -q \
      -Dcaffeine.simulator.files.paths.0="format:path" \
      -Dcaffeine.simulator.maximum-size=SIZE \
      -Dcaffeine.simulator.policies.0=product.Caffeine \
      -Dcaffeine.simulator.policies.1=opt.Clairvoyant \
      -Dcaffeine.simulator.policies.2=linked.Lru

    Note: each policy creates instances per admission filter (default: Always, TinyLfu, Clairvoyant). If a trace has no weight data, weighted-only policies are silently skipped.

  6. Report:

    • Trace summary (accesses, distinct keys, frequency distribution shape)
    • Workload characterization (frequency vs recency bias)
    • Recommended policies with reasoning
    • Quick validation results
    • Suggested /sim-compare invocation for full analysis

© ben-manes, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/sim-analyze of ben-manes/caffeine.

Open the folder on GitHubat commit e972fb0

Compare with similar skills

Cache Trace Analyzer next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Cache Trace Analyzer compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Cache Trace Analyzer this skillben-manes/caffeine18k—~702Automated safety check: NotesApache-2.0
Keybase RPC Log Analysiskeybase/client9.3k—~3kAutomated safety check: PassBSD-3-Clause
Performance CheckZeroDeng01/sublinkPro1.7k—~1.8kAutomated safety check: PassMIT
Groovy 5 Developer Guideapache/grails-core2.9k—~3kAutomated safety check: PassApache-2.0
Turborepo Cachingwshobson/agents40k9 repos~2kAutomated safety check: NotesMIT
Content-Hash File Cache Patternaffaan-m/ECC275k5 repos~1.4kAutomated safety check: PassMIT

Similar skills

  • Captures a clean Keybase service log and analyzes it for redundant, duplicated or looping RPCs, then checks whether a caching fix reduced the calls.

    9.3k GitHub stars~3k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Performance Check

    ZeroDeng01/sublinkPro

    Checklist for reviewing code changes that touch queries, APIs, rendering, caching or algorithms for performance, scalability and resource-usage problems.

    1.7k GitHub stars~1.8k tokensUpdated today
    DevelopmentAuto-check passed
  • Groovy 5 Developer Guide

    apache/grails-core

    Guidance for Groovy 5 work in Grails projects: syntax, closures, traits, DSLs, metaprogramming, Spock tests, static compilation and Java 21 integration.

    2.9k GitHub stars~3k tokensUpdated today
    DevelopmentAuto-check passed
  • Turborepo Caching

    wshobson/agents

    Configures Turborepo pipelines and local or remote caching for monorepo builds, including Vercel remote cache, a self-hosted cache and cache-miss debugging.

    40k GitHub starsUsed in 9 repos~2k tokens
    DevelopmentAuto-check: notes
  • Caches slow file processing results in Python keyed by a SHA-256 hash of the file content, so renames still hit the cache and edits invalidate it automatically.

    275k GitHub starsUsed in 5 repos~1.4k tokens
    DevelopmentAuto-check passed
  • Performance Optimization

    ThibautBaissac/rails_ai_agents

    Identifies and fixes Rails performance issues including N+1 queries, slow queries, and memory problems.

    665 GitHub stars~1.2k tokensUpdated 4 mo ago
    DevelopmentAuto-check: notes

More from ben-manes/caffeine

All 33 skills in this repo
  • Runs controlled JMH experiments on the Caffeine cache to find shared contention and hot-path waste, then reviews correctness and returns a reviewable patch.

    18k GitHub stars~2.6k tokensUpdated 2 days ago
    Auto-check: notes
  • Git History Bug Audit

    ben-manes/caffeine

    Audits a module by walking its git history commit by commit, tracking unresolved issues forward, and reporting the ones that survive to HEAD as findings.

    18k GitHub stars~3.3k tokensUpdated 2 days ago
    Auto-check passed
  • Adversarial Codebase Audit

    ben-manes/caffeine

    Runs a hostile review of the Caffeine Java caching library with parallel subagents that get no design docs, then challenges and consolidates their findings.

    18k GitHub stars~1.9k tokensUpdated 2 days ago
    Auto-check: notes
  • Caffeine Performance Audit

    ben-manes/caffeine

    Audits the Caffeine cache source for hot-path costs such as allocations, contention and memory layout, reporting only findings tied to specific lines.

    18k GitHub stars~559 tokensUpdated 2 days ago
    Auto-check passed
  • Audit Sibling Divergence

    ben-manes/caffeine

    Compares code paths that should behave the same, such as sync and async cache methods, and requires a concrete scenario where the two observably disagree.

    18k GitHub stars~4.3k tokensUpdated 2 days ago
    Auto-check: notes
  • Climber Step Minimization

    ben-manes/caffeine

    Prices each step of the window climber algorithm by disabling it in turn, to find steps that no longer earn their keep and branches that no longer fire.

    18k GitHub stars~3k tokensUpdated 2 days ago
    Auto-check: notes

Works with

Questions about Cache Trace Analyzer

What does Cache Trace Analyzer do?

Analyzes a cache trace file for the Caffeine simulator, characterizes its access pattern and recommends which eviction policies to compare. Given a trace file, the skill first works out its format, whether keys only or weighted and whether timestamps exist, and counts accesses and distinct keys. It then measures working set size, windowed working sets, how skewed the frequency distribution is, how often recent keys repeat, bursts of sequential unique keys and shifts in what is popular over time.

When should I use Cache Trace Analyzer?

Cache Trace Analyzer fits situations like: understanding what a new cache trace looks like; choosing which eviction policies to simulate; deciding on cache sizes from the working set size; detecting sequential scans in an access log.

How do I install Cache Trace Analyzer in Claude Code?

Run `npx skills add ben-manes/caffeine --skill sim-analyze -a claude-code`. Or copy the skill folder (.claude/skills/sim-analyze in ben-manes/caffeine) into .claude/skills/sim-analyze in your project. Claude Code loads it when a task matches its description.

How do I install Cache Trace Analyzer in Codex?

Run `npx skills add ben-manes/caffeine --skill sim-analyze -a codex`. Or copy the skill folder (.claude/skills/sim-analyze in ben-manes/caffeine) into .agents/skills/sim-analyze in your project. Codex loads it when a task matches its description.

Can I use Cache Trace Analyzer in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ben-manes/caffeine --skill sim-analyze -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/sim-analyze, .gemini/skills/sim-analyze, .github/skills/sim-analyze and .opencode/skills/sim-analyze in your project.

What does Cache Trace Analyzer need to run?

SKILL.md names no scripts, command-line tools or credentials: Cache Trace Analyzer is instructions for the agent only. Our summary lists: The Caffeine repository with its Gradle simulator; Java for running ./gradlew. Its frontmatter pre-approves these tools: Read, Grep, Glob, Bash.

Does Cache Trace Analyzer access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Cache Trace Analyzer safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Cache Trace Analyzer use?

Cache Trace Analyzer is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Cache Trace Analyzer use?

About 702 tokens (SKILL.md is roughly 2.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Cache Trace Analyzer?

Skills that share tags, products or a category with Cache Trace Analyzer: Keybase RPC Log Analysis (keybase/client, 9.3k stars), Performance Check (ZeroDeng01/sublinkPro, 1.7k stars), Groovy 5 Developer Guide (apache/grails-core, 2.9k stars) and Turborepo Caching (wshobson/agents, 40k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Cache Trace Analyzer?

ben-manes (a GitHub user) maintains it in ben-manes/caffeine, which has 17,880 GitHub stars. The repository holds 33 skills in this directory. The repository was last updated on October 6, 2026.

Source: ben-manes/caffeine on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.