Skip to content
Automation
Skill

/cleaning-up-research-sessions

Safely remove intermediate files from completed research sessions while preserving important data

From plugin
auto-empirical-research-skills
3.3k200 skills146 agents
Install
$ npx -y skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill cleaning-up-research-sessions --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/cleaning-up-research-sessions

Context preview

The summary Claude sees to decide when to auto-load this skill.

Safely remove intermediate files from completed research sessions while preserving important data

SKILL.md

cleaning-up-research-sessions.SKILL.md
name: Cleaning Up Research Sessions
description: Safely remove intermediate files from completed research sessions while preserving important data
when_to_use: After research session is complete and consolidated. When research folder has accumulated temporary files. Before archiving or sharing research session.
version: 1.0.0

<!-- ╔══════════════════════════════════════════════════════════════╗ ║ 本文件为开源 Skill 原始文档,收录仅供学习与研究参考 ║ ║ CoPaper.AI 收集整理 | https://copaper.ai ║ ╚══════════════════════════════════════════════════════════════╝

来源仓库: https://github.com/kthorn/research-superpower 项目名称: research-superpower 开源协议: MIT License 收录日期: 2026-04-02

声明: 本文件版权归原作者所有。此处收录旨在为社会科学实证研究者 提供 AI Agent Skills 的集中参考。如有侵权,请联系删除。 -->

Cleaning Up Research Sessions

Overview

Remove intermediate files created during research workflow while preserving all important data.

**Core principle:** Conservative cleanup with user confirmation. Never delete anything important.

When to Use

Use this skill when:

  • Research session is complete and consolidated
  • Preparing to archive or share research session folder
  • Research folder has accumulated temporary/intermediate files
  • User explicitly asks to clean up

**When NOT to use:**

  • Research is still in progress
  • User hasn't reviewed final outputs yet
  • Unsure what files are safe to delete

Files That Are ALWAYS KEPT

**NEVER delete these (protected list):**

**Core outputs:**

  • `SUMMARY.md` - Enhanced findings with methodology
  • `relevant-papers.json` - Filtered relevant papers
  • `papers-reviewed.json` - Complete screening history
  • `papers/` directory - All PDFs and supplementary files
  • `citations/citation-graph.json` - Citation relationships

**Methodology documentation:**

  • `screening-criteria.json` - Rubric definition (if exists)
  • `test-set.json` - Rubric validation papers (if exists)
  • `abstracts-cache.json` - Cached abstracts for re-screening (if exists)
  • `rubric-changelog.md` - Rubric version history (if exists)

**Auxiliary documentation (if exists):**

  • `README.md` - Project overview
  • `TOP_PRIORITY_PAPERS.md` - Curated priority list
  • `evaluated-papers.json` - Rich structured data

**Project configuration:**

  • `.claude/` directory - Permissions and settings
  • `*.py` helper scripts that were created - Keep for reproducibility

Files That May Be Cleaned Up

**Candidates for removal (with confirmation):**

**Intermediate search results:**

  • `initial-search-results.json` - Raw PubMed results before screening
  • Safe to delete: Data is in papers-reviewed.json
  • Reason to keep: Shows raw search results for reproducibility

**Temporary files:**

  • `*.tmp` files
  • `*.swp` files (vim swap files)
  • `.DS_Store` (macOS)
  • `__pycache__/` (Python cache)
  • `*.pyc` (Python compiled)

**Log files:**

  • `*.log` files
  • `debug-*.txt` files

Cleanup Workflow

Step 1: Analyze Research Session

cd research-sessions/YYYY-MM-DD-description/

# List all files with sizes
find . -type f -exec ls -lh {} \; | awk '{print $5, $9}' | sort -rh

**Identify files by category:**

  • Core outputs (MUST keep)
  • Methodology files (SHOULD keep)
  • Intermediate files (candidates for cleanup)
  • Temporary files (safe to delete)

Step 2: Present Cleanup Plan to User

**Show what will be deleted:**

🧹 Cleanup Analysis for: research-sessions/2025-10-11-btk-selectivity/

Files to KEEP (protected):
  ✅ SUMMARY.md (45 KB)
  ✅ relevant-papers.json (12 KB)
  ✅ papers-reviewed.json (28 KB)
  ✅ papers/ (14 PDFs, 32 MB)
  ✅ citations/citation-graph.json (5 KB)
  ✅ screening-criteria.json (2 KB)
  ✅ abstracts-cache.json (156 KB)

Files that CAN be removed (intermediate):
  🗑️  initial-search-results.json (8 KB) - Raw PubMed results
  🗑️  .DS_Store (6 KB) - macOS metadata

Total space to recover: 14 KB

Proceed with cleanup? (y/n/review)

**Options:**

  • `y` - Delete intermediate files
  • `n` - Cancel cleanup, keep everything
  • `review` - Show contents of each file before deciding

Step 3: Confirm Deletions

**Before deleting ANY file:**

1. **Verify it's not in protected list** 2. **Check file isn't referenced in SUMMARY.md** 3. **Confirm with user one more time**

**Example confirmation:**

About to delete:
- initial-search-results.json (8 KB)

This file contains raw PubMed search results. The data is preserved in
papers-reviewed.json, so this is safe to delete.

Confirm deletion? (y/n)

Step 4: Perform Cleanup

**Delete confirmed files:**

# Move to trash instead of rm (safer)
# On macOS:
mv initial-search-results.json ~/.Trash/

# On Linux:
mv initial-search-results.json ~/.local/share/Trash/files/

# Or use rm if user confirms
rm initial-search-results.json

**Report results:**

✅ Cleanup complete!

Removed:
- initial-search-results.json (8 KB)
- .DS_Store (6 KB)

Space recovered: 14 KB

Protected files preserved:
- All 8 core files kept
- All 14 PDFs kept
- All methodology documentation kept

Step 5: Verify Integrity

**After cleanup, verify critical files:**

# Check core files exist
test -f SUMMARY.md && echo "✓ SUMMARY.md"
test -f relevant-papers.json && echo "✓ relevant-papers.json"
test -f papers-reviewed.json && echo "✓ papers-reviewed.json"
test -d papers && echo "✓ papers/ directory"

# Verify JSON files are valid
jq empty relevant-papers.json && echo "✓ relevant-papers.json valid JSON"
jq empty papers-reviewed.json && echo "✓ papers-reviewed.json valid JSON"

**Report to user:**

✅ Integrity check passed
   - All core files present
   - All JSON files valid
   - All PDFs intact

Special Cases

Case 1: Large abstracts-cache.json

**If abstracts-cache.json is very large (>100 MB):**

⚠️  abstracts-cache.json is 256 MB

This file enables re-screening if you update the rubric. Options:
1. Keep (recommended if you might refine rubric)
2. Compress (gzip to ~50 MB, can decompress later)
3. Delete (only if research is final and won't
Read more
Ships withauto-empirical-research-skills

📌 文档结构(2026-07-22 起): 本文件是中文默认入口 —— banner + badges + 信任面 + 9 阶段流水线速览 + 76 行合集总表。 每个合集的完整描述、按用途分组、精确数字、验证方法在 docs/CONTENT_ZH.md(扩展正文,总表行内的 → 直接跳转到对应锚点)。 English version: README-en.md · 中文扩展正文:docs/CONTENT_ZH.md · README-zh-CN.md 已弃用(重定向占位) 🌐 语言: English |

Get the whole plugin