← Back to Skills Marketplace
323
Downloads
0
Stars
1
Active Installs
1
Versions
Install in OpenClaw
/install session-hygiene
Description
Prevent sessions.json bloat from accumulating isolated sessions (hooks, crons, subagents). Sets up a cron to archive stale sessions to daily JSONL files and...
Usage Guidance
This skill appears to do what it says, but take normal precautions before running it: (1) run with --dry-run first to preview actions; (2) back up sessions.json (or run the script against a copy) before writing to it; (3) ensure the cron runs as the same user that owns sessions.json so auto-detection succeeds and there are no permission issues; (4) if your sessions.json is located outside the auto-detected paths, provide --sessions-path explicitly; (5) be aware the script loads sessions.json into memory (very large files could use significant RAM); and (6) inspect the archive files and test on a non-production instance if possible. These are operational cautions, not indicators of malicious behavior.
Capability Analysis
Type: OpenClaw Skill
Name: session-hygiene
Version: 1.0.0
The skill's purpose is to manage OpenClaw session files, preventing bloat by archiving old sessions and rotating archive files. The `SKILL.md` instructs the agent to set up a cron job that executes a Python script located within the skill's directory. The `archive_sessions.py` script performs file system operations (read, write, delete) on `sessions.json` and a dedicated `sessions-archive` directory. It does not access unrelated sensitive data, make network calls, execute arbitrary external commands, or exhibit any other behavior indicative of malicious intent or significant unstated risks.
Capability Assessment
Purpose & Capability
Name/description match the contents: the SKILL.md explains cron setup and the included Python script archives stale sessions and rotates old archives. There are no unrelated requirements (no external credentials, no unrelated binaries).
Instruction Scope
Runtime instructions are scoped to locating sessions.json, writing per-day JSONL archives into sessions-archive, deleting old archives, and updating sessions.json. The SKILL.md does not ask the agent to read or transmit unrelated files or secrets. It instructs running the included script via a cron payload or manually; that's consistent.
Install Mechanism
No install spec or external downloads. The skill is instruction-only plus a small local Python script; nothing is fetched from remote URLs and no archives are extracted.
Credentials
No environment variables, credentials, or config paths are requested. The script auto-detects common sessions.json locations under the user's home directory (or accepts an explicit --sessions-path). This access is proportional to the stated task.
Persistence & Privilege
Does not request always:true, does not modify other skills or system-wide agent settings. It writes only to the sessions directory (sessions.json and sessions-archive) which is the minimal required privilege for its function.
How to Use
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install session-hygiene - After installation, invoke the skill by name or use
/session-hygiene - Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release: archive-and-rotate pattern for sessions.json bloat (openclaw/openclaw#15225)
Metadata
Frequently Asked Questions
What is Session Hygiene?
Prevent sessions.json bloat from accumulating isolated sessions (hooks, crons, subagents). Sets up a cron to archive stale sessions to daily JSONL files and... It is an AI Agent Skill for Claude Code / OpenClaw, with 323 downloads so far.
How do I install Session Hygiene?
Run "/install session-hygiene" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Session Hygiene free?
Yes, Session Hygiene is completely free (open-source). You can download, install and use it at no cost.
Which platforms does Session Hygiene support?
Session Hygiene is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Session Hygiene?
It is built and maintained by halbotley (@halbotley); the current version is v1.0.0.
More Skills