/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:
-
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
-
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
-
Apply Name - Execute
/rename <generated-name>to apply immediately -
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
| Type | Signals |
|---|---|
backend | API, database, model, migration, Django, SQL, endpoint |
frontend | React, Vue, component, CSS, Tailwind, TypeScript, UI |
devops | Docker, Kubernetes, deploy, CI/CD, Terraform, GCloud |
security | Auth, OAuth, JWT, permissions, encryption, RBAC |
testing | Test, spec, pytest, Jest, coverage, mock |
docs | README, documentation, ADR, comments, markdown |
debug | Bug, fix, error, exception, traceback, issue |
refactor | Refactor, cleanup, reorganize, optimize |
feature | Feature, implement, add, create, build |
config | Config, 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.
Related Commands
| Command | Purpose |
|---|---|
/rename | Built-in Claude Code rename (manual) |
/session-names | Query all auto-generated names |
/export | Export session (uses current name) |
Comparison
| Feature | /rename | /session-name-now |
|---|---|---|
| Name source | Manual input | Auto-generated |
| Classification | None | MoE content analysis |
| Database storage | No | Yes (sessions.db (ADR-118 Tier 3)) |
| Format | Any | ISO-datetime-type-theme |
Version: 1.0.0 Created: 2026-01-23 Author: CODITECT Team