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-halter

v0.0.1

Published

Session-budget extension for AI coding agents.

Downloads

126

Readme

agent-halter

A session-budget extension for AI coding agents. Set a wall-clock time, a turn count, or both. The agent gets a soft nudge as the budget approaches and stops responding for the current turn when it runs out. Budget state survives reload.

Today this ships as a pi-coding-agent extension. A Claude Code adapter is planned next; see FUTURE-CLAUDE.md.

Status

v0.0.1: Core logic is fully tested (100% coverage) and has been tested against a few pi sessions. It's also worth noting that some models might simply ignore the "time to wrap up nudges" sent by the extension, something I'm still investigating.

Installation

Option 1: from npm (recommended)

pi install npm:agent-halter

This installs the latest published version from npm. Run pi update to get new versions.

Option 2: from git

pi install git:github.com/fgrehm/agent-halter

This clones the repo to ~/.pi/agent/git/ and adds it to your settings.

For project-local install (stored in .pi/git/):

pi install git:github.com/fgrehm/agent-halter --local

Option 3: -e flag (try without installing)

pi -e npm:agent-halter

Option 4: Clone manually (if you want to make changes and "try it live")

Pi auto-discovers subdirectories under ~/.pi/agent/extensions/:

git clone [email protected]:fgrehm/agent-halter.git ~/.pi/agent/extensions/agent-halter

Usage (pi)

# from inside a pi session
/timebox 15m                            # 15-minute budget
/timebox turns:5                        # 5-turn budget
/timebox 15m turns:3                    # combined; whichever fires first wins
/timebox 15m -- lmk -m "Timebox done"   # also run a shell command on hard stop
/timebox status                         # show remaining budget
/timebox off                            # disable

Anything after -- is the literal command. It runs detached via /bin/sh -c, so quoting, pipes, and env vars work as in your shell. It fires once on hard stop (not on the soft nudge or on /timebox off). lmk is a good fit since it pops a blocking desktop dialog. For tests / CI you can neutralize lmk with LMK_DRY_RUN=1.

While active, a status-bar entry under the timebox key updates every second:

Timebox: 12m 34s left (15m budget) | 3 turns left (2/5)

At 80% of either dimension the user gets a one-shot warning notification, and every subsequent agent turn has a budget-warning block appended to the system prompt. At 100%, the next agent turn is blocked with an error notification. The chat continues; the user can set a new timebox or keep talking.

For the full behavior contract, see SPEC.md.

Project layout

src/
  core/               host-agnostic logic
    parse.ts          /timebox argument parsing
    decide.ts         budget decisions (ok / nudge / stop)
    format.ts         status string + system-prompt suffix
    persist.ts        record-based restore on reload
    types.ts          shared types
  adapters/
    pi/               pi-coding-agent adapter
      index.ts        default-export factory
      controller.ts   in-memory budget state
      command.ts      /timebox handler
      events.ts       session_start / turn_start / before_agent_start / session_shutdown
      entries.ts      custom session-entry helpers
      status-timer.ts setInterval-based status refresher
tests/
  core/               unit tests for pure helpers
  adapters/pi/        integration tests with a fake ExtensionAPI
SPEC.md               full behavioral spec
FUTURE-CLAUDE.md      Claude Code adapter sketch

Development

npm install
npm test                # vitest
npm run test:coverage   # v8 coverage with thresholds
npm run check           # biome --write + tsc --noEmit
npm run lint            # biome (no writes)

The host runtime, the network, and any LLM provider are fully faked. The test suite is hermetic and runs in under a second.

Roadmap

  • [x] pi adapter
  • [ ] polish + make it work properly for less capable models
  • [ ] Claude Code adapter (see FUTURE-CLAUDE.md).

License

MIT. Copyright (c) Fabio Rehm.