pass SYSTEM.md as --append-system-prompt instead of relying on shard to Read it
This commit is contained in:
parent
ce5ed98482
commit
072058a8cc
1 changed files with 10 additions and 0 deletions
10
src/shard.rs
10
src/shard.rs
|
|
@ -98,6 +98,14 @@ impl ShardSession {
|
|||
pub async fn spawn(cfg: SpawnConfig<'_>) -> anyhow::Result<Self> {
|
||||
let identity_dir = paths::identity_dir();
|
||||
|
||||
// SYSTEM.md is the harness contract. Claude Code only auto-loads
|
||||
// CLAUDE.md from --add-dir, so SYSTEM.md gets passed explicitly via
|
||||
// --append-system-prompt to ensure the shard always sees it.
|
||||
let system_md_path = identity_dir.join("SYSTEM.md");
|
||||
let system_md = tokio::fs::read_to_string(&system_md_path)
|
||||
.await
|
||||
.with_context(|| format!("reading {}", system_md_path.display()))?;
|
||||
|
||||
let mut cmd = Command::new("claude");
|
||||
cmd.args([
|
||||
"--print",
|
||||
|
|
@ -114,6 +122,8 @@ impl ShardSession {
|
|||
cfg.allowed_tools,
|
||||
"--mcp-config",
|
||||
&cfg.mcp_config_path.to_string_lossy(),
|
||||
"--append-system-prompt",
|
||||
&system_md,
|
||||
]);
|
||||
cmd.current_dir(&identity_dir);
|
||||
cmd.stdin(Stdio::piped());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue