cmd
Every Bash output archived raw, filtered for the model, measured.
| Surfaces | PreToolUse(Bash) hook → rtok run -- <cmd>; rtok expand <id> |
| Spec | the spec (replaces) column of the catalogue in plan.md §1 |
| Default | on |
How it works
- The PreToolUse hook rewrites
commandtortok run -- <command>unless the command first word is innever_wrap(defaultrtok,sudo), or it contains a heredoc,&background, or-i/--interactive. rtok runexecutes via$SHELL -lc, keeps the exit code, writes the raw output to~/.rtok/archive/<id>and anarchiverow.- A per-family formatter (
cargo,git, test runners,ls/find; measurement kindformatter) summarises the output. Other families go through the TOML rules inrules/default.toml(kindrule): head/tail/dedupe/drop, always keepingerror|warning|panic|FAIL|Traceback. - Output over 40 lines gets a trailer:
[rtok <id> · N lines · expand: rtok expand <id>]. - Non-zero exit → last 80 lines verbatim. Nothing is redacted.
Config
[plugins.cmd]
enabled = true
rewrite = true # false: never rewrite Bash commands
never_wrap = ["rtok", "sudo"] # first-word deny list for the rewriteTasks
See roadmap.md § cmd. Checks in plan.md.
T3.1 rtok run · T3.2 rule engine · T3.3 formatters + default rules · T3.4 PreToolUse rewrite ·
T3.1–T3.6 done 2026-09-02 · T10.2 rtok filter --stdin (OpenCode).
Status
T3.1–T3.6 T10.2 done 2026-09-02.