Skip to content

feat(handoff-sync): track the TILSIT handoff Drive sync - #14

Merged
twistedmelonman merged 1 commit into
mainfrom
claude/feat-handoff-sync-c12c445b
Oct 26, 2026
Merged

twistedmelonman merged 1 commit into
mainfrom
claude/feat-handoff-sync-c12c445b

Conversation

@twistedmelonman

Copy link
Copy Markdown
Member

handoff-sync.sh keeps ~/.claude/handoffs on TILSIT in two-way sync with the Google Drive folder Claude Handoff. It was written on 2026-10-22 straight into ~/.local/bin, outside any repo. TILSIT has no Drive app (andrewrich has no GUI session there), so this script is the only path for handoffs between TILSIT and other machines.

Changes

  • handoff-sync.sh: same rclone bisync call as the live copy. Restructured to match disk-space-alert.sh: RCLONE_BIN and the three paths can be overridden, main() sits behind a source guard, and a missing rclone writes an error to the sync log and exits 1. Before, it failed with no record, because cron discards output.
  • tests/handoff-sync.bats: 11 tests with a stub rclone. They cover the bisync arguments, exit-status passthrough, missing rclone, log trimming at the 2000-line boundary, the full default path (cron's PATH has no Homebrew), and the source guard.
  • README: a row under "Credentials & automation".

Verification

  • shellcheck -S info is clean, and 11 of 11 tests pass locally.
  • I broke a scratch copy three ways (dropped --recover, changed the trim to >=, removed the source guard). Each fault made at least one test fail.
  • One real run of the repo copy against Drive exited 0, and the log has 0 ERROR lines.

Review note

The commit-time code-reviewer passed the change with one WARNING: trim_log swaps the log through a fixed .tmp name, so two overlapping runs could lose log lines. That needs a sync longer than the 5-minute cron interval, and current runs take about 4 seconds. The loss would be log lines only, never handoffs, and the live copy trims the same way. Left as is.

After merge

Replace ~/.local/bin/handoff-sync.sh with a symlink to this file. The crontab entry keeps the same path.

handoff-sync.sh was written on 2026-10-22 straight into ~/.local/bin on
TILSIT, outside any repo, so losing that disk would lose it. It is the
only thing that moves Claude handoffs between TILSIT and Google Drive:
TILSIT has no Drive app, because andrewrich has no GUI session there.

The rclone bisync call is unchanged. The script now follows this repo's
shape: RCLONE_BIN and the three paths are overridable for tests, main()
sits behind a source guard, and a missing rclone is logged to the sync
log and exits 1 instead of failing with no record (cron discards
output). The log-trim comment said "trim to the last 2000 lines"; the
code keeps 1000 once the log passes 2000, and the constants now say so.

After merge, ~/.local/bin/handoff-sync.sh becomes a symlink to this
file. The crontab entry keeps the same path.
@twistedmelonman
twistedmelonman merged commit 0530fd8 into main Oct 26, 2026
6 checks passed
@twistedmelonman
twistedmelonman deleted the claude/feat-handoff-sync-c12c445b branch October 26, 2026 18:20
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