Memory

Rename Session

Try it

Rename or auto-generate a friendly label for an OpenClaw-style session by editing sessions.json directly. Supports random labels (zh/en with locale auto-dete...

What it does

Rename or auto-generate a friendly label for an OpenClaw-style session by editing sessions.json directly. Supports random labels (zh/en with locale auto-detect), multi-agent auto-detection, listing sessions, retry with verification, and XDG-compliant history storage. 适用场景:在 OpenClaw / 任何兼容的 session 管理体系中给会话起名/改名/换花名/重命名 session/给会话加 label。

The skill document

rename-session

Minimal, zero-dependency tool to rename a session label in //sessions/sessions.json (OpenClaw-style layout).

Quick start

# List all sessions under the only agent under ~/.openclaw/agents/
python3 scripts/rename_session.py --list

# Rename a session with a literal label
python3 scripts/rename_session.py agent:main:main "My new session name" --agent main

# Auto-generate a random label (auto-detects language from $LANG)
python3 scripts/rename_session.py agent:main:main --random --agent-name Ashley

# Force Chinese label
python3 scripts/rename_session.py agent:main:main --random --lang zh --agent-name Ashley

# Force English label
python3 scripts/rename_session.py agent:main:main --random --lang en --agent-name Ashley

CLI

FlagDescriptionDefault
session_keySession key, e.g. agent:main:mainrequired (unless --list)
new_labelNew literal labelrequired unless --random
--randomAuto-generate a random labelfalse
--listList all session keys under the agent and exitfalse
--lang zh|enLanguage for --random vocabularyauto-detect from $LC_ALL/$LC_MESSAGES/$LANG, fall back to en
--agent-name Agent display name used in random labelAshley
--agent Agent ID. Auto-detected when only one existsauto
--root Agents root$RENAME_SESSION_ROOT or ~/.openclaw/agents

Configuration via environment

Env varPurposeDefault
RENAME_SESSION_ROOTOverride agents root~/.openclaw/agents
XDG_DATA_HOMEWhere history is stored~/.local/share

History file: $XDG_DATA_HOME/rename-session/history.json (keeps last 10 labels to avoid immediate repeats when using --random).

Random label format

Example outputs:

  • zh: 春光明媚Ashley🌸元气满满💻
  • en: March Breeze Ashley🌸 Energized💻

70% of the time the scene is month-aware (e.g. March produces spring words).

Exit codes

CodeMeaning
0Success (rename verified or list completed)
1Failure (3 retries exhausted, missing session, or file errors)
2Bad CLI arguments

Failure reasons

OutputExplanation
sessions.json not found at ...Agent does not exist or has no sessions yet
session key '...' not foundThe specified session key does not exist
File permission issuesCannot write to sessions.json
Disk is full or read-onlyFilesystem write blocked
Another process is continuously modifying sessions.jsonConcurrent writers; retry later

Notes

  • Changes take effect immediately in the file; refresh the session list in your client to see the new label.
  • Multi-agent: when more than one agent is detected under the root, --agent is required.
  • All randomized output uses standard Python random (no external deps).

See references/TESTING.md for the test plan.

Related skills

Installs an OpenClaw internal hook that auto-titles each new chat session using the session's current model (on message:received), with a safe fallback to tr...

1 installs

Archive and organize completed OpenClaw session logs into structured markdown notes for long-term memory retention. Use when wrapping up a long session, consolidating work logs, or preparing daily memory files for review.

Structured end-of-session protocol for OpenClaw agents. Produces a complete, consistent journal entry at session close — summary, full file surface (read/written/external APIs), one self-caught failure delta, one behavioral fingerprint. Also runs pattern-update for any tracked behavioral patterns that fired this session. Use when a session ends, a task completes, or the user says 'log this,' 'log the session,' 'close out,' or 'write the journal.'

Structured session lifecycle for Claude Code — start, checkpoint, end, and daily heartbeat commands that maintain project state across conversations.

1 installs

Claude Code & Antigravity session management. Topics — id (lookup UUID), list (enumerate), search (keyword validate), import, summarize, analyze (stats), archive (flat bak), classify, clean-profanity (sanitize JSONL), split (boundaries), compress (MCP), context (usage measurement pull/push), destroy, dual-sync (Win/WSL memory), install (hook), memory-trim (budget trim), migrate (to worktree), move (update cwd), purge (dead sessions), rename (custom title), repair (chain/tool_result/UUID), rewind (context truncate), url (web URL). Use when: "session id", "current session", "session list", "list sessions", "session search", "find session", "session classify", "session compress", "session migrate", "session move", "session repair", "session rename", "session split", "session purge", "session rewind", "session analyze", "session import", "session summarize", "session archive", "archive session", "clean profanity", "session cleanup", "memory trim", "dual sync", "measure context", "context u

by es6kr