diff --git a/hive-ag3nt/src/turn.rs b/hive-ag3nt/src/turn.rs index 8edea91..1c49981 100644 --- a/hive-ag3nt/src/turn.rs +++ b/hive-ag3nt/src/turn.rs @@ -241,6 +241,16 @@ async fn run_claude( )); } let mut cmd = Command::new("claude"); + // Spawn inside /state so any path claude resolves relatively (Read + // foo.md, Bash ls, Write notes.md) lands in the agent's durable + // dir instead of wherever the harness systemd unit started. /state + // is bind-mounted RW from the host so survives destroy/recreate. + // Fall back silently if the dir is missing (dev / test setups + // running without the bind mount) — Command picks up the parent's + // cwd in that case. + if std::path::Path::new("/state").is_dir() { + cmd.current_dir("/state"); + } cmd.arg("--print") .arg("--verbose") .arg("--output-format")