rename
npx machina-cli add skill Pamacea/smite/auto-rename --openclawMission
Automatically rename Claude Code sessions with intelligent, context-aware names generated by AI analysis.
When to Use
- Automatic: Runs automatically on hooks (no manual invocation needed)
- Manual override: Use
/rename "custom name"for specific names - After session start: Automatically sets initial name
- After significant work: Automatically updates name based on context
Examples
# Automatic (runs on hooks)
# No action needed - runs automatically
# Manual override
/rename "Build JWT authentication system"
# Auto-generated examples
"Fix: login bug"
"Add: user CRUD API"
"Refactor: auth system"
"Debug: memory leak"
When NOT to Use
- ❌ During command/skill invocations (automatically skipped)
- ❌ For system-generated messages (filtered out automatically)
- ❌ When session name is already perfect (max renames limit prevents spam)
Core Workflow
- Input: Hook trigger (SessionStart, PostToolUse, UserPromptSubmit)
- Process:
- Skip command/skill invocations (system-generated messages)
- Analyze session context (first real user message, recent tools, project)
- Generate concise name following "Action: Context" format
- Update session .jsonl file with system message
- Output: Session renamed and visible in history/resume
Key Principles
- Automatic operation: Runs in background without manual intervention
- Intelligent naming: LLM analysis understands session context
- Command artifact filtering: Skips <command->, <objective>, <process> tags from skills
- Dynamic updates: Name evolves as session progresses
- Manual override:
/renamecommand available for custom names
Name Format
Pattern: Action: Context
| Action Prefix | Usage | Example |
|---|---|---|
| Fix | Bug fixes | Fix: login bug |
| Add | New features | Add: user CRUD API |
| Update | Modifications | Update: database schema |
| Delete | Removals | Delete: deprecated code |
| Refactor | Restructuring | Refactor: auth system |
| Debug | Investigation | Debug: memory leak |
| Test | Testing | Test: payment flow |
| Docs | Documentation | Docs: API README |
| Config | Configuration | Config: env variables |
Integration
- SessionStart hook: Analyzes first message, sets initial name
- PostToolUse hook: Renames after Write/Bash/git operations
- UserPromptSubmit hook: Updates based on conversation evolution
- Manual command:
/renamefor custom or auto-generated names - Storage: System messages in .jsonl session files
Configuration
- maxSessionNameLength: 50 characters (default)
- maxRenamesPerSession: 10 automatic renames (default)
- renameTriggers: Control which hooks activate (sessionStart, postToolUse, userPromptSubmit)
- Config file:
config/settings.json
Error Handling
- Insufficient content: Falls back to "Working on code"
- LLM failure: Generic name, retry on next trigger
- Network issues: Graceful degradation to defaults
- File permissions: Report error, skip rename
- Max renames reached: Stop automatic renaming, manual still available
Anti-Patterns
| Anti-Pattern | Problem | Fix |
|---|---|---|
| Renaming on every message | Annoying, spammy | Maximum 10 automatic renames per session |
| Including command artifacts | Confusing names | Filters out <command->, <objective>, <process> tags |
| Generic names | Not useful | Uses specific "Action: Context" format |
| Renaming during skill execution | Distracting | Skips system-generated messages |
| Not evolving with session | Outdated context | Updates based on conversation progress |
| Manual override not working | Frustrating | Always allows manual /rename command |
Integration
- SessionStart hook: Analyzes first message, sets initial name
- PostToolUse hook: Renames after Write/Bash/git operations
- UserPromptSubmit hook: Updates based on conversation evolution
- Manual command:
/renamefor custom or auto-generated names - Storage: System messages in .jsonl session files
Auto-generated from plugin.json - Last sync: 2025-01-22
Note: Previously named auto-rename-session, now auto-rename
Source
git clone https://github.com/Pamacea/smite/blob/main/plugins/essentials/skills/auto-rename/SKILL.mdView on GitHub Overview
Automatically rename Claude Code sessions using AI analysis. It runs on SessionStart, PostToolUse, and UserPromptSubmit to generate concise, context-aware names in the Action: Context format (e.g., Fix: login bug). Names evolve as the session progresses, with a manual override via /rename and storage in session .jsonl files.
How This Skill Works
On each trigger, it analyzes the session context—first real user message, recent tools, and the project. It filters out system-generated messages and command artifacts, then generates a concise name following the Action: Context pattern. It updates the session .jsonl with a system message and supports dynamic renames up to the configured limit.
When to Use It
- Automatic initial naming after SessionStart
- Automatic updates after significant work
- Manual override using /rename "custom name"
- PostToolUse events (Write/Bash/git) rename after operations
- When you need a name that reflects current context while respecting the max renames limit
Quick Start
- Step 1: Ensure the rename skill is active and hooks (SessionStart, PostToolUse, UserPromptSubmit) are enabled
- Step 2: Let the session run or use /rename "custom name" to set a manual name
- Step 3: Check the session history/.jsonl to verify the renamed session
Best Practices
- Keep names concise and context-specific using the Action: Context format
- Set maxSessionNameLength to 50 and maxRenamesPerSession to 10 by default
- Ensure command artifacts are filtered from names
- Rely on Manual override for explicit naming
- Monitor session history to verify .jsonl updates
Example Use Cases
- Fix: login bug
- Add: user CRUD API
- Refactor: auth system
- Debug: memory leak
- Update: database schema