kaeru 🐸
_..---.._ _..---.._
.-' '-. .-' '-.
.' .-"""-. '. .' .-"""-. '.
/ / \ \ / / \ \
| | (O) | | | | (O) | |
\ \ / / \ \ / /
/ '. '-...-' .' '. '-...-' .' \
/ '-._ _.-'----------------------------------'-._ _.-' \
| |
| . . |
| \ / |
| '. .' |
\ '-._ _.-' /
\ '''---...__________________________________...---''' /
'. .'
'-._ _.-'
'''---...____________________________________________...---'''
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kaeru reopens your terminal tabs after the terminal closes or the computer restarts. Each tab comes back in the folder it was in, and a tab that was running a coding agent, such as Claude Code or Codex, comes back with the same conversation.
The name is Japanese. kaeru can be written 帰る, "to go home", 返る, "to return to how it was", or 蛙, "frog". In Japan, a frog charm is a wish for a safe return.
Status: kaeru is in early development. It works on Windows: in Windows Terminal with PowerShell or Git Bash, in Git Bash's own windows, and in Warp. On macOS, it works in Terminal, iTerm2, Ghostty and Warp, with zsh. On Linux, it works in GNOME Terminal, kitty, WezTerm and Ghostty, with bash, zsh and fish, so far as tested without a real Linux desktop. The roadmap shows what comes next.
Why kaeru
A terminal closes more often than you plan: an update restarts the computer, the terminal crashes, or you quit it by accident. With one tab, that costs a few seconds. With ten tabs in different projects, several of them running coding agents in the middle of long conversations, it costs much more: you have to remember which folders were open, open each one again, and find out which conversation belonged to which project.
Some terminals bring back their own tabs, but that doesn't solve it:
- It depends on the terminal. Each one restores tabs in its own way, in its own cases, and often only when a setting is on. Some bring back tabs after a crash but not after you quit, or the other way around.
- Many terminals don't restore tabs at all. Each terminal has its own design, and some leave this out on purpose, to stay small and fast. That is a fair choice, so it may never come to them.
- A terminal that restores its tabs brings back at most the folder and the text on the screen. The program that ran there is gone, so an agent tab comes back as an empty prompt, and the conversation, with everything the agent knew about your work, stays behind.
- Your terminal can change. If you use more than one terminal, or switch to a new one, you have to learn and set up its restore all over again.
kaeru solves this outside the terminal, so it works the same way everywhere:
- It brings back agent sessions, not only tabs. Each agent tab comes back with the same conversation, resumed with the agent's own command, so you continue where you stopped.
- It works in many terminals, shells and systems, with the same list and the same keys.
- It brings back only what you lost. A tab you closed yourself stays closed; only the tabs that went away with their whole terminal are offered again, and you choose which ones come back.
- It stays out of your way. There is no program running in the background: a line in your shell profile and a hook in each agent tell kaeru what it needs, and it keeps small notes on disk.
- It works with the terminal you already like. Where a terminal restores its own tabs, kaeru leaves the tabs to it and only resumes the agent sessions in them.
How it works
When you open your terminal again, the first new tab lists the tabs that were open:
🐸 kaeru: 4 tabs were open when your terminal closed
Agent sessions (2)
[x] api-server Claude Code 40 minutes ago ~\code\api-server Windows Terminal
[x] mobile-app Codex 2 hours ago ~\code\mobile-app Windows Terminal
Shells (2)
[x] web-ui PowerShell ~\code\web-ui Windows Terminal
[ ] ~ PowerShell ~ Windows Terminal
> Done: reopen 3, forget 1
<space> check <a> check all <d> done <esc> later <o> options
Every tab starts checked, and the cursor, marked with >, starts on Done, so pressing Enter
brings them all back. Each checked tab opens again in its folder, in the terminal it came from,
and agent sessions are resumed with the agent's own command, such as claude --resume <id> or
codex resume <id>. To leave a tab out, move up to it and press Space or Enter to uncheck it.
Done says how many tabs it will reopen and forget, and you choose it with Enter on its line or
with d from anywhere. a checks or clears every tab at once. Press Esc to decide later, or
o for the options. Run kaeru to see the list again at any time.
The tabs come back one at a time, about a second apart, so that a slower computer doesn't have to start every shell and agent at once. They come back in the order they were first opened. A tab you moved by dragging it comes back where it was first opened, not where you moved it, because Windows Terminal doesn't tell other programs where its tabs are. When the list showed up by itself in a new tab, that tab closes once the others are back, so that you end up with the tabs you had.
A tab you closed yourself is not offered again. kaeru only brings back tabs that went away together with their whole terminal, for example when the terminal crashed or the computer restarted.
Git Bash's own windows (mintty) have no tabs: each window is a terminal of its own. So by default, kaeru brings them back after a restart or sign-out, and forgets a window that you closed. The options can make it offer closed windows too. Each one comes back as a window in its folder, and the list shows in the first new Git Bash window.
Warp brings back its own tabs and their folders, but not the agent sessions in them. So kaeru doesn't list Warp's tabs. Instead, a tab that Warp brought back says that it had a session:
kaeru: this tab had a Claude Code session. To resume it here, run kaeru resume.
Run kaeru resume in that tab to continue the session there. kaeru doesn't ask "resume it?"
when the tab opens, because Warp is still setting the tab up then, and could answer the
question by accident.
On macOS, Terminal and iTerm2 bring back their own tabs only sometimes, such as after a crash
or a restart that reopens windows. Their tabs that come back say the same, and kaeru reopens
the others. Ghostty brings back its own tabs too, but without saying which they are, so
kaeru doctor asks you to set window-save-state = never in Ghostty's config, which leaves
that to kaeru.
On Linux, GNOME Terminal and WezTerm bring back tabs as tabs of the window that shows the list. kitty and Ghostty don't let other programs open tabs, so there each tab comes back as a window.
When Warp crashes on Windows, the programs in its tabs keep running without a window. Then the
tab says that its session still runs without a window, and kaeru resume ends that hidden
session first and resumes it in the tab.
The details are in docs/architecture.md.
Install
kaeru works on Windows, in Windows Terminal with PowerShell or Git Bash, in Git Bash's own windows and in Warp, on macOS, in Terminal, iTerm2, Ghostty and Warp with zsh, and on Linux, in GNOME Terminal, kitty, WezTerm and Ghostty with bash, zsh and fish.
-
Install kaeru. On macOS and Linux, run:
|It downloads
kaerufrom the latest release and puts it in~/.cargo/bin, which it adds to your PATH. On Windows, run this in PowerShell:powershell -ExecutionPolicy Bypass -c "irm https://github.com/gloomydumber/kaeru/releases/latest/download/kaeru-installer.ps1 | iex"It downloads
kaeru.exefrom the latest release, puts it in.cargo\binin your home folder, and adds that folder to your PATH. You don't need Rust for this.Other ways:
- With Scoop:
scoop bucket add gloomydumber https://github.com/gloomydumber/scoop-bucket, thenscoop install gloomydumber/kaeru. - With Rust:
cargo install kaeru --lockedbuilds it. - Download the archive for your system from the release page, and put
kaeruorkaeru.exein any folder on your PATH.
- With Scoop:
-
Run
kaeru install. To learn about your tabs, kaeru needs two things, and it asks before it adds each one:- a line in your PowerShell profile, and in Git Bash's
~/.bashrcwhen you have Git Bash, which tells kaeru about each new tab and keeps track of its folder (on macOS, the line goes in~/.zshrc, and in fish'sconfig.fishwhen you have fish; on Linux, in~/.bashrc,~/.zshrcandconfig.fish, for the shells you have); - a
SessionStarthook for each agent you use, Claude Code and Codex, which tells kaeru which conversation runs in which tab. It keeps a copy of each agent's file as it was.
If you use Codex, it also asks whether the tabs it tracks should start Codex with
--no-daemon. Otherwise Codex runs its sessions in a shared background server, which hides which tab a session runs in, so kaeru has to work that out from when and where the session started. Codex's remote control needs that server, so the sessions started this way can't use it. - a line in your PowerShell profile, and in Git Bash's
-
If you use Codex, start it. It asks about the new kaeru hook: trust it, because Codex runs a new hook only after you trust it. Codex's
/hookslists it too. Codex runs the hook at a session's first message, so kaeru learns about a Codex session once you sent one; until then, its tab comes back as a plain shell. Claude Code runs its hook as soon as it starts. -
Open a new tab and run
kaeru doctor. It checks the setup and says what to fix.
Commands
| Command | What it does |
|---|---|
kaeru |
Shows the tabs that are waiting to come back, and reopens the ones you pick. |
kaeru list |
Prints the tabs that kaeru tracks, one line each: the open ones, and the ones waiting to come back. |
kaeru install |
Sets kaeru up, as Install describes. |
kaeru doctor |
Checks the setup, and says what to fix. |
kaeru options |
Shows the options, and lets you change them. o in the list shows them too. |
kaeru resume |
Resumes the agent session that ran in this tab, in a terminal that brought the tab back by itself, such as Warp. |
kaeru uninstall |
Takes out everything that kaeru install added, asking before each change. It can also delete kaeru's notes and options. |
kaeru --help lists them too. The line in your profile and the agents' hooks run three more
commands for you, so you never need to type them: kaeru init, kaeru shell start and
kaeru hook.
Options
Run kaeru options to see and change them, or press o in the list. In Git Bash's own window,
run winpty kaeru options, because the list needs a Windows console there. They are kept in
%APPDATA%\kaeru\config.toml on Windows, in
~/Library/Application Support/kaeru/config.toml on macOS, and in ~/.config/kaeru/config.toml
on Linux.
| Option | In config.toml |
Default | What it does |
|---|---|---|---|
| Offer tabs that ran an agent session | offer-agents |
on | Lists tabs where an agent session, such as Claude Code, ran. |
| Offer tabs that ran only a shell | offer-shells |
on | Lists plain shell tabs too. |
| Show this list in the first new tab | ask-on-start |
on | Opens the list by itself after the terminal closed. When it's off, a new tab only says how many tabs wait, and you run kaeru to see them. |
| Offer a closed window of a single-window terminal | single-window-close |
"forget" |
What closing a Git Bash window (mintty) means. "forget": you closed it on purpose, like a tab, so it comes back only after a restart or sign-out. "offer": it is offered the next time, like a terminal that closed. |
Start Codex with --no-daemon |
codex-no-daemon |
set by kaeru install |
Runs Codex sessions in their tab, so that kaeru knows exactly where each one is. |
Roadmap
kaeru is built in milestones. Each milestone is finished and tested before the next one starts.
| Milestone | Scope | Status |
|---|---|---|
| M0 | Foundation: project layout, docs and CI | done |
| M1 | Windows Terminal and PowerShell, Claude Code and Codex, the picker | done |
| M2 | Git Bash (mintty) and bash | done |
| M3 | Warp: resume agent sessions in the tabs that Warp brings back | done |
| M4 | macOS: Terminal, iTerm2 and Ghostty, with zsh | done |
| M5 | Linux: GNOME Terminal, kitty, WezTerm and Ghostty, with bash, zsh and fish | done, tested without a real Linux desktop (verify) |
| M6 | The list and messages: easier to read and use, on Windows first, then macOS and Linux | planned |
| M7 | Popular add-ons of each shell and terminal, one at a time, such as Oh My Zsh, Powerlevel10k, Oh My Posh and starship | planned |
Later: the classic Windows console, more agents (such as Gemini CLI), re-running the command a tab was running, split panes, and more package managers (winget, which is in review, and Homebrew).
Contributing
Please read CONVENTIONS.md first. AGENTS.md lists the build and test commands. It is written for coding agents, but it works just as well for people.
License
kaeru is released under the MIT license.
kaeru is an independent project. It is not affiliated with or endorsed by Anthropic, OpenAI, Microsoft, or the makers of any terminal it supports.