Back to skills
SkillHub ClubShip Full StackFull Stack

context-cleanup

Analyze and archive low-value memory notes in OpenClaw workspace to reduce context bloat and improve responsiveness. 适用于上下文冗余、维护整理场景;默认流程为 analyze → plan → confirm → archive,归档优先于删除。

Packaged view

This page reorganizes the original catalog entry around fit, installability, and workflow context first. The original raw source lives below.

Stars
3,127
Hot score
99
Updated
March 20, 2026
Overall rating
C0.0
Composite score
0.0
Best-practice grade
B80.4

Install command

npx @skill-hub/cli install openclaw-skills-context-cleanup

Repository

openclaw/skills

Skill path: skills/irideas/context-cleanup

Analyze and archive low-value memory notes in OpenClaw workspace to reduce context bloat and improve responsiveness. 适用于上下文冗余、维护整理场景;默认流程为 analyze → plan → confirm → archive,归档优先于删除。

Open repository

Best for

Primary workflow: Ship Full Stack.

Technical facets: Full Stack.

Target audience: everyone.

License: Unknown.

Original source

Catalog source: SkillHub Club.

Repository owner: openclaw.

This is still a mirrored public skill entry. Review the repository before installing into production workflows.

What it helps with

  • Install context-cleanup into Claude Code, Codex CLI, Gemini CLI, or OpenCode workflows
  • Review https://github.com/openclaw/skills before adding context-cleanup to shared team environments
  • Use context-cleanup for development workflows

Works across

Claude CodeCodex CLIGemini CLIOpenCode

Favorites: 0.

Sub-skills: 0.

Aggregator: No.

Original source / Raw SKILL.md

---
name: context-cleanup
description: Analyze and archive low-value memory notes in OpenClaw workspace to reduce context bloat and improve responsiveness. 适用于上下文冗余、维护整理场景;默认流程为 analyze → plan → confirm → archive,归档优先于删除。
user-invocable: true
metadata:
  { "openclaw": { "emoji": "🧹", "requires": { "bins": ["bash"] } }, "version": "0.3", "updatedAt": "2026-03-06 20:47 Asia/Shanghai" }
---

# Context Cleanup

用于整理 workspace 的 memory 日志,降低冗余上下文负担。

## 关键资源

- 脚本:`cleanup.sh`
- 策略:`references/policy.md`

## 标准流程(必须)

1. 分析现状
```bash
./skills/context-cleanup/cleanup.sh analyze
```

2. 生成计划(不执行)
```bash
./skills/context-cleanup/cleanup.sh plan
```

3. 用户确认后执行归档
```bash
./skills/context-cleanup/cleanup.sh archive
```

## 可选参数

```bash
# 指定截止日期(早于该日期的记录可归档)
./skills/context-cleanup/cleanup.sh archive 2026-03-01

# 仅预览,不执行
./skills/context-cleanup/cleanup.sh archive --dry-run

# 非交互执行(需谨慎)
./skills/context-cleanup/cleanup.sh archive --yes

# 机器可读输出
./skills/context-cleanup/cleanup.sh analyze --json
./skills/context-cleanup/cleanup.sh plan --json
```

## 执行规则

- 默认归档,不做永久删除
- 先 `plan` 后 `archive`
- 归档前必须获得用户确认(除非用户明确同意 `--yes`)
- 不处理 `MEMORY.md`、`specs/`、`AGENTS.md`

## 输出模板

```markdown
🧹 上下文清理计划

- Memory 文件:X
- 低价值候选:A
- 归档候选:B

是否按计划执行归档?
```

## 发布前自检

```bash
./skills/context-cleanup/cleanup.sh analyze
./skills/context-cleanup/cleanup.sh plan
./skills/context-cleanup/cleanup.sh archive --dry-run
```


---

## Referenced Files

> The following files are referenced in this skill and included for context.

### references/policy.md

```markdown
# 上下文清理策略

## 安全原则

- 默认动作是“归档”,不是“删除”。
- 必须先执行 `plan`,确认后再 `archive`。
- 默认保留近期记录(7 天窗口,可通过截止日期调整)。
- 脚本不处理 `MEMORY.md`、`AGENTS.md`、`specs/` 文件。

## 清理优先级

1. 低价值测试类日记
2. 截止日期之前的较旧日记

## 推荐执行流程

1. `analyze`
2. `plan`
3. 用户确认
4. `archive`
5. 汇总清理结果与上下文收益

```



---

## Skill Companion Files

> Additional files collected from the skill directory layout.

### _meta.json

```json
{
  "owner": "irideas",
  "slug": "context-cleanup",
  "displayName": "Context Cleanup",
  "latest": {
    "version": "0.3.0",
    "publishedAt": 1772801316007,
    "commit": "https://github.com/openclaw/skills/commit/da89f7283d62e800775304a1c0740e351a66c1eb"
  },
  "history": []
}

```

context-cleanup | SkillHub