diff --git a/src/vm.ts b/src/vm.ts index ed100ca..49b8d4c 100644 --- a/src/vm.ts +++ b/src/vm.ts @@ -108,7 +108,15 @@ export async function status(): Promise<"running" | "stopped" | "missing"> { /** Launch claude in the container at the given workdir. */ export async function claude(workdir: string, prompt?: string): Promise { - const args = ["container", "exec", "-it", "--user", USER, "--workdir", containerPath(workdir), CONTAINER_NAME, CLAUDE_BIN, "--dangerously-skip-permissions"] + const cwd = containerPath(workdir) + const systemPrompt = [ + "You are running inside a sandlot container (Apple Container, ubuntu:24.04).", + `Your working directory is ${cwd}, a git worktree managed by sandlot.`, + "The host's ~/dev is mounted read-only at /host.", + "The host's ~/.sandlot is mounted at /sandlot.", + ].join("\n") + + const args = ["container", "exec", "-it", "--user", USER, "--workdir", cwd, CONTAINER_NAME, CLAUDE_BIN, "--dangerously-skip-permissions", "--append-system-prompt", systemPrompt] if (prompt) args.push(prompt) const proc = Bun.spawn(args, { stdin: "inherit", stdout: "inherit", stderr: "inherit" }) await proc.exited