aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorIgor Soarez <igor@soarez.org>2026-10-23 15:08:53 +0300
committerIgor Soarez <igor@soarez.org>2026-10-23 15:08:53 +0300
commit7520141a55e8876824dcb4e2cf5e8e3027efa59d (patch)
tree02022949d5b9bd41c5421ae7134ca8816f4b045b /README.md
parenta7d34521c7f874beb44e0314017ab28979550495 (diff)
restore Claude Code agents in their own sessions
`dingger install claude` adds a SessionStart hook to Claude's settings (every other key and hook kept, in order; the original backed up; written through a symlink; installing again changes nothing). The hook is `dingger hook claude`: it reports the session's transcript for its tmux pane, prints nothing (Claude adds SessionStart output to the conversation) and always exits 0. Claude's state still comes from its screen. restore types `claude --resume <id>` in the directory the session ran in (elsewhere, Claude moves the conversation there). it resumes an agent only when its session file exists: a Claude session that never got a message has no transcript, and `--resume` fails ("No conversation found"). the snapshot now keeps an agent's command line too, so such a pane gets it retyped instead of nothing. - the hook receiver takes a report without a state: only the session. - a report that arrives after the watcher listed the panes is not dropped as "agent gone": Claude reports once, as it starts. - serde_json preserve_order (indexmap is already a dependency, via toml). e2e step 18: install against a settings file like a real one, a fake claude running the exact installed hook command, resume by id, retype without a transcript, the resumed agent reporting again. a server that restore starts now gets the test's plain shells: it got the user's login shell, whose profile put the real claude first, which started (stuck at its trust dialog) during development. every test restore now checks that no real pi or claude runs in a test pane.
Diffstat (limited to 'README.md')
-rw-r--r--README.md15
1 files changed, 12 insertions, 3 deletions
diff --git a/README.md b/README.md
index 475f659..9a67c2d 100644
--- a/README.md
+++ b/README.md
@@ -64,9 +64,12 @@ than a poll is still a completion.
to preview, `--list` for saved snapshots, `--session` for some). Sessions
that exist are left alone, except a bare one of the same name (what a
terminal creates on startup), which is replaced with its clients moved
- over. Agents are resumed in their own sessions (pi: `pi --session
- <file>`, reported by the pi extension); agents that were mid-turn are
- listed. Other panes get the command line that was running typed at the
+ over. Agents are resumed in their own sessions: pi with `pi --session
+ <file>` (reported by the pi extension), Claude Code with `claude --resume
+ <id>` (reported by its SessionStart hook, `dingger install claude`), in
+ the directory they ran in. A session that never got a message has nothing
+ to resume, so its command line is typed instead. Agents that were
+ mid-turn are listed. Other panes get the command line that was running typed at the
prompt, not run: exactly as typed with the zsh hook (`dingger install
zsh`, then source the file it names from your `.zshrc`), otherwise the
program's arguments. An agent or program that exits within a minute
@@ -89,6 +92,10 @@ than a poll is still a completion.
1. **Agent hooks** (authoritative): `dingger install pi` installs a pi
extension that reports working/blocked/idle over
`~/.local/state/dingger/agent.sock`. Restart running pi agents to load it.
+ `dingger install claude` adds a SessionStart hook to
+ `~/.claude/settings.json` (keeping everything else; the original is
+ backed up to `settings.json.bak-dingger`) that reports only Claude's
+ session, for restore; its state comes from screen matching.
2. **Screen matching** (fallback): `capture-pane` text through herdr's
manifests, for agents without hooks.
@@ -102,6 +109,8 @@ dingger watch # the daemon (run by launchd, see below)
dingger status # agents in priority order
dingger focus [--pane ID] # jump to an agent (default: the top waiter)
dingger install pi # install the pi state-reporting extension
+dingger install claude # report Claude Code sessions, for restore
+dingger install zsh # record typed command lines, for restore
dingger manifests update # refresh manifests from herdr's catalog
```