Auto-rename OpenCode sessions with AI-generated titles after every N messages. Works out of the box with zero config.
Add to opencode.json:
{
"plugin": ["opencode-session-auto-rename"]
}Restart OpenCode. Done.
The plugin works with sensible defaults. To customize, create ~/.config/opencode/session-auto-rename.jsonc:
| Option | Default | Description |
|---|---|---|
interval |
10 |
Rename every N AI responses |
titleMaxLength |
30 |
Max title characters |
dateFormat |
YY-MM-DD |
Timestamp suffix (YYYY/YY/MM/DD/HH/mm) |
model |
opencode/grok-code |
Model for title generation |
debug |
false |
Enable debug logs |
Hooks into chat.message. After every N AI responses, generates a descriptive title from the conversation summary and updates the session. Title format: {title}({date}).
MIT
{ "interval": 5, "titleMaxLength": 25, "dateFormat": "YY-MM-DD", "model": "opencode/grok-code", "debug": false }