Allow hooks to set the terminal window title

Status Fixed / completed
Maintainer reply None cached
Activity 3 comments · opened Mar 10, 2026 · closed Mar 10, 2026

Problem

There's no way for hooks (or Claude Code itself) to set the terminal window title. This would be useful for showing a stable, human-readable summary of what the current session is about — e.g. Claude: Terminal title hook for claude-docker.

Why hooks can't do this today

Hooks run in sandboxed subprocesses without access to /dev/tty. The standard approach of writing \033]0;title\007 to the terminal doesn't work because:

  • stdout goes to Claude's context
  • stderr gets logged
  • /dev/tty isn't available

A sidecar process watching a file is possible but overly complex for what should be simple.

Proposal

Either:

  1. A hook output field like "terminalTitle": "some string" that Claude Code applies to the terminal, or
  2. A built-in feature where Claude Code automatically sets the terminal title to a short summary of the current task (ideally AI-generated, not just the raw prompt text)

Option 2 seems like the better UX — Claude already knows what it's working on and could produce a clean one-liner summary without any user configuration.

🤖 Generated with Claude Code

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗