---
title: "pi: cycle models backward with ctrl+n"
url: https://perrotta.dev/2026/07/pi-cycle-models-backward-with-ctrl-n/
last_updated: 2026-07-29
---


[Previously]({{< ref "2026-07-22-caveman-mode-in-pi" >}}).

**Problem statement**: [pi](https://github.com/earendil-works/pi) binds `ctrl+p`
to `app.model.cycleForward`[^1] by default, but has no default binding to cycle
backward other than `shift+ctrl+p`, which is arguably difficult to remember.

Every keybinding in pi is namespaced and overridable via
[`~/.pi/agent/keybindings.json`](https://github.com/thiagowfx/.dotfiles/blob/1f42eb6f6632f946c23d1278e7e3f18da78d5de8/pi/.pi/agent/keybindings.json), documented in
[`docs/keybindings.md`](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/docs/keybindings.md):

```json
{
  "app.model.cycleBackward": [
    "shift+ctrl+p",
    "ctrl+n"
  ]
}
```

`ctrl+n` is also the default for `app.session.toggleNamedFilter`, but that
only fires inside the session picker, not while a model selector or the main
editor has focus.

Run `/reload` in pi to pick up the keybinding addition without restarting the
session.

∴ `ctrl+p`/`ctrl+n` now cycle models forward/backward, matching the readline
(emacs!) history bindings I already have muscle memory for.

- - -

🤖 *Drafted with [`/bloggify`](https://github.com/thiagowfx/skills/blob/master/plugins/thiagowfx/skills/bloggify/SKILL.md).*

[^1]: It cycles through models selected in `/scoped-models`.

