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

@henryqw/pi-goal

v0.2.2

Published

Persistent Pi goals that continue automatically until completion is proven with evidence.

Readme

@henryqw/pi-goal

Give the agent one goal, and Pi continues the work after each stop. The loop ends when the agent gives evidence for each deliverable, or when a stop limit applies.

Install

pi install npm:@henryqw/pi-goal

Use

Type /goal to see the drop choice. /goal without arguments still shows the current goal.

Ask the agent to work toward a goal, for example: "Make this a goal: all tests pass and the README documents /export." The agent calls goal with action create. When the agent stops before completion, Pi sends a hidden continuation, and the agent continues.

| Surface | Type | Purpose | | --- | --- | --- | | /goal | command | For users: show the goal, its status, and tokens used. | | /goal drop | command | For users: drop the active goal and stop continuation. | | goal | tool | For agents: create, get, complete, or drop the goal. | | Footer status | ui | Shows the active goal objective and tokens used. |

The goal tool is available to the model only. Other tools, such as codemode, cannot call it.

Tool actions

| Action | Parameters | Result | | --- | --- | --- | | create | objective, optional deliverables and token_budget | Starts a goal. Fails when a goal is already active. | | get | — | Shows the goal, tokens used, and remaining budget. | | complete | evidence: one { deliverable, evidence } item for each deliverable | Completes the goal. | | drop | — | Drops the active goal. |

When the goal has no deliverables, complete needs one evidence item with deliverable objective. The tool rejects missing, blank, duplicate, or unknown evidence items. The agent must get evidence from current state, such as files, command output, or tests. Memory of earlier turns is not evidence.

Flow

flowchart TD
    accTitle: Pi Goal continuation flow
    accDescr: A prompt starts work with hidden goal context. Each stop reads the goal from the current branch. Completion needs evidence for each deliverable; drop also ends the goal. Another extension can supply the next turn. Otherwise, continuation needs an active goal, a user interface, and a completed run. Abort, error, or compaction stops continuation. Budget and the 20-continuation limit apply before a wait for a live delegated result. Without a pending result, repeated tool activity stops continuation. Stop limits do not complete the goal.
    Prompt["User prompt"] --> Context["Add hidden goal context"]
    Context --> Work["Agent work; goal tool actions"]
    Work --> Stop["Agent stops; read branch goal"]
    Stop --> Shared{"Another extension continues?"}
    Shared -->|Yes| Work
    Shared -->|No| Eligible{"Active goal, interface, completed run?"}
    Eligible -->|No| Settle["Settle without goal continuation"]
    Eligible -->|Yes| Limit{"Budget used or 20 continuations?"}
    Limit -->|Yes| Hold["Settle; goal stays active"]
    Limit -->|No| Pending{"Live delegated result pending?"}
    Pending -->|Yes| Wait["Wait; no empty continuation"]
    Wait -->|Result or failure starts a turn| Work
    Pending -->|No| Progress{"Same tool activity twice?"}
    Progress -->|Yes| Hold
    Progress -->|No| Continue["Hidden continuation with goal context"]
    Continue --> Work

Read the static goal flow diagram on npm or without a Mermaid renderer.

  1. Before each user prompt, Pi Goal adds the goal, the budget numbers, and the completion rules as hidden context.
  2. When the agent stops, Pi Goal checks the stop limits. If no limit applies and no delegated result is pending, it adds a hidden continuation with the same goal context.
  3. The agent continues in the same run. A successful complete or drop ends the loop.

Pi Goal does not add a continuation when another extension already continues the same stop. One continuation request then serves both extensions.

Pi Goal waits when a retired subagent install owns a live direct or isolated result that will start a turn in the current session. It adds no empty continuation or no-progress warning during this wait, but budget and maximum-continuation limits still apply. A result or failure restores normal goal handling. Retained, interrupted, unknown, or other-session work does not cause a wait. The query applies only when that retired install is loaded. See the archived pending-result contract.

Background-command notices do not start turns and do not cause a wait. Without a retired subagent install, the normal stop checks apply.

State and storage

Pi Goal keeps no goal state in memory or in files. It reads the latest goal record from the current conversation branch each time:

  • goal tool results store the full goal in their details.
  • /goal drop appends a pi-goal custom entry.
  • Each continuation is a hidden pi-goal-continuation message.

Branch navigation, /tree, forks, resume, and /undo rewinds show the goal of the selected branch. A rewind to a point before create removes the goal from that branch.

Limits and recovery

| Limit | Behavior | Recovery | | --- | --- | --- | | Interactive only | Continuation needs a UI. Print mode and other modes without UI do not continue. | Send each next prompt manually. | | Maximum continuations | Continuation stops after 20 automatic turns since the latest user prompt. The count includes all goals, so a new goal does not reset it. | Send a prompt to continue. | | No progress | Continuation stops when two automatic turns in sequence show identical tool activity. | Send a prompt with new direction, or run /goal drop. | | Budget | Tokens used are the input, cache write, and output tokens of assistant responses after create. Cache reads do not count, because each turn reads the cached context again. Continuation stops when tokens used reach token_budget. The goal stays active; it is not complete. | Send a prompt to continue, or run /goal drop. | | Abort, error, compaction | Continuation stops after an abort or error. A compaction aborts the run, and Pi itself then stops continuation. | Send a prompt to continue. | | Evidence | Evidence is model-reported text. Pi Goal checks that it is present, not that it is true. | Examine the evidence in the complete result before you accept the work. |