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

agent-session-kill

v0.2.0

Published

NPKILL-style cleanup for Claude, Pi, OMP, and GitHub Copilot Chat agent session remnants.

Readme

Agent Session Kill

NPKILL-style cleanup for AI coding-agent session remnants.

agent-session-kill scans local Claude Code, Pi/pi-mono, Oh My Pi (OMP), GitHub Copilot Chat, and subagent temp storage, then lets you review and delete stale session artifacts from an interactive terminal UI.

Why

Agent harnesses save transcripts, tool outputs, task state, shell snapshots, logs, temp subagent runs, and per-project session files. Those files are useful while work is active, but they pile up.

Agent Session Kill gives you a single cleanup surface with conservative defaults:

  • interactive picker by default, inspired by npkill
  • dry-run and JSON modes for scripts
  • protected paths for auth, settings, plugins, skills, memory, and model config
  • cache cleanup is opt-in
  • trash-first deletion by default
  • explicit confirmation before interactive deletion

Install

npm install -g agent-session-kill

Or run without installing:

npx agent-session-kill

Commands

# Interactive picker (default)
agent-session-kill
agentkill                                           # short alias

# Limit to specific tools
agent-session-kill --tool copilot                   # Copilot Chat only
agent-session-kill --tool claude,omp                # multiple tools

# Orphan detection — OMP sessions for deleted projects trashed regardless of age
agent-session-kill --workspace ~/workspace

# Include cache files as cleanup candidates
agent-session-kill --include-cache

# Non-interactive inventory
agent-session-kill scan                             # table output
agent-session-kill scan --json                      # machine-readable
agent-session-kill scan --tool copilot --json       # scoped to one tool
agent-session-kill scan --older-than 7d             # tighter age threshold

# Dry-run manifest (print what would be deleted)
agent-session-kill clean --dry-run
agent-session-kill clean --dry-run --include-cache  # include cache in preview

# Apply cleanup
agent-session-kill clean --apply                    # trash (recoverable)
agent-session-kill clean --apply --permanent        # permanent delete

# Delegate cleanup to native tools (claude project purge, omp worktree clear)
agent-session-kill clean --dry-run --delegates

Interactive controls

| Key | Action | | --- | --- | | / k | Move up | | / j | Move down | | PgUp / Ctrl+u | Page up | | PgDn / Ctrl+d | Page down | | Home / End | Jump to first/last row | | Space | Toggle current selectable row | | a | Toggle all selectable visible rows | | d / Del | Delete selected rows after confirmation | | r | Rescan | | q / Esc | Quit without changes |

Rows that are protected or kept are visible but not selectable.

Options

| Option | Description | Default | | --- | --- | --- | | --older-than <duration> | Minimum age for stale artifacts. Supports m, h, d. | 14d | | --tool <name> | Limit to claude, pi, omp, temp, or copilot. Repeat or comma-separate. | all | | --include-cache | Include cache roots as cleanup candidates. | off | | --json | Print JSON. Always non-interactive. | off | | --delegates | Run delegated dry-runs (claude project purge, omp worktree clear). | off | | --home <path> | Home directory to scan. | current user home | | --temp <path> | Temp directory to scan. | OS temp dir | | --workspace <path> | Workspace directory; OMP sessions for projects no longer on disk are flagged as orphaned and trashed regardless of age (scans 2 levels deep). | off | | --dry-run | Force dry-run mode. | off | | --apply | Apply cleanup in clean mode. | off | | --permanent | Permanently delete instead of trashing. | off |

What it scans

Claude Code

  • ~/.claude/session-env/
  • ~/.claude/tasks/
  • ~/.claude/plans/
  • ~/.claude/debug/
  • ~/.claude/paste-cache/
  • ~/.claude/shell-snapshots/
  • ~/.claude/backups/
  • ~/.claude/cache/ only when --include-cache is set

Claude project transcripts under ~/.claude/projects/ are protected from direct deletion. Use --delegates to preview the official claude project purge path.

Pi / pi-mono

  • ~/.pi/agent/sessions/
  • ~/.pi/agent/tmp/
  • ~/.pi/session-search/index/
  • ~/.pi/agent/cache/ only when --include-cache is set

OMP / Oh My Pi

  • ~/.omp/agent/sessions/
  • ~/.omp/agent/terminal-sessions/
  • ~/.omp/logs/
  • ~/.omp/agent/blobs/
  • ~/.omp/agent/cache/ only when --include-cache is set
  • ~/.omp/cache/ only when --include-cache is set

OMP worktrees are handled through omp worktree clear --dry-run when delegates are enabled.

GitHub Copilot Chat (VS Code)

  • ask-agent/, plan-agent/, explore-agent/, logContextRecordings/, memory-tool/
  • copilot.cli.oldGlobalSessions.json
  • copilot.cli.workspaceSessions.*.json
  • commandEmbeddings.json, settingEmbeddings.json, toolEmbeddingsCache.bin, copilot-cli-images/ only when --include-cache is set

macOS path: ~/Library/Application Support/Code/User/globalStorage/github.copilot-chat Linux path: ~/.config/Code/User/globalStorage/github.copilot-chat

Subagent temp runs

  • <temp>/pi-subagents-*/chain-runs/
  • <temp>/pi-subagents-*/async-subagent-runs/

Protected paths

Agent Session Kill never deletes known auth, settings, plugin, skill, memory, model, or MCP configuration paths, even when broad options are used.

Examples:

  • ~/.claude.json
  • ~/.claude/settings.json
  • ~/.claude/plugins/
  • ~/.claude/skills/
  • ~/.claude/agents/
  • ~/.claude/commands/
  • ~/.claude/projects/
  • ~/.pi/agent/auth.json
  • ~/.pi/agent/settings.json
  • ~/.pi/agent/models.json
  • ~/.pi/agent/mcp*.json
  • ~/.pi/agent/npm/
  • ~/.omp/agent/config.yml
  • ~/.omp/agent/managed-skills/
  • ~/.omp/agent/memories/
  • ~/.../github.copilot-chat/api.json
  • ~/.../github.copilot-chat/mcpServers.json
  • ~/.../github.copilot-chat/debugCommand

Safety model

  • Interactive mode requires a TTY.
  • Script output uses scan, clean --dry-run, or --json.
  • clean is dry-run unless --apply is present.
  • --dry-run overrides --apply if both are supplied.
  • Cache cleanup requires --include-cache.
  • Permanent deletion requires --permanent.
  • Interactive deletion requires typing delete after selected paths are printed.

Development

npm install
npm test

Run local smoke checks:

node src/cli.js scan --tool claude
node src/cli.js clean --dry-run --tool claude
node src/cli.js scan --json --tool claude

License

MIT