Get the FREE Ultimate OpenClaw Setup Guide →

rename

npx machina-cli add skill Pamacea/smite/auto-rename --openclaw
Files (1)
SKILL.md
4.6 KB

Mission

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

  1. Input: Hook trigger (SessionStart, PostToolUse, UserPromptSubmit)
  2. 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
  3. 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: /rename command available for custom names

Name Format

Pattern: Action: Context

Action PrefixUsageExample
FixBug fixesFix: login bug
AddNew featuresAdd: user CRUD API
UpdateModificationsUpdate: database schema
DeleteRemovalsDelete: deprecated code
RefactorRestructuringRefactor: auth system
DebugInvestigationDebug: memory leak
TestTestingTest: payment flow
DocsDocumentationDocs: API README
ConfigConfigurationConfig: 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: /rename for 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-PatternProblemFix
Renaming on every messageAnnoying, spammyMaximum 10 automatic renames per session
Including command artifactsConfusing namesFilters out <command->, <objective>, <process> tags
Generic namesNot usefulUses specific "Action: Context" format
Renaming during skill executionDistractingSkips system-generated messages
Not evolving with sessionOutdated contextUpdates based on conversation progress
Manual override not workingFrustratingAlways 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: /rename for 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

  1. Step 1: Ensure the rename skill is active and hooks (SessionStart, PostToolUse, UserPromptSubmit) are enabled
  2. Step 2: Let the session run or use /rename "custom name" to set a manual name
  3. 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

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers