一键导入
session-cleanup
Clean up ~/.ai/ disk space (runs, sessions, traces). Use when user says "清理", "磁盘空间", "cleanup", or wants to free space under ~/.ai/.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Clean up ~/.ai/ disk space (runs, sessions, traces). Use when user says "清理", "磁盘空间", "cleanup", or wants to free space under ~/.ai/.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Planner-Generator-Evaluator 编排模式。GAN 启发的多 agent 动态编排,通过 ai CLI 控制子 agent 完成复杂任务的拆解-执行-验证闭环。
Code review skill using codex-rs methodology with ai CLI
为任意代码仓库构建结构化知识库(code wiki),并通过 frozen snapshot 机制启动即问即答的 expert agent。 当你需要深入理解一个大型代码仓库、构建可复用的代码知识库、或为其他 agent 提供代码专家服务时使用此技能。
Use the mcporter CLI to list, configure, auth, and call MCP servers/tools directly (HTTP or stdio), including ad-hoc servers, config edits, and CLI/type generation.
Orchestrate a real-time alternating debate between two subagents using ai serve/send. Judge controls rounds by prompting each agent in turn.
任务规划与进度追踪。当任务有 5+ 步骤、多文件改动、或长执行链时使用。 核心机制:用 checkbox 列表追踪进度,每完成一步立即更新,利用"重写列表"将完整任务清单重新注入 context。
基于 SOC 职业分类
| name | session-cleanup |
| description | Clean up ~/.ai/ disk space (runs, sessions, traces). Use when user says "清理", "磁盘空间", "cleanup", or wants to free space under ~/.ai/. |
One-command cleanup for ~/.ai/ storage. Safe by default, shows before deleting.
User says:
Agent responds with: current usage → what to clean → confirm → execute.
| Target | Location | Growth Rate | Typical Size |
|---|---|---|---|
| runs | ~/.ai/runs/ | HIGH — agent event logs (events.jsonl) | 10-40 GB |
| sessions | ~/.ai/sessions/ | Low — conversation journals | 100-1000 MB |
| traces | ~/.ai/traces/ | Medium — perfetto trace files | 1-10 GB |
runs/ is always the biggest offender. A single long-running agent can produce 1-19 GB of events.jsonl.
Always start here. User needs to see the situation before deciding.
du -sh ~/.ai/runs/ ~/.ai/sessions/ ~/.ai/traces/ 2>/dev/null
Pick the right analysis based on what's big:
For runs/ (>1GB):
# Count by age
echo "=== runs/ age distribution ===" && \
find ~/.ai/runs/ -maxdepth 1 -type d -exec stat -f '%Sm' -t '%Y-%m-%d' {} \; 2>/dev/null | sort | uniq -c | sort -k2
# Show what would be deleted (default: >3 days)
echo "=== Would delete (>3 days) ===" && \
find ~/.ai/runs/ -maxdepth 1 -type d -mtime +3 -exec du -sh {} + 2>/dev/null | sort -rh | head -20
# Calculate total
find ~/.ai/runs/ -maxdepth 1 -type d -mtime +3 -print0 | xargs -0 du -sm 2>/dev/null | awk '{sum+=$1} END {printf "Total: %.1f MB / %.2f GB\n", sum, sum/1024}'
For sessions/ (>500MB):
# Use bundled script — dry run first
bash $(dirname "$0")/scripts/clean-sessions.sh
For traces/ (>2GB):
# Count by age
echo "=== traces/ age distribution ===" && \
find ~/.ai/traces/ -maxdepth 1 -type f -exec stat -f '%Sm' -t '%Y-%m-%d' {} \; 2>/dev/null | sort | uniq -c | sort -k2
# Show what would be deleted (>3 days)
find ~/.ai/traces/ -maxdepth 1 -type f -mtime +3 -exec du -sh {} + 2>/dev/null | awk '{sum+=$1} END {printf "Total: %.1f MB / %.2f GB\n", sum, sum/1024}'
Always confirm with user before deleting. Show:
Default thresholds:
mtime +3 (older than 3 days)scripts/clean-sessions.sh with MODE=stale STALE_DAYS=3mtime +3Execute:
# Clean runs (no confirmation prompt needed — user already confirmed)
find ~/.ai/runs/ -maxdepth 1 -type d -mtime +3 -exec rm -rf {} +
# Clean sessions (script path relative to skill root)
DRY_RUN=false MODE=stale STALE_DAYS=3 bash scripts/clean-sessions.sh <<< "yes"
# Clean traces
find ~/.ai/traces/ -maxdepth 1 -type f -mtime +3 -delete
echo "=== After cleanup ===" && du -sh ~/.ai/runs/ ~/.ai/sessions/ ~/.ai/traces/ 2>/dev/null
Show before/after comparison.
If user specifies different preferences:
mtime +3 to mtime +7mtime +0 (everything not from today), use MODE=all~/.ai/skills/, ~/.ai/prompts/, ~/.ai/templates/. These are user config.MODE=all unless user explicitly says "全部".events.jsonl in runs/ can be 19GB+ for a single run due to empty thinking stream updates (a bug in the streaming layer). This is the #1 cause of disk bloat.