List cache entries with filtering, sorting, and freshness status. Delegates to fractary CLI for actual cache operations.
Lists cached codex entries with filtering by freshness and project, sorted by size or date. Use when you need to inspect cache contents or verify what documents are stored locally.
/plugin marketplace add fractary/claude-plugins/plugin install fractary-codex@fractaryThis skill inherits all available tools. When active, it can use any tool Claude has access to.
scripts/list-cache.shYour responsibility is to display the current state of the codex cache by delegating to the cli-helper skill which invokes the fractary codex cache list CLI command.
Architecture (v4.0):
cache-list skill
↓ (delegates to)
cli-helper skill
↓ (invokes)
fractary codex cache list
↓ (uses)
@fractary/codex SDK (CacheManager)
This provides cache visibility with filtering, sorting, and freshness status via the TypeScript SDK. </CONTEXT>
<CRITICAL_RULES>
Construct arguments array from inputs:
args = ["list"]
// Add filters
if (filter?.expired) args.push("--expired")
if (filter?.fresh) args.push("--fresh")
if (filter?.project) args.push("--project", filter.project)
// Add sorting
if (sort) args.push("--sort", sort)
USE SKILL: cli-helper Operation: invoke-cli Parameters:
{
"command": "cache",
"args": ["list", ...filters, ...sort],
"parse_output": true
}
The cli-helper will:
fractary codex cache list [--expired] [--fresh] [--project <name>] [--sort <field>] --jsonThe CLI returns JSON like:
{
"status": "success",
"operation": "cache-list",
"stats": {
"total_entries": 42,
"total_size_bytes": 3355443,
"fresh_count": 38,
"expired_count": 4,
"last_cleanup": "2025-01-15T10:00:00Z"
},
"entries": [
{
"uri": "codex://fractary/auth-service/docs/oauth.md",
"reference": "@codex/auth-service/docs/oauth.md",
"size_bytes": 12595,
"cached_at": "2025-01-15T10:00:00Z",
"expires_at": "2025-01-22T10:00:00Z",
"last_accessed": "2025-01-16T08:30:00Z",
"is_fresh": true
}
]
}
IF status == "success":
IF status == "failure":
IF format == "json":
IF format == "formatted" (default):
Display formatted output to user.
COMPLETION: Operation complete when formatted list is shown.
</WORKFLOW><COMPLETION_CRITERIA> Operation is complete when:
✅ For successful list:
✅ For failed list:
✅ In all cases:
📦 CODEX CACHE STATUS
───────────────────────────────────────
Total entries: 42
Total size: 3.2 MB
Fresh: 38 | Expired: 4
Last cleanup: 2025-01-15T10:00:00Z
───────────────────────────────────────
FRESH ENTRIES (38):
✓ codex://fractary/auth-service/docs/oauth.md
Size: 12.3 KB | Expires: 2025-01-22T10:00:00Z (6 days)
✓ codex://fractary/faber-cloud/specs/SPEC-00020.md
Size: 45.2 KB | Expires: 2025-01-21T14:30:00Z (5 days)
EXPIRED ENTRIES (4):
⚠ codex://fractary/old-service/README.md
Size: 5.1 KB | Expired: 2025-01-10T08:00:00Z (5 days ago)
───────────────────────────────────────
Use /fractary-codex:cache-clear to remove entries
Use /fractary-codex:fetch --bypass-cache to refresh
📦 CODEX CACHE STATUS
───────────────────────────────────────
Cache is empty (0 entries)
───────────────────────────────────────
Use /fractary-codex:fetch to retrieve documents
Returns raw CLI JSON response:
{
"status": "success",
"operation": "cache-list",
"stats": {
"total_entries": 42,
"total_size_bytes": 3355443,
"fresh_count": 38,
"expired_count": 4,
"last_cleanup": "2025-01-15T10:00:00Z"
},
"entries": [...]
}
{
"status": "failure",
"operation": "cache-list",
"error": "Cache index corrupted",
"cli_error": {
"message": "Failed to parse cache index",
"suggested_fixes": [
"Run: fractary codex cache clear --all",
"Cache will be rebuilt on next fetch"
]
}
}
{
"status": "failure",
"operation": "cache-list",
"error": "CLI not available",
"suggested_fixes": [
"Install globally: npm install -g @fractary/cli",
"Or ensure npx is available"
]
}
</OUTPUTS>
<ERROR_HANDLING>
When CLI reports cache index doesn't exist:
When CLI reports corrupted index:
fractary codex cache clear --allWhen cli-helper reports CLI unavailable:
When CLI returns error:
</ERROR_HANDLING>
<DOCUMENTATION> Upon completion, output:Success:
🎯 STARTING: cache-list
Filters: {applied filters}
Sort: {sort field}
───────────────────────────────────────
[Formatted cache listing]
✅ COMPLETED: cache-list
Displayed {count} cache entries
Total size: {human_size}
Source: CLI (via cli-helper)
───────────────────────────────────────
Failure:
🎯 STARTING: cache-list
───────────────────────────────────────
❌ FAILED: cache-list
Error: {error_message}
Suggested fixes:
- {fix 1}
- {fix 2}
───────────────────────────────────────
</DOCUMENTATION>
<NOTES>
v3.0 (bash scripts):
cache-list
└─ scripts/list-cache.sh
├─ reads cache index directly
├─ applies filters
└─ formats output
v4.0 (CLI delegation):
cache-list
└─ delegates to cli-helper
└─ invokes: fractary codex cache list
Benefits:
This skill delegates to:
fractary codex cache list [--expired] [--fresh] [--project <name>] [--sort <field>] --json
Via the CLI, this skill benefits from:
CacheManager.list() - Main listing logicConvert bytes to human-readable:
= 1024*1024: MB (1 decimal)
Calculate relative time:
= 7 days: weeks
To test this skill:
# Ensure CLI installed
npm install -g @fractary/cli
# Populate cache first
fractary codex fetch codex://fractary/codex/README.md
# Test list
USE SKILL: cache-list
Parameters: {
"filter": {"fresh": true},
"sort": "size"
}
If list fails:
fractary --versionfractary codex cache list (direct CLI)fractary codex cache clear --allfractary codex health
</NOTES>