@pithos-kit/clio0.10.0
Clio: documents committed work in the background and commits the good doc changes as their own docs(clio) commits.
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
Readme
Clio
Clio keeps your docs in step with your commits. Requires Pi 1.0.3 or later and Node.js 22.19.0 or later. Package version: 0.10.0.
After the agent finishes a run and the branch has new commits, Clio works in the background:
- Collects what was learned. A classifier reads the session turn by turn and keeps only decisions, reasons, gotchas, constraints and dead ends. Progress reports and chatter are skipped. If nothing qualifies, Clio stops here.
- Drafts doc updates. A worker model reads the commits, the diff, the kept session excerpts and the nearby docs, and proposes small edits to
README.mdfiles or Markdown underdocs/, or a new page in an existing docs directory. Read-only records such as ADRs are context only, never edited. - Grades each proposed change with the classifier. Useful, durable changes are committed. Weak ones go to the inbox. Test narration, code restatement, status reports, bug reports and speculation are dropped.
- Commits the good changes as their own
docs(clio): …commit, once the agent is idle. That commit holds only Clio's files, carries aClio-Capture:trailer, and is easy to read ingit logand to revert.
Clio never pushes, amends, or commits anything but its own doc files. Your staged work stays staged.
Install
pi install -l npm:@pithos-kit/clio
From a checkout: pi install -l ./pithos.clio, or pi -e ./pithos.clio for one run. With Pithos, add it to .pithos:
pi:
extensions:
"@pithos-kit/clio": "npm:0.10.0"
Commands
Run /clio --help for the same list.
| Command | What it does |
|---|---|
/clio |
Capture new commits now instead of waiting for the next settle. |
/clio --since <rev> |
Capture <rev>..HEAD, for example to retry a failed run or to cover commits from before Clio was installed. |
/clio review |
Go through the inbox: commit, drop or skip each waiting change. |
/clio undo [--yes] |
Revert Clio's most recent docs commit. |
/clio status |
Show the branch cursor, classifier health, inbox and last run. |
/clio status --probe |
Also make one tiny classifier call (about $0.0001) to test the model and its credentials right now. |
Translated review
In the interactive TUI, /clio review follows Translate's /translate output-on setting when both extensions support this integration. The original review appears immediately, with progress in the same view while translation runs. When ready, the translated text replaces the eligible review content in place, labeled Translated · <language>. Paths, diff markers, headings and actions stay unchanged. Use Page Up and Page Down (or b and Space) to scroll. Skip is selected by default, and all actions remain available while translation runs. Acting on an item or pressing Esc cancels any pending translation. Commit it still writes the original proposal, including any lines beyond the preview.
Only the current item's reason, explanation and eligible visible doc prose (up to 40 diff lines) go to the configured output translation provider. UI labels are not translated. Translate checks the surrounding Markdown locally so it can mask code and links even when the preview cuts through them. For edits, Clio translates excerpts only when the original text matches exactly once in the current file after normalizing line endings, and the file can be read without redaction. Otherwise those excerpts stay original. Your provider's pricing and privacy terms apply. Review translations do not enter the session transcript or the main coding model's context. If Translate is unavailable or off, or a request fails, Clio keeps the original review open.
How it keeps track
Cursor. Each branch has a local ref,
refs/clio/cursor/<branch>: the last commit Clio processed. It is shared by every Pi session and worktree of the repo and is never pushed unless you push it on purpose.First run. On a branch it hasn't seen, Clio only places the cursor at HEAD. It never backfills old history; use
/clio --since <rev>for that.Rebases. If the cursor is no longer an ancestor of HEAD (rebase, reset), Clio moves it to HEAD without capturing.
Its own commits. Clio commits and reverts of them are never documented again.
Session scope. Only the current session's branch is read, from the time of the cursor commit. Commits made in other sessions are documented from the diff alone.
Inbox. Changes waiting for review live in
.git/clio/inbox/. They wait there when no classifier is configured, when the classifier is unsure, when the file has uncommitted changes, or when the branch moved under Clio.No automatic runs in untrusted projects, child sessions, or while Plan is active.
/clioworks there when you run it yourself.Run records. Every capture writes
.git/clio/runs/<time>-<range>.json, and the newest 50 are kept. Each record holds:- how the run ended;
- each worker request's duration, tokens, cost and tool calls;
- every file the worker read or was refused;
- each change's verdict and reason;
- the classifier's call and failure counts.
It holds no file contents, session text or model output. A failed run's report points at its record.
While it runs
- Footer status. In the TUI, the footer shows what Clio is doing and for how long, for example
Clio · a90c9cb..bdaca7a · drafting, request 3 of 16 · 41sorClio · … · waiting for the agent to go idle to commit · 1m 10s. It clears when the run ends. /clio statusshows the same step and elapsed time.- Deadline nudge. At 70% of
timeoutMsthe worker is told to stop reading and answer with what it has. The hard stop comes at 100%. - Cost nudge. At
maxCostUsdthe worker gets the same nudge, and at 1.5× that amount it is stopped. A final answer that crosses the line is still used.- This only works where the provider reports cost. A report marked "partial" means some requests had no cost data.
Configuration
Optional project-local .pi/clio.json. Every field is optional; unknown or malformed fields stop Clio with a clear error.
{
"model": "openai/gpt-6-luna",
"thinking": "low",
"docsDirs": ["handbook"],
"readOnlyDocs": ["**/adr/**"],
"autoCommit": true,
"classifier": {
"model": "openai/gpt-6-luna",
"collectThreshold": 1.0,
"gateThreshold": 1.0,
"maxWindows": 8,
"timeoutMs": 30000
},
"timeoutMs": 300000,
"maxTurns": 16,
"maxContextTokens": 64000,
"maxEdits": 6,
"maxCommits": 20,
"maxCostUsd": 0.5
}
model/thinking: the worker.- They default to the session's model and thinking level.
- Set them: a frontier session model with medium thinking can take 40 seconds and about $0.20 per request, and one run makes several requests.
- A fast, cheaper model with
"thinking": "low"is enough for small doc edits. /clio statuswarns when the worker falls back to the session model.
docsDirs: extra directories, besides anydocs/, where Markdown counts as docs.readOnlyDocs: glob patterns for docs Clio may read but never edit or add pages to.- The default
["**/adr/**"]keeps ADRs as history: Clio reads them for context, and when a decision has no record it says so under "Unresolved" instead of writing one. **spans directories;*and?stay within one.- Set
[]to allow edits everywhere.
- The default
autoCommit: set tofalseto send every change to the inbox.classifier: a registered classifier model, used through Pi's classification API.- Without one, nothing is committed automatically: every change goes to the inbox.
- Scores run from 0 to 3.
collectThresholdis the minimum for a session excerpt to reach the worker.gateThresholdis the minimum for an edit to be committed without review.- For
openai/...classifiers, Pi needs API-key authentication, not a ChatGPT login. See Translate's README, section "OpenAI Decisions setup".
maxContextTokens: the worker's context budget. It defaults to the smaller of 64k and half the model's context window. Reasoning is not counted.maxCommits: the most commits one run covers; larger ranges keep the newest.timeoutMs/maxCostUsd: per-run worker limits, by default 5 minutes and $0.50. Both nudge the worker to answer before the hard stop; see "While it runs".
When the classifier is not working
Clio never treats a broken classifier as "nothing worth documenting".
- Not usable at all. No
classifierin the config, no classification API in this Pi, or the model isn't registered. Every run report and/clio statussay so:unjudged (<reason>). - Calls failing. A bad credential, a timeout, a rate limit or a provider error. Each run report gets a line like
Classifier openai/gpt-6-luna: 23 of 23 classifier calls failed (last: error: 401 no_matching_rule). - Most calls failing in one run. The classifier counts as down for that run. Clio uses the recent session excerpts unjudged, the worker still runs, nothing is auto-committed, and every change goes to the inbox.
- Checking it.
/clio statusshows how the classifier did in the last run of this session./clio status --probetests it right away.
For openai/... classifiers, a 401 usually means Pi is using a ChatGPT login instead of an API key. See Translate's README, section "OpenAI Decisions setup".
What gets sent where
- The classifier provider receives the session's user and assistant text, turn by turn. Credential-looking lines are redacted, and tool output stays out except a short excerpt of failed calls. It also receives each proposed doc change.
- The worker model receives the commits, the diff (lockfiles, build output and binaries excluded), the kept excerpts, and any project files it chooses to read.
- Never read: hidden paths, dependencies, build output,
AGENTS.md/CLAUDE.md-style instruction files, and secret-looking files.
Redaction is a heuristic, not a guarantee.
Development
npm ci
npm test
npm run typecheck
npm pack --dry-run
Tests use Pi's faux provider and real temporary git repositories; no paid model calls. They cover:
- the cursor and range rules;
- session windows and the classifier filter;
- proposal validation;
- commit, inbox and rollback behavior;
- the worker loop, including regressions for the old reasoning-size abort and cost tracking;
- the full pipeline;
- a connected Pi session.
The classifier thresholds were tuned on two real sessions only. Expect to adjust them.