Skip to content

jrothman/ptsd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ptsd — Project Terminal Switcher for Claude Code Directories

A shell function that lists your recent Claude Code project directories and lets you jump into one by typing a number.

Usage

$ ptsd

   1) my-app           ~/projects/my-app
   2) another-project   ~/projects/another-project
   3) old-project       ~/projects/old-project

Select project (1-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.

Options

ptsd              # List projects, newest first
ptsd -a           # Sort alphabetically by project name
ptsd -o           # Sort oldest first
ptsd myapp        # Filter by substring (case-insensitive)
ptsd -a myapp     # Combine sort + filter

Installation

zsh (macOS / Linux)

Requirements: jq (brew install jq or apt install jq)

  1. Clone or download ptsd.zsh
  2. Add to your ~/.zshrc:
source "/path/to/ptsd/ptsd.zsh"
  1. Open a new terminal (or source ~/.zshrc)

bash (macOS / Linux / Git Bash / WSL) ⚠️ untested

Requirements: jq (brew install jq, apt install jq, or download from jqlang.github.io)

  1. Clone or download ptsd.bash
  2. Add to your ~/.bashrc:
source "/path/to/ptsd/ptsd.bash"
  1. Open a new terminal (or source ~/.bashrc)

PowerShell (Windows) ⚠️ untested

No external dependencies — uses PowerShell's built-in ConvertFrom-Json.

  1. Clone or download ptsd.ps1
  2. Add to your PowerShell profile ($PROFILE):
. "C:\path\to\ptsd\ptsd.ps1"
  1. Open a new terminal (or . $PROFILE)

If you get an execution policy error, run: Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

How it works

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.

Claude Code Skill

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.

License

MIT

About

Project Terminal Switcher for Claude Code Directories

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors