Auto Rename Session Label

Other

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 truncating the first message. Triggers: install auto rename session label, auto title sessions, auto-name chats, session auto rename.

Install

openclaw skills install @woohahahaaa/auto-rename-session-label

Auto Rename Session Label (OpenClaw hook installer)

Triggers (highest priority): install auto rename session label, auto title sessions, auto-name chats, session auto rename. See / hear any → run the install workflow below.

This skill installs an OpenClaw internal hook named auto-rename-session-label. Once installed and enabled, every time a message arrives for a session that has no title yet, the hook generates a short title using the same model that session is currently using, and writes it as the session label. On any failure it falls back to truncating the first user message, so a label is always set.

The hook is portable — it contains no hardcoded paths and no personal data; it resolves OpenClaw home, agent id, and the OpenClaw dist directory at runtime.

What's in this package

auto-rename-session-label/
├── SKILL.md            # this file (SkillHub/ClawHub entry)
├── README.md
├── LICENSE
└── hook/
    ├── HOOK.md         # the hook's own metadata + docs
    └── handler.ts      # the hook implementation (portable)

hook/ is a ready-to-drop OpenClaw internal hook directory.

Install workflow

  1. Resolve the OpenClaw home dir: OPENCLAW_HOME if set, else ~/.openclaw.

  2. Copy the bundled hook/ directory into the managed hooks dir:

    OPENCLAW_HOME="${OPENCLAW_HOME:-$HOME/.openclaw}"
    SKILL_DIR="<absolute path to this skill directory>"
    mkdir -p "$OPENCLAW_HOME/hooks/auto-rename-session-label"
    cp "$SKILL_DIR/hook/HOOK.md" "$SKILL_DIR/hook/handler.ts" \
       "$OPENCLAW_HOME/hooks/auto-rename-session-label/"
    

    Resolve <SKILL_DIR> to where this SKILL.md actually lives (the parent of this file). Do not guess an absolute path.

  3. Enable the hook (this is the required step; hooks.internal.entries.* is a protected config path and cannot be set via gateway config.patch — use the CLI):

    openclaw hooks enable auto-rename-session-label
    
  4. Restart or reload the gateway so the hook loads, then verify:

    openclaw hooks list        # auto-rename-session-label should show ✓ ready
    openclaw hooks info auto-rename-session-label
    

Verify it works

Start a fresh session and send one message. After the reply, that session's entry in ~/.openclaw/agents/<agentId>/sessions/sessions.json should have a short label generated by the model (not a truncated copy of your message).

If the label is always a truncated copy of your first message, the LLM branch is failing and falling back. Check openclaw hooks info auto-rename-session-label and the gateway logs; the most common cause is a too-small maxTokens for proxied models (this hook already uses 1024 to avoid that).

Uninstall

openclaw hooks disable auto-rename-session-label
rm -rf "${OPENCLAW_HOME:-$HOME/.openclaw}/hooks/auto-rename-session-label"

Notes

  • This hook is an operator-managed side effect (it writes the session label). It does not modify prompts, tools, or message flow.
  • See hook/HOOK.md for full implementation detail.