Make claude, codex, and pi route through paper automatically. With shell routing, typing the agent’s own command captures the session — no wrapper to remember, no sessions silently missed. Prerequisites: paperctl installed and authenticated.
What it changes
paperctl shell prints an init script for your shell. The script defines claude, codex, and pi as shell functions that wrap invocations through paperctl start <agent> — nothing else in your environment changes, and the functions pass your arguments through to the agent untouched.
The installer offers to add this to your rc file on first install. To set it up yourself, append the init line to your shell’s rc file — the second line enables it in the terminal you’re in right now:
echo 'eval "$(paperctl shell zsh)"' >> ~/.zshrc
eval "$(paperctl shell zsh)"echo 'eval "$(paperctl shell bash)"' >> ~/.bashrc
eval "$(paperctl shell bash)"echo 'paperctl shell fish | source' >> ~/.config/fish/config.fish
paperctl shell fish | sourceOpen a new terminal and verify:
type claude
Expected: claude is a shell function, and its body calls paperctl.
Inspect what you’re running
The script is plain shell — read it before or after installing it:
paperctl shell zsh
Bypass it for one run
Shell functions only wrap interactive shells that loaded them. To run an agent uncaptured once, call the binary directly:
command claude
Scripts and CI jobs that invoke agents by absolute path are unaffected by shell routing.
Turn it off
Remove the eval "$(paperctl shell …)" line (or the installer’s block) from your rc file and open a new terminal. paperctl uninstall also removes the shell block it installed.
Conflicts
If your rc file already defines an alias or function named claude, codex, or pi, whichever is defined last wins. Put the paper line after other tool init in your rc file, or remove the older alias.
When the daemon isn’t running
The wrapped command checks the daemon before launching. If paperd is unreachable, it reports the problem instead of starting an uncaptured session — run paperctl doctor to check and repair, then rerun the agent.