Session Context Compressor

ReviewAudited by ClawScan on May 10, 2026.

Overview

The skill’s purpose is coherent, but it rewrites OpenClaw session history and stores an automatically generated summary as a system message, which can influence future agent behavior.

Before installing, understand that this skill changes OpenClaw session files, not just temporary text. Use dry-run first, keep backups, inspect compressed summaries, and avoid unattended compression for important sessions.

Findings (3)

Artifact-based informational review of SKILL.md, metadata, install specs, static scan signals, and capability signals. ClawScan does not execute the skill or run runtime probes.

What this means

After compression, the agent may rely on a lossy or manipulated summary as if it were authoritative session context.

Why it was flagged

The script summarizes prior conversation content and persists it as a system-role message. Because the summarized material can include old user, assistant, system, and tool content, this can elevate inaccurate or untrusted text into future high-priority context.

Skill content
compacted_message = { "role": "system", "content": f"[CONTEXT COMPACTED - Previous {len(to_summarize)} messages summarized]\n\n{compacted_content}", "_compacted": True
Recommendation

Run compression only after user approval, inspect the generated summary before continuing important work, and consider storing the compacted summary in a less-authoritative role or clearly marking summarized prior content as untrusted context.

What this means

If run on the wrong session or without reviewing the output, detailed conversation history may be lost or reduced to an imperfect summary.

Why it was flagged

The script intentionally renames the original session to a .backup file and rewrites the selected session file. This is central to compression, but it mutates active local agent state.

Skill content
os.rename(filepath, backup_path)
...
with open(filepath, 'w', encoding='utf-8') as f:
Recommendation

Use --dry-run first, verify the target session path, keep an extra backup for important sessions, and avoid automatic --apply runs unless you are comfortable with the context loss.

What this means

Installing dependencies may download code or data from external package sources that are not pinned in the artifact.

Why it was flagged

The skill relies on unpinned package and NLTK data downloads during setup. That is expected for NLP summarization, but it introduces normal package-supply-chain trust considerations.

Skill content
install: |
  pip install sumy
  python3 -c "import nltk; nltk.download('punkt_tab'); nltk.download('stopwords')"
Recommendation

Install in a virtual environment, pin and review dependency versions where possible, and use trusted package indexes.