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-spice/thinking-preview

v0.1.2

Published

Collapse streaming thinking blocks into a compact live preview; alt+t toggles full text

Readme

@pi-spice/thinking-preview

Collapse streaming thinking blocks into a compact, live-refreshing preview.

pi streams reasoning tokens in full, which can flood the transcript on long thinking turns. This extension turns every thinking block into a compact preview instead:

│ ✻ thinking · 142 lines · alt+t to expand
│ …second-to-last line of the thinking…
│ …last line of the thinking…

The block renders as a blockquote, so it carries pi's │ left bar and quote color — visually distinct from plain thinking text, echoing the framed look of tool-call rows (an exact edit/bash-style background box isn't reachable from a Markdown transformer).

The preview refreshes on every streaming token, so the block doubles as a progress indicator — no flooding, but you always roughly know where the model is.

Install

pi install npm:@pi-spice/thinking-preview

Quick test without installing: pi -e ./extensions/thinking-preview/

How it works

  • Uses a Markdown transformer (pi.registerMarkdownTransformer), which is display-only: the session file and the model context keep the full thinking text, untouched.
  • Preview content is plain text — Markdown syntax characters are escaped and rendered verbatim — and every preview line (status line included) is hard-clipped to the available terminal width minus the │ bar, by plain character count with no per-charset width tables. A line of wide characters (CJK, emoji) can therefore render up to twice the budget and wrap an occasional extra row — accepted jitter in exchange for simplicity.
  • alt+t (or /thinking-preview) toggles all thinking blocks between preview and full text. Expanded mode shows the full text as escaped plain text inside the same │ -framed block, with source line breaks preserved; long lines wrap naturally. Toggling re-renders history immediately and shows a notification. Restart resets to the collapsed preview default.
  • The toggle is global and sticky: once expanded, new thinking blocks render in full until you toggle back.

Interaction with pi's built-in thinking controls

  • ctrl+t (hide thinking blocks) takes precedence: while thinking is hidden, blocks render as a one-line label and this extension has no visible effect on the transcript — though the alt+t notification still fires. Press ctrl+t to make thinking visible again.
  • ctrl+t showing thinking also goes through this extension, so it shows the preview — not full text. Use alt+t for full text.
  • Toggling re-applies the default hidden-thinking label (Thinking...); if you customized that label elsewhere, it will be reset on toggle.

Notes

  • Old thinking blocks pick up a mode change immediately (the toggle forces a re-render), and restored sessions render collapsed previews too.
  • alt+t was chosen because every ctrl+letter combination is bound in pi's default keybindings. If you have alt+t bound to something else, /thinking-preview works as a fallback.