From ee5238cb0f228f4ef2b1abaae72a9d30b4c8396a Mon Sep 17 00:00:00 2001 From: sandcage-export Date: Fri, 22 May 2026 23:18:32 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A5=87=20export=20from=20upstream=20(f22c?= =?UTF-8?q?a70)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- compose/docker-compose.yml | 2 ++ crates/sandcage/src/init.rs | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/compose/docker-compose.yml b/compose/docker-compose.yml index 80b23d9..bfc228e 100644 --- a/compose/docker-compose.yml +++ b/compose/docker-compose.yml @@ -6,6 +6,7 @@ services: volumes: - ${SANDCAGE_WORKSPACE}:${SANDCAGE_CONTAINER_DIR} - ${SANDCAGE_HOME}/.claude:/home/agent/.claude + - ${SANDCAGE_HOME}/.claude.json:/home/agent/.claude.json - ${SANDCAGE_GLOBAL_JUSTFILE}:/home/agent/.justfile:ro environment: - HOME=/home/agent @@ -32,6 +33,7 @@ services: volumes: - ${SANDCAGE_WORKSPACE}:${SANDCAGE_CONTAINER_DIR} - ${SANDCAGE_HOME}/.claude:/home/agent/.claude + - ${SANDCAGE_HOME}/.claude.json:/home/agent/.claude.json - ${SANDCAGE_HOME}/.codex:/home/agent/.codex - ${SANDCAGE_GLOBAL_JUSTFILE}:/home/agent/.justfile:ro environment: diff --git a/crates/sandcage/src/init.rs b/crates/sandcage/src/init.rs index c8a85a8..8d408ed 100644 --- a/crates/sandcage/src/init.rs +++ b/crates/sandcage/src/init.rs @@ -51,7 +51,14 @@ pub fn preseed_with_home(home: &Path) -> Result<()> { println!("sandcage: seeded {} from template", settings_dest.display()); } - // 4. Create an empty Justfile if absent + // 4. Seed .claude.json so the bind mount targets a file, not a directory + let claude_json = sandcage_home.join(".claude.json"); + if !claude_json.exists() { + std::fs::write(&claude_json, "{}\n") + .map_err(|e| InitError::WriteFileFailed(claude_json.clone(), e))?; + } + + // 5. Create an empty Justfile if absent let justfile = sandcage_home.join("Justfile"); if !justfile.exists() { std::fs::write(&justfile, "")