// remember

cw (Claude Wrapper)

daily driver

A one-file shell script that gives Claude Code a proper window title and a clean self-restart.

cw is a tiny wrapper you use every day instead of launching Claude Code directly. It sets the terminal window title to the current folder so it's easy to find the right tab, and it supports a self-restart signal; when a Claude session asks to restart itself, cw catches that and brings it right back without losing the working directory.

  • Bash
The neat part is how small it is - less than 60 lines of shell script - yet it solves a real daily annoyance. With multiple Claude sessions open in different folders, the window title "Claude: billing/iolabs [pts/3]" makes it obvious which tab is which at a glance. And the restart loop means that upgrading Claude Code or hopping to a different project directory can be done from inside the session itself, without opening a new terminal.

What it does

Claude Code is a command-line AI assistant; you run it in a terminal window. If you have several projects open at once, all those terminal tabs look the same by default. cw fixes that by writing the current folder name into the window title the moment Claude starts, so "Claude: billing/iolabs [pts/3]" appears in the tab bar and it's immediately clear which session is which. The other thing cw does is handle restarts. When a Claude session decides it needs to restart (maybe to pick up a code change, or to hop to a different directory) it can drop a small instruction file and exit. cw watches for that file, reads the new arguments or working directory from it, and relaunches Claude automatically. No need to open a new terminal or retype anything.

Why it's neat

Window titles that make sense

Every Claude tab shows the parent folder and working directory, so switching between projects takes a glance, not a guess.

Self-restart in one step

A session can restart itself and land in a new folder without you ever opening a second terminal.

Fits in your pocket

The whole thing is one shell script under 60 lines - easy to understand, modify, or carry to a new machine.

How it works

Before starting Claude, cw reads the current directory and writes a human-readable title like "Claude: projects/billing" into the terminal tab.

Claude starts normally; cw watches for a restart-signal file that the session can write before it exits.

If the signal file contains a CWD or LABEL directive, cw changes directory or updates the window label before bringing Claude back up.