pi-arc-caffeine

pi extension for Arc workspaces: stable skill paths, guidance on waiting for long-running work, and a guard against long sleeps

Packages

Package details

extension

Install pi-arc-caffeine from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-arc-caffeine
Package
pi-arc-caffeine
Version
0.1.0
Published
Oct 23, 2026
Downloads
387/mo · 44/wk
Author
kyle-ganaz
License
unknown
Types
extension
Size
10 KB
Dependencies
0 dependencies · 0 peers
Pi manifest JSON
{
  "extensions": [
    "src/index.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-arc-caffeine

A small pi extension for Arc workspaces that tells pi to sleep less. Add npm:pi-arc-caffeine to the workspace's pi packages; there is nothing to configure. It does three things:

  • Stable skill paths. Arc copies /workspace/.pi into a new .pi/resources/snapshot-<random>/ for every pi launch, so skills loaded from there get a new <location> in the system prompt on every message, and nothing after it can be read from the prompt cache. Each such skill is listed at the same file under $ARC_WORKSPACE_ROOT/.pi/skills instead (default /workspace), if it exists there. If an earlier extension already replaced the prompt, the same rewrite is applied to its text.
  • Waiting guidance. The main session's system prompt gets a short section on waiting for long-running work: Arc's bash hands anything slower than 60 seconds to the background, and its result starts the agent's next turn, so the agent should end its turn rather than poll. Subagents and workflow agents, whose turn can't resume, don't get it.
  • Sleep guard. A bash call whose command starts with sleep (after any cd … && or cd …;) for longer than 5 seconds is refused. The model is told to end its turn to wait for a command it started (subagents and workflow agents aren't), or to run one bounded loop that exits on a condition, such as timeout 900 sh -c 'until <check>; do sleep 5; done'; a sleep inside a loop like that is allowed.

This is a subset of pi-arc-lifecycle, which does all of the above and much more. Don't load both.

Development

pnpm i
pnpm test        # vitest; never calls a model
pnpm type-check
pnpm format

To release, bump version in package.json in your PR. When it merges to master, .github/workflows/publish-arc-caffeine.yaml stages it on npm with trusted publishing (OIDC, GitHub environment npmjs-pi-arc-caffeine); a maintainer then approves it on npmjs.com (or npm stage approve <id>) with 2FA. ./publish.sh is the manual fallback.