hardwork
Hardwork mode for AI coding agents — inspired by Spotify's
portal-ai-plugins/shunt, but with
no Portal account required: I/O-heavy work is delegated to a cheap pi
worker model (default: antigravity/gemini-3.8-flash) instead of AiKA.
Two features, three hosts:
- Hardwork mode — a mandatory GOAL / FOLLOW THROUGH / LEFTOVERS reasoning
ruleset injected into every session, to prevent confidently incorrect answers.
- Read gate + delegation — large full-file reads are blocked and redirected
to
bulk-read / code-write scripts, which send the corpus to the pi worker
so it never enters the caller's context.
| Component | pi | Claude Code | Codex |
|---|
| Ruleset injection | extension (before_agent_start) | SessionStart hook | — (no hook mechanism) |
| Read gate | extension (tool_call) | PreToolUse hooks | — (no hook mechanism) |
| bulk-reader / code-writer | skills + scripts | skills + scripts | skills + scripts |
Repository structure
Portal-style plugin monorepo: host manifests at the root, plugin content under
plugins/hardwork/ (add more plugins alongside it later).
hardwork/
├── package.json # pi manifest (extensions + skills)
├── .claude-plugin/marketplace.json # Claude Code marketplace → ./plugins/hardwork
├── .codex-plugin/plugin.json # Codex manifest (skills + scripts)
└── plugins/hardwork/
├── .claude-plugin/plugin.json # Claude Code plugin manifest
├── extensions/ # pi: ruleset injection + read gate
├── hooks/ # Claude Code: SessionStart injector + PreToolUse gate
├── skills/ # bulk-reader, code-writer (all hosts)
├── scripts/ # shared delegation worker (bulk-read, code-write)
└── evals/ # 83 no-model checks, run.sh
Prerequisites
Prerequisites
- pi CLI installed and authenticated — it is the worker for every host.
jq — Claude Code hooks only (brew install jq).
Installation
pi
pi install git:github.com/nampq11/hardwork
A hardwork: full | gate: on widget confirms it is active. Try without installing:
pi -e git:github.com/nampq11/hardwork
Claude Code
claude plugin marketplace add nampq11/hardwork
claude plugin install hardwork@hardwork
Codex
codex plugin marketplace add nampq11/hardwork
codex plugin add hardwork@hardwork
Modes (ruleset)
| Mode | Injection |
|---|
full | The three questions plus working rules: fact vs. inference discipline, verify-before-assert, ambiguity resolution, simplicity preference |
minimal | The three questions only, plus the uncertainty rule |
none | Nothing injected |
/hardwork # show mode + gate status (pi)
/hardwork minimal # switch mode for this session (pi)
/hardwork gate off # disable the read gate (pi)
HARDWORK_DEFAULT_MODE=minimal pi # environment default (all hosts)
Config file at $XDG_CONFIG_HOME/hardwork/config.json or
~/.config/hardwork/config.json (all hosts):
{
"defaultMode": "minimal"
}
Delegation
# Question over a large corpus — files go to the worker, never into context
plugins/hardwork/scripts/bulk-read --question "What does this service do?" --paths src/Service.java src/Handler.java
# Boilerplate generation — output matches the reference file's patterns
plugins/hardwork/scripts/code-write --spec "Write tests for UserService" --reference tests/OrderTest.java --target tests/UserTest.java
Each call is one ephemeral pi --no-session --no-skills -p --model $HARDWORK_WORKER_MODEL
run with the payload on stdin (no ARG_MAX ceiling — the byte cap is a cost
guardrail only). Nothing is replayed between calls; to follow up, pass the same
--paths again or reference the previously generated file as --reference.
Read gate
Full-file reads of files over HARDWORK_MIN_LINES (default 350) are blocked with
a redirect to the bulk-reader skill. Pass-through by design:
- Targeted reads (
offset/limit) — the caller knows exactly what it needs
- Files under the threshold
- Piped commands (
cat file | grep) and redirections (cat file > out)
- Debugging, editing, architecture — work that needs the caller's full judgment
Note: a caller that insists on reading a large file section-by-section via
offset/limit will still get it into context — the gate redirects the common
"read everything at once" pattern, it cannot force delegation.
Configuration