Closing Your Terminal No Longer Kills the Session: Pi 1.7.0 Puts Resume in the Protocol and Drops Install Telemetry
On November 27 at 17:01 UTC, Pi shipped v1.7.0. The version bump is small. One change inside it is not: close your terminal, and the session can come back on its own.
Not "here's a command to copy." The terminal itself knows which command to run when it restarts, and brings back the same session, the same tool restrictions, and the same skill instructions.
Pi is an open-source terminal agent harness from Earendil, MIT licensed, with 124,541 stars and 16,098 forks on GitHub. The previous release, 1.6.1, landed on November 25, two days earlier.
TL;DR
- Pi v1.7.0 was published on November 27, 2026 at 17:01 UTC. The official changelog, the GitHub release and npm all agree within three minutes.
- The headline is terminal session resume: through the OSC 7577 terminal protocol,
pi --session <id>gets handed to the terminal along with the tool restrictions the session started with. - A breaking change also lands: new installs and updates no longer report telemetry.
/api/report-install, theenableInstallTelemetrysetting andPI_TELEMETRYare all gone.
What actually changed
The release notes split into five sections, and the entries can be counted:
| Section | Entries | The one that says the most |
|---|---|---|
| New Features | 3 | Terminal session resume |
| Breaking Changes | 1 | Install telemetry removed |
| Added | 5 | New --agent-dir flag |
| Changed | 4 | Three retired default models replaced |
| Fixed | 11 | Ctrl+Break on Windows leaving the terminal in the alternate screen |
Two of the three new features are about the terminal. One is about image generation. The terminal pair is the real story.
Why "resume in the terminal" is harder than it sounds
Restoring a session in a GUI editor is trivial: the window is still open, the state sits in memory, one click and you are back. A terminal is not like that. It understands commands and characters. It has no idea why your process was running or which flags it carried.
The old options were both awkward:
- Remember
pi --resumeyourself, retype it after reopening the terminal, then try to recall whether you had added-t read,grep. - Start a fresh session and lose the context.
v1.7.0 flips the responsibility. The terminal keeps the record:
| Situation | Before | v1.7.0 |
|---|---|---|
| Terminal crashes and restarts | Type pi --resume and pick a session | Terminal runs pi --session <id> itself |
| Last session ran a read-only tool set | Comes back with full permissions unless you remember -t | Restore command carries -t read,grep,find,ls |
| Used a separate config directory | Comes back with the default directory's settings and auth | Command carries --agent-dir pointing at the original |
| Used skills and prompt templates | Gone | --skill, --system-prompt and friends replayed as typed |
That last row is the point. The resume command repeats your restriction and resource flags word for word: --tools, --no-extensions, -e, --skill, --system-prompt, all of it.
Why be that fussy? Because a resume that quietly widens permissions is not a resume, it is a privilege escalation. A read-only session that returns as writable and executable means nobody approved the change.
How to use it: install and upgrade
Installation is unchanged. Both commands come from the official site:
curl -fsSL https://pi.dev/install.sh | shnpm install -g --ignore-scripts @earendil-works/pi-coding-agentRerun either one to get 1.7.0, or use whatever package manager you normally reach for.
Session resume needs terminal cooperation, so there are three steps after install:
- Make sure your terminal supports OSC 7577 and exports
OSC7577_TOKEN. Without that token Pi stays quiet by design. - Add a trust rule for the command in your terminal. Rex users write
rex.set("resume.trust.pi_plain", { command = {"pi", "--session", id} }), one rule per flag combination. - Restart the terminal and watch. A successful resume brings back the old session name, the old model and the old tool restrictions.
Step 2 is where people get stuck. More on that below.
Who it is for
- People who live in a terminal all day and use a modern one: tmux, kitty, Ghostty, WezTerm. The value scales with how often your terminal restarts.
- Anyone running a separate profile per project, one
PI_CODING_AGENT_DIRper directory tree. Only--agent-dirrestores those correctly. - Teams that want a record of what ran and what it could touch. The restrictions live inside the resume command, which makes them auditable.
Not a good fit
- VS Code's integrated terminal and IntelliJ's integrated terminal. The docs adapt these separately, so you have to verify OSC 7577 support yourself. Do not assume it works out of the box.
- Someone who runs
pionce in a while to ask a question. Session resume solves interrupted long sessions, not quick one-offs. - Resuming across machines. The protocol is between a process and its terminal. Official docs make no promise about picking a session up on another box.
Three smaller changes worth knowing
Image generation reached codemode. Classifier models were already callable there; now image models are too. Radius models sit in the built-in catalog, and OpenRouter image models accept { aspectRatio, size } as a third argument. A single script can run at most four such calls at once and the rest queue.
Copilot prompt caching got better. Switching thinking level no longer wipes the cache on supported Claude 5.x and GPT-6 models, and Claude 5.x keeps it when tools change too. If you pay per token, that is money saved rather than convenience gained.
Three default models were swapped. Cloudflare Workers AI now defaults to @cf/zai-org/glm-5.3 because Cloudflare retired Kimi K2.6 and K2.7 Code. ant-ling moved from the retired Ring-2.6-1T to Ling-3.1-flash. On Qwen Token Plan Individual, qwen4-max-preview gave way to qwen4-max.
Pitfalls
First: Rex's flags table does not work with Pi. The docs say it plainly. Node overwrites the command line Rex checks against, so you need one rule per flag combination. Add --no-extensions and you owe a second rule that includes it. Skip that and the session comes back as a plain shell, not as a session missing a few flags.
Second: OSC7577_TOKEN has to exist before launch. Pi strips the variable from its own environment at startup so the shells, editors and extension processes it spawns cannot rewrite the resume command. Trying to change the token mid-session will not work. That is intentional.
Third: dropping install telemetry is a breaking change. If a script or CI job reads PI_TELEMETRY or calls enableInstallTelemetry(), both vanish after the upgrade. Grep your automation now instead of finding out from a failed build.
Fourth: image generation is slow, so do not set a short timeout. timeout_ms is unset by default in codemode, and the docs warn that generating images can take minutes.
Cost and time
Pi itself is free, MIT licensed, source on GitHub. The money goes to whichever model provider you connect. Pi is only the shell.
The built-in catalog lists 1,701 model entries, and prices spread wide:
| Model | Input (per million tokens) | Output (per million tokens) |
|---|---|---|
| DeepSeek V3.2 | $0.62 | $1.85 |
| MAI Code 2 Flash | $0.05 | $0.25 |
Time splits into two parts. The upgrade takes two minutes. Configuring terminal trust rules runs from ten minutes to half an hour depending on how well you know Rex, and it is a one-time job.
Next step
First, run pi --version. If it is not 1.7.0, rerun the install command.
Second, open https://docs.pi.dev/latest/terminal-setup and read the "Program resume" section, then add the trust rule. If your terminal is not on the supported list, skip this. Nothing else breaks.
Third, if any CI script reads PI_TELEMETRY, delete that block today rather than waiting for a build to fail for no obvious reason.
Sources
- Pi official changelog (November 27, 2026): https://pi.dev/changelog
- GitHub Release v1.7.0: https://github.com/earendil-works/pi/releases/tag/v1.7.0
- npm package publish times: https://www.npmjs.com/package/@earendil-works/pi-coding-agent
- Terminal setup docs (Program resume, Program status): https://docs.pi.dev/latest/terminal-setup
- codemode docs: https://docs.pi.dev/latest/codemode
- Model and pricing catalog: https://pi.dev/models