AI Agent Hub
Back to skills
Subagent Archive icon

Subagent Archive

AI Agent Updated 2026.08.30

Paste the following prompt into your AI chat to install this skill:

Please follow https://skillhub.cn/install/skillhub.md to install @user_15292d5a/yjkj-subagent-archive.

About this skill

Problem

When OpenClaw runs many subagent sessions, cron jobs, and dashboard sessions, raw .jsonl files, trajectory artifacts, and sessions.json entries keep accumulating. Deleting them directly can damage :main, active tasks, or existing archive records, while ordinary cleanup may miss .trajectory.jsonl, .deleted variants, and stale index entries.

Workflow

The skill turns cleanup into a controlled workflow: identify session type and status; protect :main, active :cron:*, and non-done :dashboard:* entries; extract important context; append archive records under the memory directory instead of overwriting them; remove session files grouped by sessionId.*; and reconcile sessions.json by reverse matching missing indexes. With OpenClaw 6.1 it can integrate --fix-missing, --active-key, and --fix-dm-scope, while older versions can fall back using -NoFixMissing.

Boundaries

It fits completed subagent sessions, idle subagents, and finished dashboard parent sessions. It is not intended for running tasks or bypassing archive steps. Verify dry-run results first, and explicitly set -WorkspaceDir in multi-workspace setups to avoid cleaning the wrong directory.

Use Cases

  • After OpenClaw subtasks finish, archive completed subagent sessions and remove leftover .jsonl and trajectory files.
  • During low-disk-space maintenance, batch-archive finished dashboard parent sessions while protecting :main and active :cron:* tasks.
  • After upgrading to OpenClaw 6.1, repair stale sessions.json entries using --fix-missing plus reverse index matching.
  • In PowerShell on Windows, macOS, or Linux, verify with dry-run before safely archiving idle subagent sessions.

Best For

  • Engineers maintaining OpenClaw workspaces who need safe subagent cleanup without touching :main or active tasks.
  • Agent ops engineers running multi-agent pipelines who need completed subagent sessions archived before disk growth becomes a problem.
  • Product automation teams using dashboard spawn sessions who need only status=done parents archived with append-only records.
  • Cross-platform script maintainers deploying to Windows, macOS, or Linux who need one PowerShell flow to detect workspaces and avoid deletions.