claude-code-plugin-terminal-title #
Claude Code hook that sets the terminal tab title to reflect current activity.
What it shows #
Tool titles use lifecycle verbs:
present-tense wording during PreToolUse,
past-tense wording after PostToolUse.
Examples:
Bash:✳ Running git statuswhile running,✳ Ran git statusafter completion.Read:✳ Reading src/index.tswhile running,✳ Read src/index.tsafter completion.Edit:✳ Editing src/config.tswhile running,✳ Edited src/config.tsafter completion.Write:✳ Writing dist/output.tswhile running,✳ Wrote dist/output.tsafter completion.Grep:✳ Searching for TODOwhile running,✳ Searched for TODOafter completion.Glob:✳ Finding *.tswhile running,✳ Found *.tsafter completion.Agent:✳ Running agent find endpointswhile running,✳ Finished agent find endpointsafter completion.WebSearch:✳ Searching web for react hookswhile running,✳ Searched web for react hooksafter completion.WebFetch:✳ Fetching example.comwhile running,✳ Fetched example.comafter completion.AskUserQuestion:✳ Asking: Which library?while running,✳ Asked: Which library?after completion.TaskList:✳ Listing taskswhile running,✳ Listed tasksafter completion.- Unknown and MCP tools:
✳ Running mcp__weatherwhile running,✳ Ran mcp__weatherafter completion.
Session and lifecycle examples #
PermissionRequest:✳ Requesting permission: BashPostToolUseFailure:✳ Failed tool: BashSessionStart:✳ Started session: startupSessionEnd:✳ Ended sessionInstructionsLoaded:✳ Loaded instructions: CLAUDE.mdUserPromptSubmit:✳ Received prompt: Fix the auth bugStop:✳ Stopped agentSubagentStart:✳ Starting subagent: ExploreSubagentStop:✳ Finished subagent: ExploreTeammateIdle:✳ Marked idle: reviewerTaskCompleted:✳ Completed task: Fix login bugNotification:✳ Notified: Permission grantedConfigChange:✳ Updated config: project_settingsWorktreeRemove:✳ Removed worktreePreCompact:✳ Compacting: auto
Terminal compatibility #
Works with any terminal that supports OSC 0 title sequences: Ptyxis, Konsole, Wezterm, Ghostty, iTerm2, kitty, and others.
How it works #
The hook receives JSON on stdin from Claude Code,
extracts a descriptive summary based on the event and its input,
replaces OSC-breaking controls with visible tokens,
byte-caps the final title payload below Ghostty's 256-byte UTF-8 title reject threshold,
and writes \x1b]0;title\x07 directly to /dev/tty.
Hooks run outside the sandbox,
so /dev/tty is accessible.
Setup #
Install the package to your workspace root,
which makes the cctt bin available.
Then add the hook to .claude/settings.local.json:
// .claude/settings.local.json
{
"hooks": {
"SessionStart": [{ "type": "command", "command": "cctt" }],
"InstructionsLoaded": [{ "type": "command", "command": "cctt" }],
"UserPromptSubmit": [{ "type": "command", "command": "cctt" }],
"PreToolUse": [{ "type": "command", "command": "cctt" }],
"PermissionRequest": [{ "type": "command", "command": "cctt" }],
"PostToolUse": [{ "type": "command", "command": "cctt" }],
"PostToolUseFailure": [{ "type": "command", "command": "cctt" }],
"Notification": [{ "type": "command", "command": "cctt" }],
"SubagentStart": [{ "type": "command", "command": "cctt" }],
"SubagentStop": [{ "type": "command", "command": "cctt" }],
"Stop": [{ "type": "command", "command": "cctt" }],
"TeammateIdle": [{ "type": "command", "command": "cctt" }],
"TaskCompleted": [{ "type": "command", "command": "cctt" }],
"ConfigChange": [{ "type": "command", "command": "cctt" }],
"WorktreeRemove": [{ "type": "command", "command": "cctt" }],
"PreCompact": [{ "type": "command", "command": "cctt" }],
"SessionEnd": [{ "type": "command", "command": "cctt" }]
}
}
Leave WorktreeCreate unregistered.
A command hook on that event replaces Claude Code's worktree creation and must print the new worktree's path;
cctt only sets a title,
so registering it there makes every worktree-isolated subagent fail to start.
Evidence:
doc/troubleshooting/claude-code-worktree-create-hook-no-path.md.