Skip to main content

/session-name-now - Mid-Session Smart Naming

Generate a descriptive session name based on current conversation content using MoE classification, then apply it immediately via /rename.

System Prompt

EXECUTION DIRECTIVE: When the user invokes this command:

  1. Analyze Current Session - Review the conversation so far to identify:

    • Primary content type (backend, frontend, security, testing, docs, etc.)
    • Key theme (what specific task/feature is being worked on)
    • Important files/functions mentioned
  2. Generate Name - Create a name in format:

    YYYY-MM-DDTHH:MM-<content-type>-<theme>

    Where:

    • YYYY-MM-DDTHH:MM = Current ISO datetime
    • <content-type> = Classified type (backend, frontend, security, etc.)
    • <theme> = 2-4 word description of the work
  3. Apply Name - Execute /rename <generated-name> to apply immediately

  4. Store in Database - Record the name in sessions.db (ADR-118 Tier 3) for future reference

Usage

/session-name-now           # Generate and apply name
/snn # Alias
/name-session # Alias
/session-name-now --preview # Show name without applying

Content Type Detection

TypeSignals
backendAPI, database, model, migration, Django, SQL, endpoint
frontendReact, Vue, component, CSS, Tailwind, TypeScript, UI
devopsDocker, Kubernetes, deploy, CI/CD, Terraform, GCloud
securityAuth, OAuth, JWT, permissions, encryption, RBAC
testingTest, spec, pytest, Jest, coverage, mock
docsREADME, documentation, ADR, comments, markdown
debugBug, fix, error, exception, traceback, issue
refactorRefactor, cleanup, reorganize, optimize
featureFeature, implement, add, create, build
configConfig, settings, env, setup, initialize

Example

Before:

Session: 8a3f2c1d-... (unnamed)

User: /session-name-now

Claude analyzes conversation:

  • Detected: OAuth2 authentication implementation
  • Files: auth/views.py, auth/models.py
  • Keywords: JWT, token, refresh, authenticate

Generated name:

2026-01-23T14:30-security-oauth2-jwt-auth

After:

Session: 2026-01-23T14:30-security-oauth2-jwt-auth

Algorithm

def generate_mid_session_name():
# 1. Collect signals from current conversation
messages = get_current_session_messages()

# 2. MoE Classification (multi-analyst voting)
content_type = classify_content_type(messages) # backend, frontend, etc.

# 3. Theme extraction
theme = extract_theme(messages) # oauth2-jwt-auth

# 4. Compose name
iso_datetime = datetime.now().strftime('%Y-%m-%dT%H:%M')
name = f"{iso_datetime}-{content_type}-{theme}"

# 5. Apply via /rename
execute_rename(name)

# 6. Store in database
store_session_name(session_id, name, content_type, theme)

return name

When to Use

  • After clarifying the task - Once you know what you're building
  • Before a long implementation - Name it before diving deep
  • When switching contexts - If the session evolves to a new focus
  • Before /export - Ensure meaningful name is captured

Success Output

✅ Session renamed: 2026-01-23T14:30-security-oauth2-jwt-auth

Classification:
Type: security (confidence: 92%)
Theme: oauth2-jwt-auth
Signals: OAuth, JWT, authenticate, token, auth/views.py

Stored in sessions.db (ADR-118 Tier 3) for future reference.
CommandPurpose
/renameBuilt-in Claude Code rename (manual)
/session-namesQuery all auto-generated names
/exportExport session (uses current name)

Comparison

Feature/rename/session-name-now
Name sourceManual inputAuto-generated
ClassificationNoneMoE content analysis
Database storageNoYes (sessions.db (ADR-118 Tier 3))
FormatAnyISO-datetime-type-theme

Version: 1.0.0 Created: 2026-01-23 Author: CODITECT Team