You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add devc sync to copy devcontainer sessions to host (#27)
* Add `devc sync` to copy devcontainer sessions to host for /insights
Claude Code's /insights reads sessions from ~/.claude/projects/ on
the host, but devcontainer sessions live inside container volumes.
This adds a `devc sync [project]` command that copies them over so
/insights can analyze devcontainer work alongside local sessions.
- Auto-discovers devcontainers via devcontainer.local_folder label
- Works on both running and stopped containers (docker cp only)
- Reads CLAUDE_CONFIG_DIR from container env for non-standard paths
- Incremental: only copies new/updated files
- Optional project name filter (case-insensitive substring)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Add devc sync to README
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Add safety prompt to `devc sync` before copying from containers
Warns users that sync copies files from devcontainers to the host
filesystem. Adds --trusted flag to skip the prompt for automation.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -125,10 +125,24 @@ devc shell Open zsh shell in container
125
125
devc exec CMD Execute command inside the container
126
126
devc upgrade Upgrade Claude Code in the container
127
127
devc mount SRC DST Add a bind mount (host → container)
128
+
devc sync [NAME] Sync Claude Code sessions from devcontainers to host
128
129
devc template DIR Copy devcontainer files to directory
129
130
devc self-install Install devc to ~/.local/bin
130
131
```
131
132
133
+
## Session Sync for `/insights`
134
+
135
+
Claude Code's `/insights` command analyzes your session history, but it only reads from `~/.claude/projects/` on the host. Sessions inside devcontainer volumes are invisible to it.
136
+
137
+
`devc sync` copies session logs from all devcontainers (running and stopped) to the host so `/insights` can include them:
138
+
139
+
```bash
140
+
devc sync # Sync all devcontainers
141
+
devc sync crypto # Filter by project name (substring match)
142
+
```
143
+
144
+
Devcontainers are auto-discovered via Docker labels — no need to know container names or IDs. The sync is incremental, so it's safe to run repeatedly.
0 commit comments