A shell function that lists your recent Claude Code project directories and lets you switch to one by typing a number.
$ ptsd
0) help menu
1) my-app ~/projects/my-app
2) another-project ~/projects/another-project
3) old-project ~/projects/old-project
Select project (0-3): 2
→ /Users/you/projects/another-project
Launch Claude here? (Y/n):
Project names are shown in bold with paths dimmed beside them. If only one project matches, it's auto-selected.
ptsd # List projects, newest first
ptsd -a # Sort alphabetically by project name (--alpha)
ptsd -o # Sort oldest first (--oldest)
ptsd -f # cd to parent folder instead of project dir (--folder)
ptsd myapp # Filter by substring (case-insensitive)
ptsd -a myapp # Combine sort + filter
ptsd -n # Create a new project folder (--new)
ptsd -n myapp # Create a new project folder named "myapp"
Requirements: jq (brew install jq or apt install jq)
- Clone or download
ptsd.zsh - Add to your
~/.zshrc:
source "/path/to/ptsd/ptsd.zsh"- Open a new terminal (or
source ~/.zshrc)
Requirements: jq (brew install jq, apt install jq, or download from jqlang.github.io)
- Clone or download
ptsd.bash - Add to your
~/.bashrc:
source "/path/to/ptsd/ptsd.bash"- Open a new terminal (or
source ~/.bashrc)
No external dependencies — uses PowerShell's built-in ConvertFrom-Json.
- Clone or download
ptsd.ps1 - Add to your PowerShell profile (
$PROFILE):
. "C:\path\to\ptsd\ptsd.ps1"- Open a new terminal (or
. $PROFILE)
If you get an execution policy error, run:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Claude Code stores session data in ~/.claude/projects/. Each project directory contains JSONL files with the working directory (cwd) of each session. ptsd reads these, deduplicates by path, sorts by most recently used, and presents a numbered list.
You can also use ptsd as a Claude Code slash command. Copy ptsd.md to ~/.claude/commands/ptsd.md and use /ptsd inside any Claude Code session.
MIT
