toolkit/packages/skills/research-cache/SKILL.md
Manage and search the research cache for previously analyzed repositories
npx skillsauth add stevengonsalvez/agents-in-a-box research-cacheInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Manage the global repository analysis cache used by the /research command.
The research cache stores analysis results from external repositories discovered during web research. This prevents re-analyzing the same repositories and speeds up research workflows.
Cache Location: {{HOME_TOOL_DIR}}/research-cache/
Cache Structure:
{{HOME_TOOL_DIR}}/research-cache/
<owner>-<repo>-<commit-short>/
analysis.md # Focused analysis document
metadata.json # Cache metadata (timestamps, query hash)
When the /research command discovers external repositories:
focused-repository-analyzer agentbash toolkit/claude-code-4.5/utils/repo-analysis-cache.sh stats
Output:
Cache Statistics
Directory: {{HOME_TOOL_DIR}}/research-cache
Entries:
Total: 15
Valid: 12
Expired: 3
Invalid: 0
Storage:
Total Size: 45678KB
Configuration:
TTL: 604800s (7 days)
Max Age: 2592000s (30 days)
# List valid entries only
bash toolkit/claude-code-4.5/utils/repo-analysis-cache.sh list
# Include expired entries
bash toolkit/claude-code-4.5/utils/repo-analysis-cache.sh list --expired
Output:
Cache Directory: {{HOME_TOOL_DIR}}/research-cache
CACHE KEY STATUS CREATED QUERY HASH
---------- ------ ------- ----------
facebook-react-a1b2c3d VALID 2026-01-01T12:00:00 f3a8c91e
vercel-next.js-e4f5g6h VALID 2026-01-02T14:30:00 7b2d4a9c
golang-go-i7j8k9l EXPIRED 2025-12-20T09:15:00 3c1e5f2a
# Purge only expired entries (older than max age)
bash toolkit/claude-code-4.5/utils/repo-analysis-cache.sh purge
# Force purge all entries
bash toolkit/claude-code-4.5/utils/repo-analysis-cache.sh purge --force
Output:
Purging: golang-go-i7j8k9l (age: 2678400s)
Purging invalid: broken-repo-abc123
Purge Summary:
Purged: 2
Kept: 13
# Get path to cached analysis
CACHE_KEY="facebook-react-a1b2c3d"
ANALYSIS_PATH=$(bash toolkit/claude-code-4.5/utils/repo-analysis-cache.sh get "$CACHE_KEY")
if [ $? -eq 0 ]; then
echo "Found cached analysis: $ANALYSIS_PATH"
cat "$ANALYSIS_PATH"
else
echo "No cached analysis found"
fi
# Check if cache entry exists
CACHE_KEY="facebook-react-a1b2c3d"
if bash toolkit/claude-code-4.5/utils/repo-analysis-cache.sh exists "$CACHE_KEY"; then
echo "Cache hit: $CACHE_KEY"
else
echo "Cache miss: $CACHE_KEY"
fi
# Check with query hash matching
QUERY_HASH="f3a8c91e"
if bash toolkit/claude-code-4.5/utils/repo-analysis-cache.sh exists "$CACHE_KEY" "$QUERY_HASH"; then
echo "Cache hit with matching query"
else
echo "Cache miss or query mismatch"
fi
# Generate cache key from repo URL and commit
REPO_URL="https://github.com/facebook/react"
COMMIT_HASH="a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0"
CACHE_KEY=$(bash toolkit/claude-code-4.5/utils/repo-analysis-cache.sh key "$REPO_URL" "$COMMIT_HASH")
echo "Cache key: $CACHE_KEY"
# Output: facebook-react-a1b2c3d
Each cache entry includes metadata.json:
{
"cache_key": "facebook-react-a1b2c3d",
"repo_url": "https://github.com/facebook/react",
"commit_hash": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0",
"query": "How to implement React hooks?",
"query_hash": "f3a8c91e",
"context": "Discovered during web research for: React hooks implementation",
"created_at": 1735747200,
"created_date": "2026-01-01T12:00:00Z",
"ttl_seconds": 604800,
"expires_at": 1736352000,
"expires_date": "2026-01-08T12:00:00Z"
}
purge monthly to remove old entries--force when resetting research stateCache entries are automatically invalidated when:
# View what's cached
bash toolkit/claude-code-4.5/utils/repo-analysis-cache.sh list
# Check stats before purging
bash toolkit/claude-code-4.5/utils/repo-analysis-cache.sh stats
# Purge expired only
bash toolkit/claude-code-4.5/utils/repo-analysis-cache.sh purge
# Force clean slate
bash toolkit/claude-code-4.5/utils/repo-analysis-cache.sh purge --force
# Override cache directory
export CLAUDE_RESEARCH_CACHE="/custom/cache/path"
# Default: {{HOME_TOOL_DIR}}/research-cache
Edit toolkit/claude-code-4.5/utils/repo-analysis-cache.sh:
# Cache TTL in seconds (7 days)
CACHE_TTL=$((7 * 24 * 60 * 60))
# Max age before purge (30 days)
MAX_CACHE_AGE=$((30 * 24 * 60 * 60))
Symptom: Research always re-analyzes repositories
Check:
# Verify cache exists
bash toolkit/claude-code-4.5/utils/repo-analysis-cache.sh stats
# Check if entry is valid
bash toolkit/claude-code-4.5/utils/repo-analysis-cache.sh exists <cache-key>
Fix:
Symptom: Cache directory consuming excessive disk space
Check:
# View cache size
bash toolkit/claude-code-4.5/utils/repo-analysis-cache.sh stats
Fix:
# Purge expired entries
bash toolkit/claude-code-4.5/utils/repo-analysis-cache.sh purge
# Or force purge all
bash toolkit/claude-code-4.5/utils/repo-analysis-cache.sh purge --force
Symptom: Cache entry exists but cannot be read
Fix:
# Manually remove corrupted entry
rm -rf {{HOME_TOOL_DIR}}/research-cache/<cache-key>
# Reinitialize cache
bash toolkit/claude-code-4.5/utils/repo-analysis-cache.sh init
The research cache is automatically used by the /research command:
No manual intervention required for normal research workflows.
Without Cache:
With Cache:
Typical Savings: 99%+ time reduction for repeated research queries
# Get all valid cache keys
for cache_dir in {{HOME_TOOL_DIR}}/research-cache/*; do
if [ -f "$cache_dir/metadata.json" ]; then
CACHE_KEY=$(basename "$cache_dir")
AGE=$(jq -r '.created_at' "$cache_dir/metadata.json")
echo "$CACHE_KEY: created $(date -r $AGE)"
fi
done
# Export to JSON
bash toolkit/claude-code-4.5/utils/repo-analysis-cache.sh stats > cache-stats.txt
# Parse for monitoring
grep "Total:" cache-stats.txt
# Find all React-related analyses
grep -r "React" {{HOME_TOOL_DIR}}/research-cache/*/analysis.md
# Find analyses newer than N days
find {{HOME_TOOL_DIR}}/research-cache -name "metadata.json" -mtime -7 -exec jq -r '.repo_url' {} \;
/research - Main research command that uses cachefocused-repository-analyzer - Agent that generates cached analysestoolkit/claude-code-4.5/utils/repo-analysis-cache.sh - Cache utility scriptdocumentation
Report reflect drain spend over a time window — tokens split by cached (cache_read), uncached writes (cache_creation), and io (input+output), with a $ estimate, grouped by day / outcome / model / transcript. Reads the drainer's cost log and surfaces outlier runs and cache-reuse health (the 41.5M-token failure mode = low cache reuse + high cache writes). Use to answer "what is reflection costing me" for the last day / week.
development
Show fleet status — every claude session running on the host, merged across ainb + claude-peers broker + background jobs. Use when you need to enumerate sessions before composing an action, see which sessions have a peer registered (broker-routable) vs tmux-only, check the `summary` of each session, or pipe the list into jq for filtering. Default output: text table. Pass --format json for LLM consumption.
testing
Ordered multi-step prompts to fleet targets, ack-gated between steps via JSONL assistant-turn-end detection. Use for cycles like disconnect→reconnect→verify, or any flow where step N+1 requires step N to have completed first. The skill BLOCKS until each target's transcript shows the next assistant turn finishing OR per-step timeout fires (default 300s).
development
Center control panel — enumerate every claude session that is blocked waiting on something: a user answer (AskUserQuestion fired), an API error retry, an idle assistant turn-end with no follow-up, or an explicit WAITING: marker. Returns rich JSON with signal kind + context per session. Use this when you've stepped away from the fleet and want one place to see everything that wants your attention and answer it.