Sync global ~/.claude/ config to sandbox (settings, memory, CLAUDE.md)

This commit is contained in:
Harivansh Rathi 2026-03-09 23:26:11 -07:00
parent ec7919c4ba
commit 531d5bfc16
2 changed files with 22 additions and 4 deletions

View file

@ -108,9 +108,9 @@ rsync -avz --progress \
"$(pwd)/" "node@$HANDLE:$REMOTE_WORKSPACE/"
```
### Step 8: Sync the Claude session history
### Step 8: Sync the Claude session and config
Transfer the local `.claude/` directory (session history, settings, memory) so the remote Claude session has full context:
Transfer the project-level `.claude/` directory (session history, project memory) if it exists:
```bash
rsync -avz --progress \
@ -118,6 +118,16 @@ rsync -avz --progress \
"$(pwd)/.claude/" "node@$HANDLE:$REMOTE_WORKSPACE/.claude/"
```
Also sync the global `~/.claude/` directory (global settings, global memory, credentials, CLAUDE.md):
```bash
rsync -avz --progress \
-e "ssh $SSH_OPTS" \
"$HOME/.claude/" "node@$HANDLE:/home/node/.claude/"
```
Both are needed: the project-level `.claude/` has session history for `--continue`, and the global `~/.claude/` has settings, global memory, and the user's global CLAUDE.md instructions.
### Step 9: Transfer environment variables
Capture relevant env vars (especially ANTHROPIC_API_KEY) and send them to the sandbox: