Get the FREE Ultimate OpenClaw Setup Guide →

clear-cache

npx machina-cli add skill yusufalikync/ccs/clear-cache --openclaw
Files (1)
SKILL.md
799 B

Clear Cache

Remove statusline usage cache files to force fresh API data on next status line refresh.

Instructions

1. List existing cache files

ls -la /tmp/claude_usage_cache_*.json 2>/dev/null || echo "No cache files found"

2. Delete cache files

rm -f /tmp/claude_usage_cache_*.json

3. Confirm cleanup

ls /tmp/claude_usage_cache_*.json 2>/dev/null && echo "WARNING: Some files remain" || echo "All cache files cleared"

Report how many files were removed and confirm the cleanup is complete. The status line will fetch fresh usage data on its next refresh cycle (within 60 seconds).

Source

git clone https://github.com/yusufalikync/ccs/blob/main/.claude/skills/clear-cache/SKILL.mdView on GitHub

Overview

Removes /tmp/claude_usage_cache_*.json files that store statusline usage data. This forces the status line to fetch fresh API data on its next refresh, typically within 60 seconds.

How This Skill Works

It uses Bash to list the cache files, delete them with rm -f, and then verify the cleanup with a follow-up ls. After cleanup, the status line will fetch fresh usage data on the next refresh cycle.

When to Use It

  • The status line shows stale usage data and you need a fresh pull on the next refresh.
  • You updated quotas or usage rules and want the cache cleared to reflect changes.
  • Before testing a feature that depends on live usage data in the status line.
  • During debugging when stale cache could mislead results.
  • Automating environment cleanup to ensure /tmp caches do not persist across runs.

Quick Start

  1. Step 1: List existing cache files
  2. Step 2: Delete cache files
  3. Step 3: Confirm cleanup and report the number of files removed (next refresh in 60s)

Best Practices

  • Target only /tmp/claude_usage_cache_*.json to avoid deleting unrelated files.
  • Run in a controlled shell session and avoid elevated privileges if not necessary.
  • Always run the three-step flow and verify with the final confirmation.
  • Consider a dry-run by listing files before deleting to confirm scope.
  • Log or print the number of files removed for auditability.

Example Use Cases

  • ls -la /tmp/claude_usage_cache_*.json 2>/dev/null || echo 'No cache files found'
  • removed=$(ls -1 /tmp/claude_usage_cache_*.json 2>/dev/null | wc -l); rm -f /tmp/claude_usage_cache_*.json; echo "${removed} files removed"
  • ls /tmp/claude_usage_cache_*.json 2>/dev/null && echo 'WARNING: Some files remain' || echo 'All cache files cleared'
  • Status line next refresh will fetch fresh data within 60 seconds
  • Automate in CI: bash clear-cache.sh

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers