···69697070pty restart myserver # restart an exited session
7171pty kill myserver # terminate a session
7272+7373+pty wrap claude # auto-wrap claude in pty sessions
7474+pty unwrap claude # remove the wrapper
7575+pty wrap --list # show wrapped commands
7676+```
7777+7878+### Wrapping Commands
7979+8080+`pty wrap` creates a small shell script that shadows a command so it always runs in a pty session:
8181+8282+```sh
8383+pty wrap claude
8484+# Now running "claude" anywhere automatically gets a persistent session
8585+```
8686+8787+The wrapper uses `pty run -a` (create or attach if already running), so running the command twice in the same directory reattaches instead of creating a duplicate.
8888+8989+Wrappers live in `~/.local/pty/bin/`. Add it to the front of your PATH:
9090+9191+```sh
9292+export PATH="$HOME/.local/pty/bin:$PATH"
7293```
73947495Detach with `Ctrl+\`. (Press `Ctrl+\` twice to send it through to the process.)