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...
---
name: auto-rename-session-label
slug: auto-rename-session-label
displayName: Auto Rename Session Label
version: 1.0.0
description: "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."
metadata:
homepage: https://github.com/openclaw/openclaw
license: MIT
allowed-tools: "read,write,edit,exec"
---
# 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:
```bash
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):
```bash
openclaw hooks enable auto-rename-session-label
```
4. Restart or reload the gateway so the hook loads, then verify:
```bash
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
```bash
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.
don't have the plugin yet? install it then click "run inline in claude" again.