New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

baton-cli

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

baton-cli

Git-backed session handoff for Claude Code

latest
Source
npmnpm
Version
0.6.2
Version published
Weekly downloads
40
263.64%
Maintainers
1
Weekly downloads
 
Created
Source

Baton Banner

npm version CI

Git-backed session handoff for Claude Code.

Continue the same coding session on another machine without losing context.

baton push   # on machine A
baton pull   # on machine B

Why

CLI coding agent sessions are trapped on one machine:

  • Session context doesn't travel between devices
  • The same repo lives at different absolute paths on different machines
  • macOS, Linux, and Windows use different paths and home directories
  • Existing tools sync config, not coding sessions

Baton fixes this. Push your session, pull it elsewhere, keep working.

Install

npm install -g baton-cli

Requirements: Node.js 18+, Git, GitHub CLI (authenticated)

Quick start

# On machine A — push your sessions
cd ~/work/my-project
baton push

# On machine B — pull and continue
cd ~/projects/my-project
baton pull

On first run, baton push creates a private GitHub repo (baton-sessions by default) to store your session data. On another machine, baton pull auto-detects this repo from your GitHub account.

How it works

  • Auto-detect the project from git remote in the current directory
  • Collect all Claude Code sessions, tool results, and project memory
  • Virtualize absolute paths into portable placeholders (${PROJECT_ROOT}, ${HOME}, ${TMP})
  • Push the checkpoint to your private GitHub repo
  • On another machine, pull and expand placeholders to local paths
  • Claude Code picks up the restored sessions automatically

What gets synced

ComponentSyncedWhy
Session conversation logsYesAll sessions for the project
Tool resultsYesSmall, needed for reference integrity
Project memoryYesTiny, valuable for continuity
Subagent logsNoToo large, results already in main conversation

CLI reference

baton push              # push all sessions for this project
baton push --force      # overwrite remote even if ahead
baton pull              # restore sessions locally
baton status            # show current project and sync state

Cross-platform path handling

Same repo, different machines:

MachinePath
macOS/Users/you/work/my-project
Linux/home/you/projects/my-project
WindowsC:\Users\you\my-project

Baton replaces absolute paths with portable placeholders on push and expands them to local paths on pull. Longest paths are replaced first to prevent partial matches.

Conflict guard

baton push checks if the remote has changes you haven't pulled. If so, it refuses to push to prevent accidental overwrites.

baton push          # refused — remote is ahead
baton pull          # pull first
baton push          # now it works

baton push --force  # or override the check

Design principles

  • Project-aware: identity comes from git remote, not local paths
  • Checkpoint-first: restore from snapshots, not fragile live mirroring
  • Portable before native: prioritize continuity over perfect restoration
  • Git-backed: GitHub for durable history and recovery
  • Simple: two commands, no daemon, no config ceremony

What Baton is not

  • A real-time sync engine
  • A multi-user collaboration platform
  • A semantic memory system
  • A config sync tool

License

MIT

Keywords

claude-code

FAQs

Package last updated on 15 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts