session
Manage session state and lifecycle using JSONL storage. Use when tracking user sessions, expiring stale data, or auditing session activity.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/bytesagain/sessionSession — 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+
bashshell- 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
| Command | Description | Usage |
|---|---|---|
| create | Create a new session with optional metadata | create [--user USER] [--ttl SECONDS] [--meta KEY=VAL ...] |
| get | Retrieve a session by ID | get SESSION_ID |
| set | Set or update a key-value pair in a session | set SESSION_ID KEY VALUE |
| delete | Delete a session by ID | delete SESSION_ID |
| list | List all sessions, optionally filter by status | list [--status active|expired] [--user USER] [--limit N] |
| expire | Mark a session as expired | expire SESSION_ID |
| refresh | Refresh a session's TTL / last-access timestamp | refresh SESSION_ID [--ttl SECONDS] |
| stats | Show summary statistics for all sessions | stats |
| export | Export sessions to JSON or CSV | export [--format json|csv] [--output FILE] |
| cleanup | Remove all expired sessions from the store | cleanup [--before TIMESTAMP] [--dry-run] |
| config | Show or update tool configuration | config [KEY] [VALUE] |
| help | Show usage information | help |
| version | Show version number | version |
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
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 skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-bytesagain-session": {
"enabled": true,
"auto_update": true
}
}
}Tags
Related Skills
decision-ledger
从纪要、聊天或项目材料中提取决策、负责人、截止时间、前提假设与撤销条件。;use for decision, meeting, governance workflows;do not use for 编造不存在的决策, 替代法律审计.
candidate-tracker
候选人追踪系统。触发场景:用户要求管理候选人池,记录状态、设置提醒、生成标签。
feishu-repair
自动修复飞书-自动修复飞书群聊+自动修复会话 - 诊断 Gateway 连接、权限配置、消息投递问题
unified-self-improving
统一自我进化系统,整合 self-improving-agent、self-improving、mulch 三个技能的优势,提供结构化日志、三层存储、自动升级、模式检测、命名空间隔离和 token 高效的 JSONL 格式支持。
agent-lifecycle-protocol
Lifecycle management for autonomous AI agents — birth, forking, succession, migration, retirement. Maintain agent genealogy with reputation inheritance across versions. Identity continuity when agents evolve. Part of the Agent Trust Stack.