Synopsis
c
Description
Thecheckpoint command integrates an agent’s work back into your main worktree by rebasing the agent’s branch onto your current branch. This allows you to incorporate successful agent changes while maintaining a clean git history.
The command:
- Commits any uncommitted changes in the agent’s worktree
- Rebases the agent’s branch onto your current branch
- Preserves the full commit history from the agent’s work
Arguments
The name of the agent whose changes you want to checkpoint. This is the short name shown in
uzi ls output (e.g., thoughtful-tesla).Commit message for any uncommitted changes in the agent’s worktree. If the agent has already committed everything, this is used but may not create a new commit.
How It Works
Find Agent Session
Locates the active session matching the provided agent name by searching all active sessions for the current repository.
Validate
- Verifies the agent’s branch exists
- Confirms the agent’s worktree is accessible
- Gets the current branch in your main worktree
Commit Agent Changes
Stages and commits all uncommitted changes in the agent’s worktree using the provided commit message.
Calculate Merge Base
Finds where the agent’s branch diverged from your current branch using
git merge-base.Examples
Basic Checkpoint
Full Workflow
Multiple Checkpoints
Understanding Rebase
The checkpoint usesgit rebase to integrate changes:
Commit Count
The command shows how many commits will be integrated:Output
Example output:Git Operations Performed
In the agent’s worktree:Error Handling
Agent Not Found
Agent Not Found
uzi ls and use the exact name shown.Branch Does Not Exist
Branch Does Not Exist
git branch -a.Rebase Conflicts
Rebase Conflicts
- Resolve conflicts in your files
git addresolved filesgit rebase --continue
Invalid State
Invalid State
~/.local/share/uzi/state.json.Best Practices
Review Before Checkpointing
Review Before Checkpointing
Always review the agent’s changes before checkpointing:
Test Agent Changes
Test Agent Changes
Verify the agent’s code works before integrating:
Descriptive Commit Messages
Descriptive Commit Messages
Use meaningful commit messages that describe the agent’s contribution:
Clean Up After
Clean Up After
Kill the agent after successful checkpoint to free resources:
When to Checkpoint
Good times to checkpoint:
- Agent completed the requested task
- Tests pass in agent’s environment
- Code review of agent’s changes is complete
- You want to preserve incremental progress
Alternative: Manual Integration
If you prefer manual control:Related Commands
prompt- Create agents whose work you’ll checkpointls- See agent status before checkpointingrun- Test agent code before checkpointingkill- Clean up agent after checkpointing
Notes
The checkpoint command operates on your current branch. Make sure you’re on the correct branch before running the command.