pi-work-all-day
v1.0.0
Published
WORK ALL DAY mode for the pi coding agent — set a work duration and the agent keeps iterating until the deadline. Persistent rules, guidance prompts, auto-compaction on HTTP 413, live countdown and fiery visuals.
Readme
pi-work-all-day
WORK ALL DAY mode for pi — set a work duration (in 0.5-hour units) and the agent will not stop until the deadline. Even after finishing every task in your prompt, it chains the next turn automatically and keeps iterating.
Built for long-running project builds and autonomous AI exploration.
Install
# from npm
pi install npm:pi-work-all-day
# or from git
pi install git:github.com/Animnia/[email protected]Usage
/wad 4 # start: 4 units = 2 hours
/wad # status: remaining time, continuations, rules, guides
/wad off # stop
/wad resume # resume after an Esc-abort pause
/wad rule add Write tests first # persistent rule, re-injected every turn
/wad rules # list rules
/wad rule del 1 # remove rule #1
/wad rule clear # remove all rules
/wad guide add Focus on the CLI # guidance prompt for subsequent work
/wad guides # list guides
/wad guide del 1 # remove guide #1
/wad guide clear # remove all guides/workallday works as the long-form command; /wad is the shorthand alias.
How it works
When the agent settles (no more tool calls), the extension checks the deadline:
- Not reached → injects a short user message (
Ok, keep working.) to chain the next turn. From your point of view, output never stops. - Reached → stops automatically and reports how many auto-continuations ran.
- The turn that crosses the deadline always runs to completion — lower bound guaranteed, upper bound unlimited.
Persistent rules & guides (fights instruction-following decay)
On long runs, models gradually drift from instructions. Rules and guides are re-injected with every continuation:
Ok, keep working. Remember:
- Write tests first
- Keep diffs minimal
Focus next:
- Focus on the CLIAuto-compaction on HTTP 413
If the provider gateway rejects a request with 413 Request Entity Too Large, the extension triggers pi's compaction with continue-work instructions, then resumes the loop automatically. After 3 consecutive failed compactions it pauses and tells you how to recover (/compact manually, then /wad resume).
Unlimited retries
Model errors and idle spins never stop the loop — it keeps retrying until the deadline. The only things that stop it: the deadline, /wad off, or an explicit Esc abort (which pauses; /wad resume continues).
Live countdown & visuals
While active:
- 🔥 banner widget above the editor with remaining time, continuation count, active rules and guides
- 🔥 custom working indicator while streaming
- ⏱ footer countdown, refreshed every 15 seconds
- Terminal title shows remaining time
All visuals are restored when the mode stops.
State persistence
Deadline, rules, guides and continuation count are persisted into the session — they survive /reload and /resume (expired state is dropped automatically).
Agent-facing tool
The extension registers a work_mode_status tool so the agent can check remaining time and pace itself.
⚠️ Cost warning
Token consumption scales roughly linearly with the duration — a 2-hour session is ~2 hours of full-throttle API calls. Start small (/wad 1 = 30 minutes) and scale up once you're happy with the behavior.
Development
Single-file extension: extensions/work-timer.ts. Edit, then /reload in pi.
