refactor(#2058): drop claude.md docs pointer, keep nix option + --add-dir

This commit is contained in:
damocles 2026-06-29 01:17:29 +02:00 committed by mara
commit cd5b731884
4 changed files with 22 additions and 54 deletions

View file

@ -695,17 +695,14 @@ async fn run_claude(prompt: &str, files: &TurnFiles, bus: &Bus) -> Result<(bool,
.arg("--allowedTools")
.arg(mcp::allowed_tools_arg());
// hyperhive.docs.enable wires HIVE_DOCS_DIR to the in-container
// reference-docs dir (the docs/ tree plus a generic `CLAUDE.md`
// pointer at its root). Expose it to claude as an additional
// directory so the docs are readable, and enable additive CLAUDE.md
// loading so claude picks up `<dir>/CLAUDE.md` ALONGSIDE the agent's
// own memory files — never clobbering ~/.claude/CLAUDE.md or the
// project one. Unset (docs disabled) → neither flag is passed.
// reference-docs tree. Expose it to claude as an additional
// directory so the docs are readable; the agent is NOT pointed at
// them (no CLAUDE.md autoload) — surfacing a pointer is the open
// follow-up. Unset (docs disabled) → the flag is not passed.
if let Some(docs_dir) = std::env::var_os("HIVE_DOCS_DIR")
&& !docs_dir.is_empty()
{
cmd.arg("--add-dir").arg(&docs_dir);
cmd.env("CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD", "1");
}
let mut child = cmd
.stdin(Stdio::piped())