Created
April 14, 2026 13:30
-
-
Save J-Swift/67a6d91251a15fee8ddba7ce5b183a45 to your computer and use it in GitHub Desktop.
Show all open claude code sessions with CWD
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| anyclaude () | |
| { | |
| ps -eo user,pid,tty,start,command | grep --color=auto -i claude | grep --color=auto -v grep | grep --color=auto -v Claude.app | grep --color=auto -v Zed | while read -r line; do | |
| pid=$(echo "$line" | awk '{print $2}'); | |
| cwd=$(lsof -d cwd -a -p "$pid" -Fn 2> /dev/null | awk '/^n/{print substr($0,2)}'); | |
| printf '%s [%s]\n' "$line" "${cwd:-?}"; | |
| done | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment