npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@nragone/claude-pilot

v0.7.0

Published

Browse your Claude Code sessions and resume one in the right directory

Readme

claude-pilot

Browse your Claude Code sessions across every project and resume one in the directory where it started, in any terminal.

Why

Claude Code ties each session to the directory you launched it from. If you work across several repos, or start sessions from different subdirectories of one big project, getting back to a session means remembering where you started it, cd-ing there and finding it in claude --resume. Close your terminals or restart your laptop and you're back to digging.

pilot shows every session in one place, folder by folder like a file browser, or as a flat list you can filter. Pick one and it resumes in the right directory. With tmux installed, sessions open in tabs of a workspace that keeps running when you close the terminal, and a single key brings up the browser over any of them.

 pilot   workspace · 23 sessions · 2 open
──────────────────────────────────────────────────────────────────────────────
 tree   ~/projects · 23
──────────────────────────────────────────────────────────────────────────────
    AGE   NAME                                        SESSIONS BRANCH
❯   12m   api/  ● Auth rewrite                               9
    2h    web/  Marketing site redesign                      6
    1d    infra/  Terraform state migration                  5
    4d    ● Release checklist for v2                           main
    15d   Date parsing bug in reports                          fix/tz

──────────────────────────────────────────────────────────────────────────────
 ⏎ open • o background tab • x close tab • r rename • n new • / filter • : command • …

Folders show how many sessions they hold (including subfolders) and their most recent one; ● marks sessions open in a tab, ○ sessions running in another terminal, and ◌ background jobs Claude runs on its own. Forks are listed under the session they came from (└ ⑂), and a family moves up together when any of it was used recently. Sessions are placed by their directory (where they started, or where Claude's /cd moved them), wherever that is: under your home, /opt, /tmp or anywhere else.

Requirements

  • Node.js >= 22.12
  • Claude Code (the claude command on your PATH)
  • tmux (optional, recommended): tabs and the persistent workspace. Without it, pilot resumes sessions in the current terminal. Works in any terminal emulator, locally or over SSH; on Windows, use WSL.

Install

npm install -g @nragone/claude-pilot
npx @nragone/claude-pilot             # or try it without installing

This puts two identical commands on your PATH, pilot and claude-pilot (use claude-pilot if another tool already owns pilot).

From source

git clone https://github.com/nragone/claude-pilot.git
cd claude-pilot
./install.sh

install.sh:

  1. checks that Node is >= 22.12,
  2. runs npm install and npm run build, which builds dist/,
  3. runs npm link, which puts the pilot and claude-pilot commands on your PATH,
  4. warns if claude isn't on your PATH and tells you how to install tmux if it's missing.

Check it works

pilot --version
pilot recent

Install tmux if you don't have it:

brew install tmux        # macOS
sudo apt install tmux    # Debian/Ubuntu (dnf / pacman on other distros)

Update: npm install -g @nragone/claude-pilot@latest (from source: git pull && ./install.sh). If a workspace is already open, the next pilot (or the pilot key) restarts its browser on the new build by itself; your Claude tabs keep running.

Uninstall:

tmux -L pilot kill-server              # only if a workspace is running: closes its Claude tabs (pilot-<profile> for others)
npm uninstall -g @nragone/claude-pilot  # also removes the link made by install.sh
rm -rf ~/.local/state/claude-pilot     # pending titles and the session cache, every profile (or $XDG_STATE_HOME/claude-pilot)

Usage

pilot                  # browse sessions and resume them (opens the workspace if tmux is installed)
pilot -p api           # only sessions whose directory path contains "api"
pilot -a               # include sessions older than 30 days
pilot -d 7             # only the last 7 days
pilot list             # print sessions as a tree grouped by directory (-r resume commands, -f forks only)
pilot recent           # print the 10 most recent sessions (-n for more)
pilot --print          # print the cd + resume command instead of launching (used by `pilot init`)

pilot and claude-pilot are the same command. -p, -a and -d work with the browser, list and recent.

The browser

The browser works like k9s: a header with context, the current view's title, a table, a line for messages, and at the bottom the keys you can use right now. While browsing, letters are commands; to type, enter a mode first (/ filter, : command, r rename, n new session). Arrows only, no vim keys.

| Key | Action | |---|---| | ↑ ↓ | Move | | Enter | Open a folder, or open the selected session (see Workspace for where) | | → | Open a folder, or the selected session's details (see below) | | ←, Backspace | Back to the parent folder | | o | Open the session in a background tab, to open several in a row (needs tmux) | | x | Close the session's tab (sessions marked ● are open). On a session without a tab: delete it, after asking (y/n) | | r | Rename the session. Enter saves, Esc cancels | | n | New Claude session. Asks for its directory, prefilled with the selected session's or folder's (edit it, Tab completes folders), then an optional name. It starts where Enter would open a session (see Workspace) | | / | Filter by title, path or git branch (everything below the current folder, or the whole view). Enter keeps the filter, Esc clears it | | : | Command: :tree, :list, :open, :filter <text>, :new [dir], :delete, :help, :quit, and :detach in the workspace. Tab completes | | Tab | Next view: folder tree, flat list of every session, and (with tmux) sessions open right now | | Esc | Clear the filter (in the popup, with no filter: close it). It never goes back: that's ← or Backspace | | ? | All keys and commands | | q, Ctrl-C | Quit pilot. In the workspace this closes every session tab, so it asks first (y/n) when any is open | | d | Detach from the workspace: everything keeps running, and the next pilot brings it back |

The details screen (→ on a session) shows what the session is before you open it: its id, directory, branch, when it started and was last active, whether it's running, the model and Claude Code version, size, lines changed and what it would have cost if billed by the API (Claude Code's own /cost totals, saved when Claude exits: none until a session first closes, and up to its last exit while it runs again), forks and the session it was continued in; then its first prompt, Claude's own recap of where it left off, your last prompt and the latest messages (only what you and Claude wrote: no tool calls or output). ↑↓ scroll it, ← (or Backspace, Esc) goes back, and Enter, o, x and r work on that session as in the list. It reads only the start and the end of the transcript, so a huge session opens as fast as a small one.

Deleting removes the session for good: its transcript and everything Claude keeps for it (subagent transcripts, file history, its environment and task folders). It always asks first, and refuses while the session is running, in a tab or in another terminal (close it first). Forks of a deleted session stay. Your prompt history (~/.claude/history.jsonl, shared by every session) isn't touched.

The browser keeps itself up to date while it's open: sessions started, renamed or deleted elsewhere, and Claude processes starting or exiting, show up as they happen. It watches Claude's files instead of polling, so it costs nothing while nothing changes.

Renaming writes the title the same way Claude's /rename does, so it shows up in claude --resume too. A session that's open in a tab is renamed in its tab right away, and its title is saved to the session once the tab closes (a running Claude would otherwise overwrite it). The same goes for a session running in another terminal: its title is saved once it stops.

pilot also sees Claude sessions you started outside it (in another terminal, another tmux, over SSH on the same machine), from the process list Claude Code keeps in ~/.claude/sessions/. They're marked ○, and Enter or o on one asks before resuming it, since two copies of a session would write the same history. Background jobs Claude Code runs by itself, with no terminal, are marked ◌ and ask the same way.

A tab follows the session its Claude is running: if you /resume another session or /clear inside a tab, the ● moves to the new session, and Enter on it goes to that tab.

A new session's name is passed to claude --name, so Claude and the tab use the same title; with no name, Claude titles it as usual and the tab is named after the folder. pilot gives the session its id up front (claude --session-id), so its tab is marked open right away. It shows up in the browser's list as soon as Claude writes its first message. pilot also opens with no sessions at all, so n can start the first one.

Workspace

Where a session opens depends on where you run pilot:

| You run pilot… | Enter | o | q | |---|---|---|---| | in a terminal, with tmux installed | opens it in a new workspace tab and switches to it | opens it in a background tab | quits pilot and closes its tabs (d detaches instead) | | inside your own tmux | resumes it in the current pane | opens it in a new window of your tmux session | quits the browser | | without tmux | resumes it in this terminal | – (see PILOT_TERMINAL) | quits the browser |

The workspace is a tmux session of its own, on a separate pilot socket, so it never touches your tmux setup (it does load your ~/.tmux.conf). The browser lives in the first tab and each Claude session gets its own tab named after it. A session that's already open is marked with ●, and Enter takes you to its tab instead of resuming it twice.

Inside the workspace every key goes to Claude (the workspace has no tmux prefix, so Claude's own Ctrl+B keeps working) except three: Shift+← and Shift+→ move to the previous and next tab (wrapping around, the browser tab included), and the pilot key, F12, opens the browser as a popup over any Claude tab:

| In the popup | Action | |---|---| | Enter | Go to the session's tab (opening it if needed) and close the popup | | n | Start a new session in a new tab and close the popup | | o, x, r | Open in the background, close (or delete), rename; the popup stays open | | Esc | Close the popup | | d | Detach from the workspace | | q, Ctrl-C | Quit pilot: close every tab and end the workspace (asks first) | | :home | Go to the browser tab (the workspace's first tab) |

The popup starts on the sessions that are open, so jumping to a tab by name is F12, ↓, Enter. Everything else (filter, : commands, Tab between views) works as in the browser.

On Mac keyboards F12 is the volume key unless you hold fn (press fn+F12), or turn on System Settings → Keyboard → Use F1, F2, etc. keys as standard function keys. To use another key, set PILOT_KEY (any tmux key name, e.g. export PILOT_KEY=C-]), and PILOT_PREV_KEY / PILOT_NEXT_KEY for the tab keys (e.g. M-Left / M-Right for Alt+arrows); running pilot again applies them to a workspace that's already open.

Several Claude configs (e.g. personal and work subscriptions)

If you switch Claude Code configs with CLAUDE_CONFIG_DIR (for example with direnv, an .envrc in your work folder with export CLAUDE_CONFIG_DIR="$HOME/.claude-work"), pilot works with the config of the terminal you run it from, and each config gets a workspace of its own:

~/projects/foo  $ pilot   # workspace "pilot", sessions in ~/.claude
~/projects/work $ pilot   # workspace "pilot · work", sessions in ~/.claude-work

Both can run at once, in two terminals. Each shows only its config's sessions (and ●, ○, ◌ for them), and keeps its own state. Sessions always open with the config they're stored in, whatever folder they're in and whatever your shell sets there. The name comes from the folder: ~/.claude-work is "work"; a config outside your home folder also gets a short hash.

The workspace also applies the tmux settings Claude Code recommends (extended keys, passthrough), so Shift+Enter inserts a newline and notifications reach your terminal.

Close the terminal or detach, and the next pilot brings everything back exactly as it was. After a reboot the workspace is gone, but pilot lists the sessions so you can reopen them.

Configuration

All optional, as environment variables:

| Variable | Default | Effect | |---|---|---| | PILOT_KEY | F12 | Key that opens the browser popup inside the workspace (tmux key name) | | PILOT_PREV_KEY, PILOT_NEXT_KEY | S-Left, S-Right | Keys that move to the previous / next tab inside the workspace (tmux key names) | | PILOT_WORKSPACE | – | 0: never start the workspace; resume in the current terminal | | PILOT_TERMINAL | – | Command o runs outside tmux to open a session elsewhere. {dir} is replaced by the session directory and {cmd} by the shell command that resumes it, both quoted. Example: alacritty --working-directory {dir} -e sh -c {cmd} | | CLAUDE_CONFIG_DIR | ~/.claude | Where Claude Code keeps its config and sessions. pilot works with this one, with a workspace and state per config (see Several Claude configs) | | XDG_STATE_HOME | ~/.local/state | Where pilot keeps its state: pending titles and a cache of what it read from each session, so it only reads what changed (claude-pilot/, other configs in claude-pilot/profiles/<name>/; safe to delete) | | PILOT_SOCKET | pilot, or pilot-<profile> | tmux socket name of the workspace (for development: run a test workspace next to your real one) |

Keeping the directory after you exit Claude

pilot launches Claude in the session's directory, but when you quit Claude your shell is still wherever you ran pilot. If you'd rather your shell move there too, add this to your ~/.zshrc or ~/.bashrc:

eval "$(claude-pilot init)"

That defines a pilot shell function which cds first and then resumes in the current terminal.

How it works

Claude Code stores each session as a JSONL file under ~/.claude/projects/. pilot reads those files to get each session's title, directory, git branch and fork parent. The only thing it ever writes to them is a title when you rename a session, the same entry /rename appends; the only thing it removes is a session you delete.

Claude Code deletes sessions inactive for longer than its cleanupPeriodDays setting (30 days by default), which is also pilot's default window. To keep more history, raise it in ~/.claude/settings.json (e.g. "cleanupPeriodDays": 365) and use pilot -a.

Troubleshooting

  • pilot: command not found after installing: npm's global bin directory isn't on your PATH. Add export PATH="$(npm prefix -g)/bin:$PATH" to your shell profile.
  • npm link fails with a permission error: don't use sudo; point npm at a user-owned prefix: npm config set prefix ~/.npm-global, add ~/.npm-global/bin to your PATH and run ./install.sh again.
  • permission denied running pilot after building by hand: build with npm run build, not bare tsc (it restores the executable bit on dist/cli.js).
  • F12 does nothing: on a Mac press fn+F12 (see above). Run pilot once from a plain terminal so the workspace reloads its config.
  • A session isn't listed: it may be older than 30 days (pilot -a), already deleted by Claude's cleanup, or stored under another CLAUDE_CONFIG_DIR.

Development

npm install            # dependencies
npm run dev -- list    # run from source with tsx (any command or flag after --)
npm run build          # compile to dist/ (needed before running dist/cli.js or the linked pilot)
npm run lint           # type-check
npm test               # vitest

After ./install.sh, the global pilot points at this clone, so npm run build is enough to try changes. To try the workspace without touching your real one, use a separate socket: PILOT_SOCKET=pilot-test pilot, and clean up with tmux -L pilot-test kill-server. Architecture and conventions are in AGENTS.md.

License

MIT