Skip to main content

Git Bundles

When Claude makes file changes in the Chucky cloud sandbox, those changes are packaged as git bundles. The CLI provides a git-like workflow to fetch, review, and apply these changes to your local repository.

Overview

The bundle workflow mirrors familiar git operations:
CommandDescriptionGit Equivalent
chucky fetchDownload changes to a local branchgit fetch
chucky diffView pending changesgit diff
chucky logView commit historygit log
chucky applyApply changes to working directorygit merge
chucky discardRemove fetched branchgit branch -D
chucky pullFetch + apply in one stepgit pull

Fetch Changes

Download changes from a session or job to a local branch:
chucky fetch <session-id|job-id>

Options

OptionDescription
--jsonOutput JSON result
--quietMinimal output

Example

# Fetch from a session (partial IDs work)
chucky fetch abc12345

# Fetch from a job
chucky fetch run_xyz789abc
This creates a local branch named chucky/session-<id> or chucky/job-<id>.

View Changes

Diff

See what files were changed:
# Full diff output
chucky diff abc12345

# Summary statistics only
chucky diff abc12345 --stat

# JSON output
chucky diff abc12345 --json

Log

View commit messages from the session:
chucky log abc12345

# JSON output
chucky log abc12345 --json

Apply Changes

Apply the fetched changes to your working directory:
chucky apply <session-id|job-id>

Options

OptionDescription
--forceForce merge even if branches diverged
--jsonOutput JSON result
--quietMinimal output

Merge Behavior

The apply command:
  1. First attempts a fast-forward merge
  2. If branches have diverged, automatically falls back to a merge commit
  3. If there are conflicts, reports them for manual resolution
# Normal apply
chucky apply abc12345

# Force merge commit (useful when branches diverged)
chucky apply abc12345 --force

Discard Changes

Remove the fetched branch without applying:
chucky discard <session-id|job-id>
This is idempotent - it won’t error if the branch doesn’t exist.

Pull (Fetch + Apply)

Combine fetch and apply in one command:
chucky pull <session-id|job-id>

Options

OptionDescription
--forceForce merge during apply
--jsonOutput JSON result
--quietMinimal output

Auto-Apply with Prompts

Use the --apply flag with chucky prompt to automatically apply changes when the session completes:
chucky prompt "Add input validation to the user form" --apply
This:
  1. Runs the prompt
  2. Waits for completion
  3. Fetches the bundle
  4. Applies changes to your working directory
Similarly for jobs:
chucky jobs create "Refactor authentication module" --apply

Working with IDs

Both session IDs and job IDs work with all bundle commands:
# Session IDs are UUIDs, but partial IDs work
chucky fetch abc12345              # First 8 chars of session ID
chucky fetch abc12345-6789-...    # Full session ID

# Job IDs start with run_
chucky fetch run_xyz789abc

Branch Naming

Fetched bundles create branches with predictable names:
  • Sessions: chucky/session-<full-session-id>
  • Jobs: chucky/job-<job-id>
You can work with these branches directly using git commands if needed:
git log chucky/session-abc12345...
git diff chucky/session-abc12345
git checkout chucky/session-abc12345

Common Workflows

Review Before Apply

# Fetch and review
chucky fetch abc12345
chucky diff abc12345 --stat
chucky log abc12345

# If looks good, apply
chucky apply abc12345

# Or discard if not wanted
chucky discard abc12345

Quick Apply

# Trust Claude and apply immediately
chucky pull abc12345

Automated Pipeline

# Use JSON output for scripting
result=$(chucky pull abc12345 --json)
if echo "$result" | jq -e '.status == "applied"' > /dev/null; then
  echo "Changes applied successfully"
  npm test
fi

Error Handling

ErrorCauseSolution
Branch already existsAlready fetchedUse apply or discard first
Branch not foundHaven’t fetched yetRun fetch first
No bundle availableSession made no changesNothing to apply
Merge conflictLocal changes conflictResolve conflicts manually

Next Steps