ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified

session

Manage session state and lifecycle using JSONL storage. Use when tracking user sessions, expiring stale data, or auditing session activity.

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/bytesagain/session
Or

Session — Session State Management Tool

Manage session state, lifecycle, and metadata using a local JSONL-backed store. Create, read, update, and delete sessions with support for expiration, refresh, bulk cleanup, and export.

Prerequisites

  • Python 3.8+
  • bash shell
  • No external dependencies required

Data Storage

All session data is stored in ~/.session/data.jsonl. Each line is a JSON object representing a session record. The tool auto-creates the directory and file on first use.

Commands

CommandDescriptionUsage
createCreate a new session with optional metadatacreate [--user USER] [--ttl SECONDS] [--meta KEY=VAL ...]
getRetrieve a session by IDget SESSION_ID
setSet or update a key-value pair in a sessionset SESSION_ID KEY VALUE
deleteDelete a session by IDdelete SESSION_ID
listList all sessions, optionally filter by statuslist [--status active|expired] [--user USER] [--limit N]
expireMark a session as expiredexpire SESSION_ID
refreshRefresh a session's TTL / last-access timestamprefresh SESSION_ID [--ttl SECONDS]
statsShow summary statistics for all sessionsstats
exportExport sessions to JSON or CSVexport [--format json|csv] [--output FILE]
cleanupRemove all expired sessions from the storecleanup [--before TIMESTAMP] [--dry-run]
configShow or update tool configurationconfig [KEY] [VALUE]
helpShow usage informationhelp
versionShow version numberversion

Examples

# Create a session for user "alice" with 1-hour TTL
bash scripts/script.sh create --user alice --ttl 3600

# Get session details
bash scripts/script.sh get abc123

# Update session data
bash scripts/script.sh set abc123 theme dark

# List active sessions
bash scripts/script.sh list --status active

# Export all sessions to JSON
bash scripts/script.sh export --format json --output sessions.json

# Clean up expired sessions (dry-run first)
bash scripts/script.sh cleanup --dry-run

# Show statistics
bash scripts/script.sh stats

Metadata

Stars3500
Views0
Updated2026-03-27
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-bytesagain-session": {
      "enabled": true,
      "auto_update": true
    }
  }
}

Tags

#session#state#management#lifecycle#tracking
Safety NoteClawKit audits metadata but not runtime behavior. Use with caution.