terminal-title
npx skills add https://github.com/2389-research/claude-plugins --skill terminal-title
Agent 安装分布
Skill 文档
Terminal Title Management
Overview
This skill updates the terminal window title to show current context:
- Work/fun emoji (from
$TERMINAL_TITLE_EMOJIenvironment variable) - Project name (intelligently detected by Claude)
- Current topic (what you’re working on)
Format: ð¼ ProjectName - Topic
CRITICAL: When to Invoke
MANDATORY invocations:
- Session start: Automatically triggered by SessionStart hook. Claude must respond by setting title to “Claude Code” as default topic.
- Topic changes: Claude MUST detect and invoke when user shifts to new topic.
Topic change patterns (Claude must detect these):
- â “let’s talk about X” / “can you tell me about Y” â invoke immediately
- â User switches domains: debugging â documentation, frontend â backend, feature â tests
- â User starts working on different module/component after sustained discussion
- â User asks about completely unrelated topic after 3+ exchanges on current topic
- â Follow-up questions on same topic (“add a comment to that function”) â do NOT invoke
- â Small refinements to current work (“make it blue”) â do NOT invoke
- â Clarifications about current task â do NOT invoke
Claude’s responsibility: Actively monitor conversation flow and invoke this skill whenever topic materially shifts. Do not wait for explicit permission.
Example titles:
ð¼ Skills Repository - Terminal Titleð dotfiles - zsh configð¼ OneOnOne - Firebase Config
Setup Requirements
Required Permission:
This skill runs scripts to update the terminal title. To prevent Claude from prompting for permission every time, add this to your ~/.claude/settings.json:
For Unix/Linux/macOS:
{
"permissions": {
"allow": [
"Bash(bash *skills/scripts/set_title.sh:*)"
]
}
}
For Windows:
{
"permissions": {
"allow": [
"Bash(pwsh *skills/scripts/set_title.ps1:*)"
]
}
}
Why this permission is needed: The skill executes a script that sends terminal escape sequences silently in the background to update your window title without interrupting your workflow.
Cross-platform support: The plugin includes both bash scripts (.sh) for Unix-like systems and PowerShell scripts (.ps1) for Windows. The SessionStart hook automatically detects your OS and uses the appropriate script.
Project Detection Strategy
Primary method: Claude’s intelligence
Claude analyzes the current context to determine the project name:
- Current working directory and recent conversation
- Files read during the session
- Git repository information
- Package metadata (package.json, README.md, etc.)
- Overall understanding of what the project represents
Key principle: Use intelligent understanding, not just mechanical file parsing.
Detection examples:
/Users/dylanr/work/2389/skillsâ “Skills Repository” (not just “skills”)/Users/dylanr/work/2389/oneonone/hostingâ “OneOnOne”/Users/dylanr/dotfilesâ “dotfiles”/Users/dylanr/projects/my-appâ “My App” (humanized from directory)
Supporting evidence Claude checks:
- Git remote URL or repository directory name
package.jsonname field (Node.js projects)- First heading in README.md
- Directory basename (last resort)
Fallback: If Claude cannot determine context, use current directory name.
Always include project name – Claude can always determine something meaningful.
Title Formatting
Standard format:
$emoji ProjectName - Topic
Component details:
1. Emoji (from environment):
- Read from
$TERMINAL_TITLE_EMOJIenvironment variable - Set by zsh theme based on directory context
- Common values: ð¼ (work), ð (fun/personal)
- Fallback: Use ð if variable not set
2. Project Name (from Claude’s detection):
- Human-friendly name, not slug format
- Proper capitalization (e.g., “OneOnOne” not “oneonone”)
- Always present (use directory name as minimum)
3. Topic (from invocation context):
- Short description of current work (2-4 words)
- Provided when skill is invoked
- Examples: “Terminal Title”, “Firebase Config”, “CSS Refactor”
Script usage:
bash scripts/set_title.sh "ProjectName" "Topic"
Note: The script automatically reads emoji from environment and handles terminal escape sequences.
Edge cases:
- No
$TERMINAL_TITLE_EMOJI: Use ð as default - Very long project/topic: Let terminal handle truncation naturally
- Empty topic: Use “Claude Code” as default
Workflow
When Claude detects a topic change (or session start), immediately invoke this workflow:
Follow these steps to update the terminal title:
Step 1: Determine project name
Use Claude’s understanding of the current codebase and context to determine the project name. Check:
- What you know about this project from conversation and files
- Git repository name/remote URL
- package.json name field (if Node.js project)
- README.md first heading
- Directory basename (minimum fallback)
Generate a human-friendly name (e.g., “Skills Repository” not “skills”).
Step 2: Get topic from context
The topic should come from:
- Invocation parameter (if provided explicitly)
- Current conversation context (what user is working on)
- Default to “Claude Code” for session start
Step 3: Detect operating system
Before executing the script, detect the operating system:
# Check if running on Windows (check for common Windows indicators)
if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "win32" || "$OSTYPE" == "cygwin" ]]; then
OS="windows"
else
OS="unix"
fi
Step 4: Execute title update script (cross-platform)
Find the skill base directory (available in the skill loading message) and execute the appropriate script based on OS:
For Unix/Linux/macOS:
bash <skill-base-dir>/scripts/set_title.sh "Project Name" "Topic"
For Windows:
pwsh -NoProfile -ExecutionPolicy Bypass -File <skill-base-dir>/scripts/set_title.ps1 "Project Name" "Topic"
The scripts handle:
- Reading emoji from
$TERMINAL_TITLE_EMOJI(Unix) or$env:TERMINAL_TITLE_EMOJI(Windows) - Sanitizing inputs
- Formatting and sending terminal escape sequences
Execute this command silently using the Bash tool (pre-approved via permissions).
Step 5: Done
Title updated silently. Continue responding to user without mentioning the title update unless they ask about it.
Examples
Example 1: Session Start in Skills Repository
Context: User starts Claude Code in /Users/dylanr/work/2389/skills
Environment: TERMINAL_TITLE_EMOJI=ð¼
Execution:
- Project: “Skills Repository” (Claude’s knowledge)
- Topic: “Claude Code” (session start default)
- Command:
bash /Users/dylanr/work/2389/claude-plugins/terminal-title/skills/scripts/set_title.sh "Skills Repository" "Claude Code"
Result: Terminal title shows ð¼ Skills Repository - Claude Code (script reads emoji from environment)
Example 2: Topic Change Detection
Context: Conversation shifts from “terminal title implementation” to “rare VWs”
Claude’s detection: User asked “can you tell me about rare vws?” – this is a clear topic shift
Environment: TERMINAL_TITLE_EMOJI=ð
Claude’s action:
- Detect topic change (from terminal implementation to VWs)
- Invoke terminal-title skill workflow
- Project: “Home” (current directory basename)
- Topic: “Rare VWs” (from new conversation direction)
- Command:
bash <skill-base-dir>/scripts/set_title.sh "Home" "Rare VWs" - Continue answering user’s question about rare VWs
Result: Terminal title silently updates to ð Home - Rare VWs (script reads emoji from environment)
Example 3: Personal Project Without Environment Variable
Context: User working in ~/projects/dotfiles directory
Environment: TERMINAL_TITLE_EMOJI not set
Execution:
- Project: “dotfiles” (from directory)
- Topic: “zsh config” (from conversation)
- Command:
bash <skill-base-dir>/scripts/set_title.sh "dotfiles" "zsh config"
Result: Terminal title shows ð dotfiles - zsh config (script uses ð as fallback when TERMINAL_TITLE_EMOJI not set)
Example 4: Different Project Context
Context: User working in /Users/dylanr/work/2389/oneonone/hosting
Environment: TERMINAL_TITLE_EMOJI=ð¼
Execution:
- Project: “OneOnOne” (Claude knows this project name)
- Topic: “Firebase Config” (from conversation)
- Command:
bash <skill-base-dir>/scripts/set_title.sh "OneOnOne" "Firebase Config"
Result: Terminal title shows ð¼ OneOnOne - Firebase Config (script reads emoji from environment)
Example 5: Windows User Session Start
Context: Windows user starts Claude Code in C:\Users\Nat\projects\my-app
Environment: $env:TERMINAL_TITLE_EMOJI=ð» (Windows environment variable)
OS Detection: Claude detects Windows via $OSTYPE check
Execution:
- Project: “My App” (from directory name, humanized)
- Topic: “Claude Code” (session start default)
- Command:
pwsh -NoProfile -ExecutionPolicy Bypass -File <skill-base-dir>/scripts/set_title.ps1 "My App" "Claude Code"
Result: Terminal title shows ð» My App - Claude Code (PowerShell script reads emoji from $env:TERMINAL_TITLE_EMOJI)
Note: The SessionStart hook automatically detected Windows and invoked the PowerShell version of the script instead of the bash version.