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

pi-cc-vscode-ext

v0.1.0

Published

Pi extension that exposes VS Code editor context through Claude Code's local IDE bridge.

Readme

Pi VS Code Context Bridge

This extension reuses the existing Claude Code VSCode extension to co-opt it's TUI context injection functionality to automatically pull your selected VS Code context into Pi, so terminal sessions can see the active file, cursor, and highlighted code from your editor.

Features

  • Registers a vscode_context tool that the model can call for the current VS Code editor context.
  • Adds a /vscode command for viewing bridge status, refreshing state, and toggling automatic context injection for the current session.
  • Shows a compact footer status for disconnected, active-file, and selected-line states.
  • Automatically injects changed VS Code context before an agent turn, while deduplicating unchanged context by fingerprint.
  • Keeps Claude Code IDE bridge authorization tokens local and out of tool, prompt, and status output.

Requirements

  • Pi with package extension support.
  • Node.js >=22.18.
  • VS Code connected through Claude Code's IDE integration.

This extension depends on Claude Code's local IDE bridge lock files under ~/.claude/ide/*.lock. If no Claude Code IDE bridge is active, the extension reports a disconnected state and does not inject editor context automatically.

Installation

Install the package with Pi:

pi install npm:pi-cc-vscode-ext

You can also install directly from a Git checkout or run the extension during local development:

pi install ./
pi -e ./extensions/claude-ide-vscode.ts

Pi loads the extension through the package manifest:

{
  "pi": {
    "extensions": ["./extensions/claude-ide-vscode.ts"],
    "image": "https://raw.githubusercontent.com/JoeHelbing/pi-cc-vscode-ext/main/images/vscode-context-injection-example.png"
  }
}

Usage

Start Pi from a workspace that is also open in VS Code through Claude Code. When VS Code context is available, Pi automatically injects changed editor context before each agent turn.

Use the tool from the model when explicit editor context is useful:

Use vscode_context to inspect my current VS Code selection.

Use the slash command for interactive control:

/vscode

The command shows the current bridge status and includes actions to refresh, reset automatic injection state, or toggle automatic injection for the session.

Screenshots

How it works

Claude Code's VS Code integration writes local lock files under ~/.claude/ide/*.lock. Each lock records the local WebSocket port, process id, workspace folders, IDE metadata, and an authorization token.

This extension:

  1. Reads Claude Code IDE lock files from the local machine.
  2. Prefers live locks whose workspace contains Pi's current working directory.
  3. Connects to ws://127.0.0.1:<port> with the lock token.
  4. Calls Claude Code's MCP-style getLatestSelection IDE tool.
  5. Normalizes the active file path, cursor or selection range, selected text, and status summary for Pi.

Authorization tokens are used only for the local WebSocket request. They are not returned by vscode_context, inserted into model context, printed in status text, or written by this package.

Package contents

The npm package includes:

  • extensions/claude-ide-vscode.ts - the Pi extension and bridge logic.
  • images/vscode-context-injection-example.png - package/gallery preview image.
  • images/vscode-command-menu-and-footer.png - command menu and footer screenshot.
  • images/claude-code-vscode-bridge.png - Claude Code bridge screenshot.
  • README.md - package documentation.
  • LICENSE - Apache 2.0 license text.
  • package.json - package metadata and Pi manifest.

Limitations

  • Claude Code's local IDE bridge and lock-file format are not public Pi APIs and may change.
  • The bridge only works when Claude Code's VS Code integration is running on the same machine as Pi.
  • Selected text may be truncated before prompt injection to avoid oversized context.

Development

Run the syntax check:

npm run check

Preview the npm package contents:

npm pack --dry-run

License

Apache-2.0