Post-workflow cache refresh for Repomix. Automatically refreshes compressed codebase representation after files are modified. Ensures next command has accurate context with 70% token savings. Invoke at end of any workflow that modifies source files. Takes ~2.4 seconds when refresh needed.
Automatically refreshes Repomix cache after file modifications. Triggers at workflow end when source files, configs, or docs change, ensuring 70% token savings for subsequent commands.
/plugin marketplace add metasaver/metasaver-marketplace/plugin install core-claude-plugin@metasaver-marketplaceThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Purpose: Keep Repomix cache fresh after file modifications for optimal token efficiency. Trigger: End of any workflow that modifies source code, configs, or documentation. Performance: ~2.4 seconds overhead, 70% token savings on subsequent operations.
Repomix compresses codebases into AI-friendly format, providing 70% token reduction on file operations.
Problem: If cache becomes stale, subsequent commands work with outdated context. Solution: Refresh cache at end of workflows that modify relevant files.
Cache Strategy:
Session Start → Use existing cache (from previous command)
Command N Executes → Uses current cache
Command N Completes → Refresh if files changed
Command N+1 Executes → Uses fresh cache
Invoke this skill at the END of:
/ms command workflows/audit command workflows/build command workflowsSkip refresh when:
| Pattern | Examples |
|---|---|
*.ts, *.tsx | TypeScript source |
*.js, *.jsx | JavaScript source |
*.json | Config files, package.json |
*.md | Documentation |
*.yaml, *.yml | CI/CD, configs |
| Pattern | Reason |
|---|---|
node_modules/ | Dependencies, not source |
dist/, build/ | Build artifacts |
.turbo/ | Turbo cache |
*.log | Log files |
.repomix-output.* | Output file itself |
At workflow completion, execute this logic:
// 1. Collect modified files from workflow
const modifiedFiles = workflowResults.flatMap(r => r.filesModified || []);
// 2. Filter to relevant files
const relevantFiles = modifiedFiles.filter(file => {
// Exclude build artifacts and dependencies
if (file.match(/(node_modules|dist|build|\.turbo|\.log|\.repomix-output)/)) {
return false;
}
// Include source code, configs, docs
return file.match(/\.(ts|tsx|js|jsx|json|md|ya?ml)$/);
});
// 3. Refresh if relevant files changed
if (relevantFiles.length > 0) {
// Run: npx repomix --config .repomix.config.json
console.log(`Refreshing Repomix cache (${relevantFiles.length} files changed)...`);
} else {
console.log("No relevant changes, cache still fresh");
}
When refresh is needed, run:
npx repomix --config .repomix.config.json
Requirements:
.repomix.config.json must exist in project root| Metric | Value |
|---|---|
| Refresh time | ~2.4 seconds |
| Token savings | 70% on file operations |
| Overhead per command | Minimal (only when files changed) |
| Accuracy | 100% (no stale data) |
Use these consistent messages:
# When refreshing
Refreshing Repomix cache ({N} files changed)...
Repomix cache ready for next command
# When skipping
No relevant changes, Repomix cache still fresh
# When no config found
Repomix config not found, skipping cache refresh
For command authors:
filesModified: string[] in outputFor CLAUDE.md: