load-cache-data
БесплатноБез исполняемых скриптовНе проверенLoad the last 10 cache entries as JSON with session titles, prompt excerpts, paths, and repository URLs omitted by default. Use --include-sensitive only when…
от rajbos★ 127 звёзд на GitHubОб этом скилле
Load Cache Data Skill
Use --json for output; don't pretty-print or write extra files. The default output omits session titles, prompt excerpts, workspace paths, repository URLs, and cache file paths. Never use --include-sensitive unless the task explicitly requires those fields.
This skill helps you access and inspect the AI Engineering Fluency's local session file cache. The cache stores pre-computed statistics for session files to avoid re-processing unchanged files.
Overview
The extension keeps a cache of session file statistics in memory and persists it to a snapshot file in its globalStorage directory (cache_prod.snapshot.json, or cache_dev.snapshot.json in the Extension Development Host). This cache contains:
- Token counts (total and per-model)
- Interaction counts
- Model usage breakdowns
- File modification times (for cache validation)
- Usage analysis data (tool calls, mode usage, context references)
When to Use This Skill
Use this skill when you need to:
- Inspect cached session file data
- Debug cache behavior or validation logic
- Understand what data is being cached
- Work with real cached data for testing or development
- Iterate on features that rely on cached statistics
Cache Structure
The snapshot file is an envelope ({ schemaVersion, cacheVersion, cacheId, generatedAt, entryCount, entries }) whose entries map is keyed by the absolute session file path. Each entry contains (abridged; see SessionFileCache in src/types.ts):
interface SessionFileCache {
tokens: number; // Total token count
interactions: number; // Number of interactions
modelUsage: ModelUsage; // Per-model token breakdown
mtime: number; // File modification timestamp
usageAnalysis?: SessionUsageAnalysis; // Detailed usage statistics
subAgentCalls?: number; // Sub-agent/delegation tool calls (absent when 0)
}
interface ModelUsage {
[model: string]: {
inputTokens: number;
outputTokens: number;
};
}
interface SessionUsageAnalysis {
toolCalls: ToolCallUsage; // Tool usage statistics
modeUsage: ModeUsage; // Mode distribution
contextReferences: ContextReferenceUsage; // Context reference counts
mcpTools: McpToolUsage; // MCP tool usage
}
Location
Cache Storage: <globalStorageUri>/cache_<prod|dev>.snapshot.json
- In memory:
CacheManager.cache(aMap<string, SessionFileCache>) - On disk: written by
CacheManager.trySaveCacheToStorage(), loaded byCacheManager.loadCacheFromStorage() - Not stored in VS Code's
globalState: on activation the extension removes any leftover cache keys from it (a one-time migration)
Implementation: src/extension.ts (see CacheManager in src/cacheManager.ts below for the actual persistence logic)
How to Access the Cache
From Within the Extension
Inside the extension the cache is the in-memory map held by CacheManager:
// CacheManager.cache is a Map<string, SessionFileCache>
const cacheEntries = Array.from(cacheManager.cache.entries());
// Get last 10 entries (sorted by modification time)
const last10 = cacheEntries
.sort((a, b) => (b[1].mtime || 0) - (a[1].mtime || 0))
.slice(0, 10);
// Display cache entries
for (const [, cacheEntry] of last10) {
console.log({
tokens: cacheEntry.tokens,
interactions: cacheEntry.interactions,
modelUsage: cacheEntry.modelUsage,
lastModified: new Date(cacheEntry.mtime).toISOString()
});
}
Using the Provided Script
This skill includes an executable script that loads and displays actual cache data from disk:
Location: .github/skills/load-cache-data/load-cache-data.js
Usage:
# RECOMMENDED: Always use --json for raw JSON output
node .github/skills/load-cache-data/load-cache-data.js --json
# Show last N entries as JSON (default is 10)
node .github/skills/load-cache-data/load-cache-data.js --last 5 --json
# Include full entries only when explicitly needed
node .github/skills/load-cache-data/load-cache-data.js --include-sensitive --json
# Show help
node .github/skills/load-cache-data/load-cache-data.js --help
--last is capped at 100 entries. The script searches only VS Code globalStorage; it does not trust files in temporary or current-working directories. Default entry keys are anonymous (session-1, etc.), unrecognized fields are omitted, and maps keyed by file paths or names are dropped: usageAnalysis.contextReferences.byPath, plus languageUsage and usageAnalysis.editScope.languageUsage (keyed by file extension, or by the whole basename for extensionless files such as Dockerfile). usageAnalysis.toolCalls, mcpTools and skillCalls keep only their totals, because their per-tool, per-server and per-skill maps are keyed by names taken from the session. Correction moments keep only their type, turn number, timestamp, flags and pattern label; t
Установить load-cache-data в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл load-cache-data?
Load the last 10 cache entries as JSON with session titles, prompt excerpts, paths, and repository URLs omitted by default. Use --include-sensitive only when full entries are explicitly needed.
Как установить скилл load-cache-data?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл load-cache-data запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic