diff --git a/hive-ag3nt/prompts/docs-pointer.md b/hive-ag3nt/prompts/docs-pointer.md new file mode 100644 index 00000000..21cd380e --- /dev/null +++ b/hive-ag3nt/prompts/docs-pointer.md @@ -0,0 +1,19 @@ +# hyperhive reference docs + +The hyperhive reference docs are mounted read-only in this directory +(the harness exposes the path as `$HIVE_DOCS_DIR`). They are the +canonical reference for how this swarm actually works - the turn loop, +the tool surface, persistence, conventions, runbooks, and the +approval/CI/forge/matrix workflows. + +- On a fresh deploy, or any time you are unsure how a hyperhive + mechanism behaves, read `setup.md` first, then the topic file for the + area you are touching (e.g. `turn-loop.md`, `persistence.md`, + `tools/`, `conventions.md`, `gotchas.md`). +- Prefer these docs over guessing: they describe the live system, not a + generic one. + +This pointer is additive. It does not replace your own memory or project +instructions - your `~/.claude/CLAUDE.md` and any harness/project memory +still apply in full. Nothing here overrides what you already know about +yourself; it only tells you where the shared reference material lives. diff --git a/hive-ag3nt/src/turn.rs b/hive-ag3nt/src/turn.rs index 509bd435..523ed568 100644 --- a/hive-ag3nt/src/turn.rs +++ b/hive-ag3nt/src/turn.rs @@ -708,10 +708,12 @@ 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 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. + // reference-docs tree (with a generic CLAUDE.md pointer at its root). + // Expose it to claude as an additional directory so the docs are + // readable; harness-base.nix also sets + // CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD=1 so claude loads that + // pointer additively (never replacing the agent's own CLAUDE.md). + // Unset (docs disabled) → the flag is not passed. if let Some(docs_dir) = std::env::var_os("HIVE_DOCS_DIR") && !docs_dir.is_empty() { diff --git a/nix/templates/harness-base.nix b/nix/templates/harness-base.nix index f75c3343..7b98750e 100644 --- a/nix/templates/harness-base.nix +++ b/nix/templates/harness-base.nix @@ -100,6 +100,22 @@ let iconPng = pkgs.runCommand "hive-agent-icon.png" { nativeBuildInputs = [ pkgs.librsvg ]; } '' rsvg-convert -f png -w 512 -h 512 ${config.hyperhive.icon} -o $out ''; + # hyperhive.docs.enable: the reference-docs tree (`pkgs.hyperhive-docs`, + # the repo `docs/` verbatim) with a generic `CLAUDE.md` pointer dropped + # at the root. The harness passes this dir to claude via `--add-dir`; + # paired with `CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD=1` claude + # loads `