Skip to content

mini: auto-handoff watcher for idle T3 Claude threads - #52

Merged
Jish2 merged 2 commits into
mainfrom
feat/auto-handoff
Oct 21, 2026
Merged

Jish2 merged 2 commits into
mainfrom
feat/auto-handoff

Conversation

@Jish2

@Jish2 Jish2 commented Oct 20, 2026

Copy link
Copy Markdown
Owner

What

Adds fleet.autoHandoff (modules/darwin/auto-handoff) and enables it on mini.

Reopening a T3 thread after its 1-hour prompt cache expires re-bills its whole context. Every 5 minutes, the LaunchAgent org.jgoon.auto-handoff reads Claude Code's session logs. When a T3 Claude thread has been idle 40–50 minutes with at least 60k tokens of context, it POSTs a signed request to a T3 webhook task. That task's Haiku agent asks the thread to write a handoff doc to ~/.handoffs/<project>/ while the cache is still cheap to read. The watcher itself makes no model calls.

/catch-up (the catch-up skill in Jish2/skills, already synced) reads these docs, and also covers machines without the watcher.

Before merging / switching

Do the one-time setup in FLEET.md "Auto-handoff" first: a signing secret in the Keychain, a Haiku relay thread with the webhook task, and the webhook URL in the Keychain. Without it, the agent logs missing webhook url/secret every 5 minutes and sends nothing.

Notes

  • It's a LaunchAgent, not a daemon, because T3's own service is a LaunchAgent and the URL and secret live in the login Keychain. No secrets in the repo.
  • The watcher imports handoffs.py from ~/.claude/skills/catch-up/scripts (the synced skill).
  • Mapping a session to its thread reads T3's private state DB read-only. If a T3 update changes the schema, it logs "no T3 thread found" and sends nothing.
  • Moved here from ~/github/session-handoff, which can be deleted after merge.

Checked

  • nix eval of the mini agent's serviceConfig, and nix build --dry-run .#darwinConfigurations.mini.system.
  • A dry run of the store copy of the script on mini against real sessions.
  • Not switched: nothing has been applied to mini.

🤖 Generated with Claude Code

@claude

claude Bot commented Oct 20, 2026

Copy link
Copy Markdown

Claude review: no issues found

Checked the full diff (auto_handoff.py, the nix module, flake/mini wiring, relay prompt, FLEET.md) for bugs and CLAUDE.md compliance (no CLAUDE.md in repo). No earlier reviews or comments existed.

Approved: all approval conditions held.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Self-contained opt-in watcher; no bugs found, no .github/ or install.sh changes.

@claude

claude Bot commented Oct 21, 2026

Copy link
Copy Markdown

Claude review: no issues found

Read the full diff (auto_handoff.py, nix module, flake/mini wiring, relay prompt, FLEET.md) for bugs and CLAUDE.md compliance (no CLAUDE.md in repo); the earlier Claude review had no open findings and nothing else has been raised.

Approved: all approval conditions held.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Self-contained opt-in watcher; no bugs found, no .github/ or install.sh changes.

Jish2 and others added 2 commits October 20, 2026 17:10
fleet.autoHandoff runs org.jgoon.auto-handoff (LaunchAgent, every 5 min).
T3 Claude threads idle 40-50 min with >= 60k tokens of context get a signed
POST to a T3 webhook task, whose Haiku agent asks the thread to write a
handoff while its prompt cache is still warm. Enabled on mini; one-time
Keychain + webhook setup in FLEET.md "Auto-handoff".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jish2
Jish2 force-pushed the feat/auto-handoff branch from be82b55 to 6a98848 Compare October 21, 2026 00:11
@claude

claude Bot commented Oct 21, 2026

Copy link
Copy Markdown

Claude review: no issues found

Read the full diff (auto_handoff.py, nix module, flake/mini wiring, relay prompt, FLEET.md) for bugs and CLAUDE.md compliance (no CLAUDE.md in repo). The change since the last review is the added User-Agent header in the webhook request, which is correct. The earlier Claude reviews had no open findings.

Approved: all approval conditions held.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Self-contained opt-in watcher; the new User-Agent header is correct, no bugs found, no .github/ or install.sh changes.

@Jish2
Jish2 merged commit e52837a into main Oct 21, 2026
1 check passed
@Jish2
Jish2 deleted the feat/auto-handoff branch October 21, 2026 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant