mirror of
https://github.com/getcompanion-ai/companion-skill.git
synced 2026-04-15 03:00:42 +00:00
Sync global ~/.claude/ config to sandbox (settings, memory, CLAUDE.md)
This commit is contained in:
parent
ec7919c4ba
commit
531d5bfc16
2 changed files with 22 additions and 4 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -86,14 +86,22 @@ rsync -avz --progress \
|
|||
-e "$RSYNC_SSH" \
|
||||
"$LOCAL_DIR/" "node@$HANDLE:$REMOTE_WORKSPACE/"
|
||||
|
||||
# --- Sync Claude session ---
|
||||
# --- Sync project-level Claude session ---
|
||||
if [ -d "$LOCAL_DIR/.claude" ]; then
|
||||
echo "[offload] Syncing Claude session data..."
|
||||
echo "[offload] Syncing project Claude session data..."
|
||||
rsync -avz --progress \
|
||||
-e "$RSYNC_SSH" \
|
||||
"$LOCAL_DIR/.claude/" "node@$HANDLE:$REMOTE_WORKSPACE/.claude/"
|
||||
fi
|
||||
|
||||
# --- Sync global ~/.claude config (settings, memory, global session history) ---
|
||||
if [ -d "$HOME/.claude" ]; then
|
||||
echo "[offload] Syncing global ~/.claude config..."
|
||||
rsync -avz --progress \
|
||||
-e "$RSYNC_SSH" \
|
||||
"$HOME/.claude/" "node@$HANDLE:/home/node/.claude/"
|
||||
fi
|
||||
|
||||
# --- Transfer env vars ---
|
||||
echo "[offload] Transferring environment variables..."
|
||||
env | grep -v '^_=' | grep -v '^SHELL=' | grep -v '^TERM_' | grep -v '^SSH_' | \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue