Install
openclaw skills install tide-watchProactive session capacity monitoring and management for OpenClaw. Prevents context window lockups by warning at configurable thresholds (75%, 85%, 90%, 95%), automatically backing up sessions before resets, and managing session resumption prompts. Use when working on long-running projects, managing multiple conversation channels (Discord, Telegram, webchat), or preventing lost work from full context windows. Includes CLI tools for capacity checks, cross-session dashboards, archive management, and session resumption. Supports any model or provider.
openclaw skills install tide-watchProactive session capacity monitoring for OpenClaw.
Tide Watch is a HYBRID SKILL with two operational modes:
Description: AGENTS.md and HEARTBEAT.md directives only
Code Execution: NONE - Uses OpenClaw's built-in tools only (no CLI installation)
File Access: Reads OpenClaw session files via agent's built-in tools
Installation: Copy template directives to workspace config files
Security: Lowest risk - no code installation or execution required
What it does:
session_status toolDescription: Node.js command-line tools for manual management
Code Execution: YES - Executable JavaScript code
File Access: Direct read/write to ~/.openclaw/agents/main/sessions/
Installation: git clone + npm link (requires Node.js)
Security: Moderate risk - requires code inspection before install
What it does:
tide-watch status, tide-watch dashboard, etc.| Feature | Directives-Only | CLI Tools |
|---|---|---|
| Node.js required? | ❌ No | ✅ Yes (14+) |
| Installation | Copy templates | npm link |
| Code execution | ❌ None | ✅ JavaScript |
| File access | Via built-in tools | Direct filesystem |
| Security risk | Lowest | Moderate |
| Use case | Passive monitoring | Active management |
Choose Directives-Only if: You only need capacity warnings and resumption prompts.
Choose CLI Tools if: You need manual session management, archiving, or dashboard views.
Vulnerability: Shell injection in editResumePrompt function
Affected Version: v1.0.0 ONLY
Current Version: v1.0.1 (PATCHED)
Severity: HIGH (CVSS 7.8)
Status: ✅ FIXED
Summary: v1.0.0 contained a shell injection vulnerability in the CLI's resume-prompt edit command. An attacker who could control the --session parameter could execute arbitrary commands. This has been fixed in v1.0.1 by replacing execSync with spawnSync.
If you installed v1.0.0: Update immediately to v1.0.1.
Full disclosure: See SECURITY-ADVISORY-CVE-2026-001.md
For Directives-Only Mode (Safest):
For CLI Tools Mode (If Needed):
tide-watch --version)lib/capacity.js and lib/resumption.jspackage.json for install hooks (should have none)npm test to verify behavior (113 tests)--session flag~/.openclaw/agents/main/sessions/archive/)Operation Types:
Read-Only Operations (✅ Safe, no modifications):
tide-watch status - Check current session counttide-watch check --session <id> - View specific session capacitytide-watch check --current - Auto-detect and check current session (v1.3.4+)tide-watch dashboard - Visual capacity overviewtide-watch dashboard --watch - Live updating dashboardtide-watch dashboard --raw-size - Show full precision token counts (v1.3.2+)tide-watch report - List sessions above thresholdtide-watch resume-prompt show --session <id> - View resumption promptModifying Operations (⚠️ Moves/creates files):
tide-watch archive --older-than <time> - Moves sessions to archive/ (time-based)tide-watch archive --session <id> - Archive specific session (v1.3.3+)tide-watch archive --session <id1> --session <id2> - Archive multiple sessions (v1.3.3+)tide-watch resume-prompt edit --session <id> - Opens editor (CVE patched in v1.0.1)tide-watch resume-prompt delete --session <id> - Deletes resumption prompt fileNew Flags (v1.3.2+):
--raw-size - Show full precision token counts (e.g., 18,713/128,000 instead of 18.7k/128k)--current - Auto-detect current session via OPENCLAW_SESSION_ID environment variable (v1.3.4+)--session (enhanced) - Supports partial IDs, multiple sessions for archive, labels/channels (v1.3.3+)File System Access:
~/.openclaw/agents/main/sessions/*.jsonl (session data)~/.openclaw/agents/main/sessions/resume-prompts/*.md (resumption prompts)~/.openclaw/agents/main/sessions/archive/ (archived sessions)Network Activity: NONE - All operations are local filesystem only.
Complete flag and option documentation:
Display Options:
--raw-size - Show full precision token counts with commas (v1.3.2+)
18.7k/128k, 20.6k/1M)18,713/128,000, 20,631/1,000,000)tide-watch dashboard --raw-size--json - Output as JSON instead of formatted table
tide-watch check --session abc123 --json--pretty - Pretty-print JSON output (requires --json)
tide-watch report --json --prettySession Selection:
--session <key> - Target specific session (enhanced in v1.3.3+)
--session 17290631-42fe-40c0-bd23-c5da511c6f7b--session 17290631-4 (v1.3.3+)--session "#navi-code-yatta" (v1.3.3+)--session discord (v1.3.3+)--session "discord/#navi-code" (v1.3.3+)--session abc123 --session def456 (v1.3.3+)--current - Auto-detect current session (v1.3.4+)
OPENCLAW_SESSION_ID environment variabletide-watch check --currentFiltering:
--all - Show all sessions regardless of capacity--threshold <num> - Filter sessions above percentage (default: 75)--active <hours> - Only show sessions active within N hours--agent <id> - Filter to specific agent (multi-agent setups)--exclude-agent <id> - Exclude specific agent (can use multiple times)Archive Options:
--older-than <time> - Archive sessions older than time
4d, 2w, 1mo, 3months--session--dry-run - Preview archive without making changes
tide-watch archive --older-than 7d --dry-run--exclude-channel <name> - Exclude channel from archiving
tide-watch archive --older-than 30d --exclude-channel discord--min-capacity <num> - Only archive sessions below capacity threshold
tide-watch archive --older-than 7d --min-capacity 50Live Monitoring:
--watch - Live updating dashboard (refreshes every 10s)
tide-watch dashboard --watchMulti-Agent:
--all-agents - Multi-agent discovery mode (default, auto-discovers agents)--single-agent-only - Single-agent mode (main agent only)Configuration Override:
--refresh-interval <seconds> - Dashboard refresh interval (1-300)--gateway-interval <seconds> - Gateway status check interval (5-600)--gateway-timeout <seconds> - Gateway command timeout (1-30)--session-dir <path> - Custom session directoryUsage Examples:
# Human-readable vs full precision
tide-watch dashboard # 18.7k/128k (easy to scan)
tide-watch dashboard --raw-size # 18,713/128,000 (exact)
# Auto-detect current session (v1.3.4+)
export OPENCLAW_SESSION_ID="17290631-4"
tide-watch check --current # Check THIS session
tide-watch check --current --json # JSON for heartbeat scripts
# Session-specific archiving (v1.3.3+)
tide-watch archive --session abc123 --dry-run # Preview
tide-watch archive --session abc123 # Archive one
tide-watch archive --session a --session b # Archive multiple
# Partial ID matching (v1.3.3+)
tide-watch check --session 17290631-4 # Matches 17290631-42fe-40c0-...
# Multi-agent filtering
tide-watch dashboard --agent kintaro # Kintaro sessions only
tide-watch report --exclude-agent main # All except main
Mode 1 (Directives-Only):
Mode 2 (CLI Tools - Optional):
jest@^30.2.0 (for testing only)tide-watch (installed globally via npm link)git clone + npm linkWhy zero runtime dependencies?
fs, path, child_process)Most users should use Directives-Only Mode. This provides automatic capacity monitoring without installing any code. Only install CLI tools if you specifically need manual capacity management features.
Monitors your OpenClaw session context windows and warns you before they overflow:
Copy the directive template from AGENTS.md.template and add it to your workspace AGENTS.md file:
# From your workspace root (~/clawd or similar)
cat skills/tide-watch/AGENTS.md.template >> AGENTS.md
Or manually add the monitoring section from the template.
This tells me (your agent) what to look for and when to warn you.
Copy the heartbeat template from HEARTBEAT.md.template and add it to your workspace HEARTBEAT.md file:
# From your workspace root (~/clawd or similar)
cat skills/tide-watch/HEARTBEAT.md.template >> HEARTBEAT.md
Or manually add the Tide Watch heartbeat section from the template.
This tells me to check capacity automatically on a schedule.
Default settings work for most users, but you can customize in your AGENTS.md:
Warning thresholds (when to warn):
Check frequency (how often to monitor):
Auto-backup:
Channel-specific overrides (advanced):
Once installed, I will:
Ask me to check session status anytime:
What's my current session capacity?
Check context usage
Run session_status
When warned about high capacity:
Help me reset this session and preserve context
I'll:
If you need to load a previous session state from backup:
Show me available backups for this session
Load session from 90% backup
I'll:
Backup locations:
~/.openclaw/agents/main/sessions/backups/<session-id>-<threshold>-<timestamp>.jsonl[.gz]When you add Tide Watch to your HEARTBEAT.md, I automatically:
Parse your configuration (from AGENTS.md)
Check capacity on schedule (default: every hour)
session_status to get token usage(tokens_used / tokens_max) * 100Compare against your thresholds
Warn you (once per threshold)
Auto-backup (if enabled and triggered)
~/.openclaw/agents/main/sessions/backups/<session-id>-<threshold>-<timestamp>.jsonlSuggest actions
Cleanup old backups
Return to silent mode
HEARTBEAT_OKYou can also ask me to check anytime:
What's my current session capacity?
Check context usage
Run session_status
Problem: Context windows fill up silently. Once at 100%, sessions lock and stop responding. You lose work mid-task.
Solution: Proactive monitoring catches capacity issues early, giving you time to save work, switch channels, or reset cleanly.
Real incident: Discord #navi-code-yatta hit 97% capacity and locked mid-task (2026-02-23). Had to manually reset, losing conversation context.
Warning thresholds: 60%, 70%, 80%, 90%
Check frequency: Every 30 minutes
Warning thresholds: 85%, 92%, 96%, 98%
Check frequency: Every 2 hours
Discord channels: 75%, 85%, 90%, 95% (default)
Webchat: 85%, 95% (lighter warnings)
DM: 90%, 95% (minimal warnings)
session_status tool supportAGENTS.md fileMIT