Corrigenda of the Hand

Corrigenda of the Hand reads your shell history and prints, as the corrigenda leaf at the back of a printed edition, the typing slips you keep correcting, each as "for X read Y" with the line of the file where it was first seen, its date when the file kept one, and how many times it recurs. Last on the page, nearest the cursor, it prints a block of alias lines that makes each slip stop costing a retype. Its real input is your own history file, read in place and never copied: zsh with EXTENDED_HISTORY, bash with or without HISTTIMEFORMAT, or plain one command per line, found from $HISTFILE, then the file for your $SHELL, then ~/.zsh_history or ~/.bash_history, or a path you give it. It needs Python 3 and nothing else; run it from this folder:

uv run corrigenda.py                          # the leaf for your own history; [HISTFILE] [-n N] also accepted
uv run corrigenda.py --aliases >> ~/.zshrc    # only the alias block, for ~/.zshrc or ~/.bashrc
uv run python -m unittest -v                  # the checks

Only first words are ever printed, the slip and its correction: arguments are compared in memory and never output, logged or stored, nothing is written to disk and nothing leaves the machine. Paste the alias, use it, and run this again: a slip you now use without its correction more often than with it leaves the leaf.

e2e.sh runs every acceptance check of CARD.md on Linux with tmux, zsh, strace and script, typing into real shells, and keeps what it saw in out/; shots.py takes the screenshots in shots/ from a real tmux pane. BUILD.md records what was run and what it printed.

Not run: the top-row comparison of check 3. The build box's own ~/.bash_history holds no recurring slip, so its page stands as printed and has no row to compare; the tool's exit code and the absence of a traceback on that file were checked.

Fixtures

Every file in fixtures/ was written by a real interactive shell (bash 5.2.21, zsh 5.9, Linux), driven in tmux by e2e.sh in an empty directory, and copied byte for byte; each run of e2e.sh writes them again before the checks.

Colophon

The fixtures were typed into real shells one key at a time by a script that makes no mistakes of its own, so it had to be told which ones to make.

normal is dead

Files