From 032f2f74dbae4d433ae9ccc9e84bee84900808af Mon Sep 17 00:00:00 2001 From: Danathar Date: Wed, 11 Nov 2026 15:21:18 -0500 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=9B=20claude=20auth:=20opt-in=20sw?= =?UTF-8?q?itch=20to=20keep=20one=20shared=20~/.claude=20so=20a=20token=20?= =?UTF-8?q?refresh=20reaches=20every=20agent?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Claude Code saves a refreshed OAuth token by renaming a temp file over .credentials.json. Since the per-agent ~/.claude split, that rename replaces the agent's credential link with a private file, so the refresh (which also rotates the grant) never reaches the shared login and the other agents log out about every 8 hours. HIVE_SHARED_CLAUDE_HOME=1 keeps ~/.claude as one whole-directory link to the shared Claude directory, the layout from before the split, so the rename lands in the shared login. A per-agent .claude is moved aside, never deleted. The per-kick memory wipe skips a CLI home that is a whole-directory link. Off by default. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1 Signed-off-by: Danathar --- .../fixed-shared-claude-home-switch.md | 1 + src/crux/agent/claude_credential_bridge.go | 6 + src/crux/agent/cli_memory.go | 10 +- src/crux/agent/cli_memory_test.go | 29 ++++ src/crux/agent/interactive_home.go | 3 + src/crux/agent/interactive_home_test.go | 112 +++++++++++++++ src/crux/agent/shared_claude_home.go | 129 ++++++++++++++++++ src/docs/agent-configuration.md | 15 ++ src/docs/agent-knowledge-and-memory.md | 4 + src/docs/env-vars.md | 1 + 10 files changed, 309 insertions(+), 1 deletion(-) create mode 100644 changelog.d/fixed-shared-claude-home-switch.md create mode 100644 src/crux/agent/shared_claude_home.go diff --git a/changelog.d/fixed-shared-claude-home-switch.md b/changelog.d/fixed-shared-claude-home-switch.md new file mode 100644 index 0000000000..ed215e5b97 --- /dev/null +++ b/changelog.d/fixed-shared-claude-home-switch.md @@ -0,0 +1 @@ +- Claude agents on hives with per-agent users no longer have to log out about every 8 hours: set `HIVE_SHARED_CLAUDE_HOME=1` to keep every agent's `~/.claude` as one whole-directory link to the shared `/data/home/.claude`, the layout from before [#17031](https://github.com/hivecommons/hive/issues/17031). Claude Code saves a refreshed token by renaming a file over `.credentials.json`; in a per-agent `~/.claude` that replaced the credential link, so the refresh never reached the shared login and the other agents were left on a rotated grant. With the directory linked, the refresh lands in the shared login. The switch is off by default. While it is on, Claude agents share `CLAUDE.md`, history, todos and memory again, a per-agent `.claude` is moved aside (never deleted) on the next launch, and `clear_on_kick` skips Claude. See `src/docs/agent-configuration.md`. diff --git a/src/crux/agent/claude_credential_bridge.go b/src/crux/agent/claude_credential_bridge.go index 4ca94d05f0..9cf9202698 100644 --- a/src/crux/agent/claude_credential_bridge.go +++ b/src/crux/agent/claude_credential_bridge.go @@ -375,6 +375,12 @@ func preserveClaudeCredential(path string, now time.Time) (string, error) { func (m *Manager) rebridgeClaudeCredential(agentName, link, target, trigger string) *claudeBridgeRepair { rep, err := m.repairClaudeCredentialBridge(agentName, link, target) if errors.Is(err, errClaudeBridgeLinkIsTarget) { + if sharedClaudeHomeForced() { + // The operator chose the whole-directory link + // (HIVE_SHARED_CLAUDE_HOME=1): the agent's credential path IS the + // shared login by design, so there is nothing to bridge or report. + return nil + } // The legacy layout: skipped, and said once per agent rather than on // every watchdog cycle. Not audited (nothing changed). if _, seen := claudeBridgeLegacyWarned.LoadOrStore(link, true); !seen { diff --git a/src/crux/agent/cli_memory.go b/src/crux/agent/cli_memory.go index f4a772a4da..92a671584a 100644 --- a/src/crux/agent/cli_memory.go +++ b/src/crux/agent/cli_memory.go @@ -171,7 +171,8 @@ func (m *Manager) seedCopilotMemorySetting(agent *AgentProcess, home string) { // agent might have run, under its own HOME and CODEX_HOME only. Shared-home // paths are never returned: under HIVE_SHARED_AGENT_HOME=1 (or a UID-0 // agent) the stores are fleet-shared and wiping them for one agent's kick -// would erase every other agent's memory too. +// would erase every other agent's memory too. The same holds for one CLI home +// that is a whole-directory link to the shared home (HIVE_SHARED_CLAUDE_HOME=1). func cliMemoryStorePaths(agent *AgentProcess, backend string) []string { if agent.UID <= 0 || sharedAgentHomeForced() { return nil @@ -179,6 +180,13 @@ func cliMemoryStorePaths(agent *AgentProcess, backend string) []string { home := AgentHome(agent.Name, agent.UID, backend) var paths []string for _, spec := range perAgentCLIHomes { + // A CLI home that is a whole-directory link into the shared home + // (HIVE_SHARED_CLAUDE_HOME=1, or a legacy bridge not yet retired) + // holds the fleet's stores, not this agent's: a path through it + // would wipe every other agent's memory too. + if info, err := os.Lstat(filepath.Join(home, spec.dir)); err == nil && info.Mode()&os.ModeSymlink != 0 { + continue + } for _, rel := range spec.memoryRel { matches, err := filepath.Glob(filepath.Join(home, spec.dir, filepath.FromSlash(rel))) if err != nil { diff --git a/src/crux/agent/cli_memory_test.go b/src/crux/agent/cli_memory_test.go index d2967488d0..5ea6171183 100644 --- a/src/crux/agent/cli_memory_test.go +++ b/src/crux/agent/cli_memory_test.go @@ -213,3 +213,32 @@ func TestClearCLIMemoryForKick_OffByDefaultAndNeverSharedHome(t *testing.T) { t.Errorf("uid 0 returned stores to wipe: %v", got) } } + +// A ~/.claude that is a whole-directory link to the shared home +// (HIVE_SHARED_CLAUDE_HOME=1, or a legacy bridge) holds every agent's memory: +// the per-kick wipe must never be handed a path through it. +func TestCLIMemoryStorePaths_SkipsWholeDirectoryLink(t *testing.T) { + shared := withSharedAgentHome(t) + home := interactiveHomePath("scanner") + sharedMem := filepath.Join(shared, ".claude", "projects", "-data-agents-coder", "memory") + if err := os.MkdirAll(sharedMem, 0o755); err != nil { + t.Fatal(err) + } + if err := os.MkdirAll(home, 0o755); err != nil { + t.Fatal(err) + } + if err := os.Symlink(filepath.Join(shared, ".claude"), filepath.Join(home, ".claude")); err != nil { + t.Fatal(err) + } + + on := &config.CLIMemoryConfig{ClearOnKick: true} + ap := &AgentProcess{Name: "scanner", UID: 1001, Config: config.AgentConfig{CLIMemory: on}} + if got := cliMemoryStorePaths(ap, "claude"); len(got) != 0 { + t.Errorf("a whole-directory link returned shared stores to wipe: %v", got) + } + m := interactiveHomeTestManager(t) + m.clearCLIMemoryForKick(ap, "claude") + if _, err := os.Stat(sharedMem); err != nil { + t.Errorf("the shared memory store was wiped through the link: %v", err) + } +} diff --git a/src/crux/agent/interactive_home.go b/src/crux/agent/interactive_home.go index 38b903f66c..92e5325f18 100644 --- a/src/crux/agent/interactive_home.go +++ b/src/crux/agent/interactive_home.go @@ -405,6 +405,9 @@ func (m *Manager) setupPerAgentCLIHomes(agentName, home string, uid int) { } func (m *Manager) setupPerAgentCLIHome(agentName, home string, uid int, spec perAgentCLIHome) { + if spec.dir == claudeHomeDirName && sharedClaudeHomeForced() && m.bridgeSharedClaudeHome(agentName, home) { + return + } dir := filepath.Join(home, spec.dir) shared := filepath.Join(sharedAgentHome, spec.dir) if info, err := os.Lstat(dir); err == nil && info.Mode()&os.ModeSymlink != 0 { diff --git a/src/crux/agent/interactive_home_test.go b/src/crux/agent/interactive_home_test.go index dd9ef8e4d7..97315148a3 100644 --- a/src/crux/agent/interactive_home_test.go +++ b/src/crux/agent/interactive_home_test.go @@ -677,3 +677,115 @@ func TestSweepOrphanedClaudeTmp(t *testing.T) { t.Errorf("real .claude.json must survive the sweep: %v", err) } } + +// HIVE_SHARED_CLAUDE_HOME=1: ~/.claude becomes a whole-directory link to the +// shared Claude directory, so a credential the CLI renames into place lands in +// the shared login. The per-agent directory is moved aside, never deleted, and +// the other CLI homes stay per agent. +func TestSetupInteractiveHome_SharedClaudeHomeLinksWholeDirectory(t *testing.T) { + shared := withSharedAgentHome(t) + t.Setenv("HIVE_SHARED_CLAUDE_HOME", "1") + m := interactiveHomeTestManager(t) + ap := &AgentProcess{Name: "scanner", UID: 1001, Config: config.AgentConfig{Backend: "claude"}} + home := interactiveHomePath("scanner") + sharedClaude := filepath.Join(shared, ".claude") + if err := os.MkdirAll(sharedClaude, 0o755); err != nil { + t.Fatal(err) + } + + // The per-agent layout: a real ~/.claude holding this agent's memory. + memRel := filepath.Join("projects", "-data-agents-scanner", "memory", "MEMORY.md") + mem := filepath.Join(home, ".claude", memRel) + if err := os.MkdirAll(filepath.Dir(mem), 0o755); err != nil { + t.Fatal(err) + } + if err := os.WriteFile(mem, []byte("# mine"), 0o644); err != nil { + t.Fatal(err) + } + + m.setupInteractiveHome(ap, "claude") + + link := filepath.Join(home, ".claude") + if target, err := os.Readlink(link); err != nil || target != sharedClaude { + t.Fatalf(".claude is not a link to the shared directory: target=%q err=%v", target, err) + } + // The per-agent directory was moved aside with its contents. + moved, err := filepath.Glob(filepath.Join(home, ".claude.per-agent-*", memRel)) + if err != nil || len(moved) != 1 { + t.Fatalf("per-agent directory not preserved exactly once: %v err=%v", moved, err) + } + if data, err := os.ReadFile(moved[0]); err != nil || string(data) != "# mine" { + t.Errorf("moved-aside memory changed: %q err=%v", data, err) + } + // What the CLI does on a token refresh: a temp file in ~/.claude renamed + // over .credentials.json. Through the link it lands in the shared login. + tmp := filepath.Join(link, ".credentials.json.tmp") + if err := os.WriteFile(tmp, []byte(`{"claudeAiOauth":{}}`), 0o600); err != nil { + t.Fatal(err) + } + if err := os.Rename(tmp, filepath.Join(link, ".credentials.json")); err != nil { + t.Fatal(err) + } + if info, err := os.Lstat(filepath.Join(sharedClaude, ".credentials.json")); err != nil || !info.Mode().IsRegular() { + t.Errorf("refreshed credential did not land in the shared directory: info=%v err=%v", info, err) + } + if target, err := os.Readlink(link); err != nil || target != sharedClaude { + t.Errorf("the rename replaced the directory link: target=%q err=%v", target, err) + } + // The other CLI homes are still real per-agent directories. + if info, err := os.Lstat(filepath.Join(home, ".gemini")); err != nil || info.Mode()&os.ModeSymlink != 0 || !info.IsDir() { + t.Errorf(".gemini should stay a per-agent directory: info=%v err=%v", info, err) + } + + // Idempotent: a second launch keeps the link and moves nothing else. + m.setupInteractiveHome(ap, "claude") + if target, err := os.Readlink(link); err != nil || target != sharedClaude { + t.Errorf(".claude link lost on re-provision: target=%q err=%v", target, err) + } + if asides, _ := filepath.Glob(filepath.Join(home, ".claude.per-agent-*")); len(asides) != 1 { + t.Errorf("re-provision moved something aside again: %v", asides) + } +} + +// With no shared Claude directory to link to, the switch keeps the per-agent +// directory: a dangling directory link would break the CLI's own mkdir -p. +func TestSetupInteractiveHome_SharedClaudeHomeNeedsSharedDirectory(t *testing.T) { + withSharedAgentHome(t) + t.Setenv("HIVE_SHARED_CLAUDE_HOME", "1") + m := interactiveHomeTestManager(t) + ap := &AgentProcess{Name: "scanner", UID: 1001, Config: config.AgentConfig{Backend: "claude"}} + home := interactiveHomePath("scanner") + + m.setupInteractiveHome(ap, "claude") + + if info, err := os.Lstat(filepath.Join(home, ".claude")); err != nil || info.Mode()&os.ModeSymlink != 0 || !info.IsDir() { + t.Errorf(".claude should be a per-agent directory when the shared one is missing: info=%v err=%v", info, err) + } +} + +// Turning the switch off again goes back to the per-agent layout on the next +// launch: the directory link is retired like any legacy bridge. +func TestSetupInteractiveHome_SharedClaudeHomeOffRetiresLink(t *testing.T) { + shared := withSharedAgentHome(t) + m := interactiveHomeTestManager(t) + ap := &AgentProcess{Name: "scanner", UID: 1001, Config: config.AgentConfig{Backend: "claude"}} + home := interactiveHomePath("scanner") + if err := os.MkdirAll(filepath.Join(shared, ".claude"), 0o755); err != nil { + t.Fatal(err) + } + + t.Setenv("HIVE_SHARED_CLAUDE_HOME", "1") + m.setupInteractiveHome(ap, "claude") + if info, err := os.Lstat(filepath.Join(home, ".claude")); err != nil || info.Mode()&os.ModeSymlink == 0 { + t.Fatalf(".claude should be a link while the switch is on: info=%v err=%v", info, err) + } + + t.Setenv("HIVE_SHARED_CLAUDE_HOME", "") + m.setupInteractiveHome(ap, "claude") + if info, err := os.Lstat(filepath.Join(home, ".claude")); err != nil || info.Mode()&os.ModeSymlink != 0 || !info.IsDir() { + t.Errorf(".claude should be a per-agent directory again: info=%v err=%v", info, err) + } + if target, err := os.Readlink(filepath.Join(home, ".claude", ".credentials.json")); err != nil || target != filepath.Join(shared, ".claude", ".credentials.json") { + t.Errorf(".credentials.json bridge not restored: target=%q err=%v", target, err) + } +} diff --git a/src/crux/agent/shared_claude_home.go b/src/crux/agent/shared_claude_home.go new file mode 100644 index 0000000000..a403fcbbc7 --- /dev/null +++ b/src/crux/agent/shared_claude_home.go @@ -0,0 +1,129 @@ +package agent + +import ( + "fmt" + "os" + "path/filepath" + "time" +) + +// sharedClaudeHomeForced reports whether the operator asked for every agent's +// ~/.claude to stay ONE whole-directory link to the shared /data/home/.claude +// (HIVE_SHARED_CLAUDE_HOME=1), the layout from before hivecommons/hive#17031. +// +// It exists for the Claude login. Claude Code saves a refreshed OAuth token by +// renaming a temp file over .credentials.json. In a per-agent ~/.claude that +// rename replaces the credential link with a private file, so the refresh +// (which also rotates the grant) never reaches the shared login and the rest +// of the fleet is left on a dead one. With the whole directory linked, the +// rename happens inside the shared directory and every agent reads the new +// token, exactly as before #17031. The price is that Claude agents share one +// CLAUDE.md, history.jsonl and todos/ again, and can read each other's +// transcripts and auto-memory. +func sharedClaudeHomeForced() bool { + return os.Getenv("HIVE_SHARED_CLAUDE_HOME") == "1" +} + +// claudeHomeAsideInfix names a per-agent ~/.claude that bridgeSharedClaudeHome +// moved aside: /.claude.per-agent-. +const claudeHomeAsideInfix = ".per-agent-" + +// bridgeSharedClaudeHome makes $HOME/.claude a whole-directory link to the +// shared /data/home/.claude (HIVE_SHARED_CLAUDE_HOME=1, see +// sharedClaudeHomeForced). It reports whether the link is in place; on false +// the caller provisions the per-agent directory as usual, so a home this +// cannot convert is never left without a .claude. +// +// A per-agent directory found at the path is moved aside to +// .claude.per-agent- in the same home, never deleted: it holds +// the agent's transcripts and auto-memory from the per-agent layout. Nothing +// under the shared tree is touched. A link is only created when the shared +// directory exists, because the CLI's own mkdir -p fails through a dangling +// directory link. +func (m *Manager) bridgeSharedClaudeHome(agentName, home string) bool { + dir := filepath.Join(home, claudeHomeDirName) + shared := filepath.Join(sharedAgentHome, claudeHomeDirName) + if info, err := os.Stat(shared); err != nil || !info.IsDir() { + m.logger.Warn("HIVE_SHARED_CLAUDE_HOME=1 but the shared Claude directory is missing; keeping the per-agent directory", + "agent", agentName, "shared", shared, "error", err) + return false + } + aside := "" + info, err := os.Lstat(dir) + switch { + case err == nil && info.Mode()&os.ModeSymlink != 0: + if existing, rerr := os.Readlink(dir); rerr == nil && existing == shared { + return true + } + if rerr := os.Remove(dir); rerr != nil { + m.logger.Warn("HIVE_SHARED_CLAUDE_HOME=1 but a stale .claude link could not be replaced", + "agent", agentName, "link", dir, "error", rerr) + return false + } + case err == nil && info.IsDir(): + moved, rerr := moveAsidePerAgentClaudeHome(dir, claudeBridgeNow()) + if rerr != nil { + m.logger.Warn("HIVE_SHARED_CLAUDE_HOME=1 but the per-agent Claude directory could not be moved aside; keeping it", + "agent", agentName, "dir", dir, "error", rerr) + return false + } + aside = moved + case err == nil: + m.logger.Warn("HIVE_SHARED_CLAUDE_HOME=1 but .claude is neither a directory nor a link; leaving it", + "agent", agentName, "path", dir) + return false + case !os.IsNotExist(err): + m.logger.Warn("HIVE_SHARED_CLAUDE_HOME=1 but .claude could not be inspected", + "agent", agentName, "path", dir, "error", err) + return false + } + if err := os.Symlink(shared, dir); err != nil { + if existing, rerr := os.Readlink(dir); rerr == nil && existing == shared { + // Another launch of the same agent linked it first. + return true + } + m.logger.Warn("HIVE_SHARED_CLAUDE_HOME=1 but the shared Claude directory could not be linked", + "agent", agentName, "link", dir, "shared", shared, "error", err) + if aside != "" { + // Put the per-agent directory back so the agent is not left + // without a .claude. + if rerr := os.Rename(aside, dir); rerr != nil { + m.logger.Error("the per-agent Claude directory could not be put back", + "agent", agentName, "from", aside, "to", dir, "error", rerr) + } + } + return false + } + if aside != "" { + m.logger.Info("linked ~/.claude to the shared Claude directory (HIVE_SHARED_CLAUDE_HOME=1); the per-agent directory was moved aside, not deleted", + "agent", agentName, "link", dir, "shared", shared, "moved_to", aside) + } else { + m.logger.Info("linked ~/.claude to the shared Claude directory (HIVE_SHARED_CLAUDE_HOME=1)", + "agent", agentName, "link", dir, "shared", shared) + } + return true +} + +// moveAsidePerAgentClaudeHome renames dir to a unique +// .per-agent- beside it and returns the new path. +func moveAsidePerAgentClaudeHome(dir string, now time.Time) (string, error) { + base := dir + claudeHomeAsideInfix + now.UTC().Format("20060102T150405Z") + for i := 0; i < 100; i++ { + dst := base + if i > 0 { + dst = fmt.Sprintf("%s-%d", base, i) + } + _, err := os.Lstat(dst) + if err == nil { + continue + } + if !os.IsNotExist(err) { + return "", err + } + if err := os.Rename(dir, dst); err != nil { + return "", err + } + return dst, nil + } + return "", fmt.Errorf("no free name to move %s aside", dir) +} diff --git a/src/docs/agent-configuration.md b/src/docs/agent-configuration.md index af61e9df89..f2f1137d06 100644 --- a/src/docs/agent-configuration.md +++ b/src/docs/agent-configuration.md @@ -705,6 +705,21 @@ Each repair writes a `claude_credential_rebridged` Audit Log entry naming the ag The repair skips an agent whose whole `~/.claude` is still the old directory symlink to `/data/home/.claude`. That happens to an agent that has been paused or stopped since before the per-agent split, because only a launch replaces the directory link. Through that link the agent's `.credentials.json` is the shared login itself, so there is nothing private to move aside. The hive log says so once per agent (`claude credential bridge: this agent's .claude directory resolves to the shared login directory`), the card does not show a broken bridge, and the agent's next launch replaces the directory link with its own `~/.claude`. +#### Keeping one shared Claude directory + +Set `HIVE_SHARED_CLAUDE_HOME=1` in the hive's environment to keep every agent's `~/.claude` as one whole-directory link to the shared `/data/home/.claude`, the layout from before [#17031](https://github.com/hivecommons/hive/issues/17031). + +Use it when a hive with per-agent users signs in to Claude from the dashboard and its agents log out again about every 8 hours. With the whole directory linked, the CLI's refresh (a temp file renamed over `.credentials.json`) lands in the shared directory, so every agent reads the new token and the credential link is never replaced. + +What changes while it is on: + +- On an agent's next launch its `~/.claude` becomes the link. A per-agent `.claude` directory found there is moved aside to `~/.claude.per-agent-`, never deleted. +- Claude agents share one `CLAUDE.md`, `history.jsonl` and `todos/` again, and can read each other's transcripts and auto-memory. This gives up the isolation #17031 added, for Claude only. `.gemini`, `.bob` and `.copilot` stay per agent. +- `agents.cli_memory.clear_on_kick` skips Claude, because the memory store is no longer the agent's own. +- Claude sessions recorded in the moved-aside directories are no longer scanned for the dashboard's token totals. + +Unset the variable to go back: the next launch retires the link and creates a fresh per-agent directory. The moved-aside directory is left for you to restore by hand. + ### CLI auto-memory (`agents.cli_memory`) Subscription CLIs keep their own long-lived "memory" next to the transcripts: Claude Code's auto-memory (`~/.claude/projects/-data-agents-/memory/MEMORY.md`), Codex memories (`$CODEX_HOME/memories/`), Copilot CLI's `memory` setting, and Gemini's `~/.gemini/GEMINI.md`. Hive agents already get their durable context from beads, the knowledge store, and the kick prompt, so a hidden per-CLI notebook mostly accumulates stale one-off inferences ([#17032](https://github.com/hivecommons/hive/issues/17032)). The `agents.cli_memory` block controls it fleet-wide, and each agent may override it with its own `cli_memory:` block: diff --git a/src/docs/agent-knowledge-and-memory.md b/src/docs/agent-knowledge-and-memory.md index 9cbac7e37b..16b1407b18 100644 --- a/src/docs/agent-knowledge-and-memory.md +++ b/src/docs/agent-knowledge-and-memory.md @@ -268,6 +268,10 @@ conversation. `/clear` empties the chat; it does not touch anything on disk. deleted — a pre-isolation `projects/*/memory` store is logged once for review. The full table is in [agent-configuration.md](agent-configuration.md#per-agent-homes-what-is-shared-and-what-is-private). - `HIVE_SHARED_AGENT_HOME=1` forces the legacy single shared home for all. +- `HIVE_SHARED_CLAUDE_HOME=1` keeps only `~/.claude` shared, as one + whole-directory link: Claude agents share `CLAUDE.md`, history, todos and + memory again, in exchange for a token refresh that reaches every agent. See + [agent-configuration.md](agent-configuration.md#keeping-one-shared-claude-directory). - Inference (API-routed) agents use throwaway homes under `/tmp/.claude-inference-home-` that vanish with the pod. - Contributor containers stage only `.credentials.json` and `settings.json` diff --git a/src/docs/env-vars.md b/src/docs/env-vars.md index a1a09b6868..550ca0c719 100644 --- a/src/docs/env-vars.md +++ b/src/docs/env-vars.md @@ -112,6 +112,7 @@ behavior. [Maintenance limitations](#keeping-this-reference-current) still apply | `HIVE_DELEGATION_CHAIN_ENABLED` | No | disabled | Enables delegation chain minting (`1`, `true`, `yes`, `on` — same spelling as `HIVE_METRICS_ENABLED`). Read on each call rather than cached, so disabling it on a misbehaving spoke does not require a pod roll. | | `HIVE_ALLOW_PRIVATE_GIT_SOURCE` | No | `false` | Exact `true` opt-in read by `pkg/knowledge/gitsource.go` to allow knowledge Git sources whose host resolves to a private/internal address (self-hosted GitLab and similar). Off by default as SSRF protection. | | `HIVE_SHARED_AGENT_HOME` | No | per-agent HOME | Escape hatch (`1`) restoring the legacy shared-HOME layout for agents. | +| `HIVE_SHARED_CLAUDE_HOME` | No | per-agent `~/.claude` | Set to `1` to keep every agent's `~/.claude` as one whole-directory link to the shared `/data/home/.claude`, so a Claude token refresh by any agent reaches the whole fleet. Claude agents then share `CLAUDE.md`, history, todos and memory again. See [agent-configuration.md](agent-configuration.md#keeping-one-shared-claude-directory). | | `HIVE_WORKSPACE_CLEANUP_ENABLED` | No | enabled | Set `0` to opt out of automatic agent workspace cleanup. | | `HIVE_WORKSPACE_CLEANUP_INTERVAL` | No | `1h` | How often the workspace cleanup sweep runs (Go duration, e.g. `30m`). Unset, unparseable, or non-positive values fall back to the default. | | `HIVE_WORKSPACE_CLEANUP_MAX_AGE` | No | `2h` | How old an entry under `/data/agents/*/` must be before the cleanup sweep removes it (Go duration, e.g. `6h`). Unset, unparseable, or non-positive values fall back to the default. | From d231349c3184ec07cdfc984a2cf05d283d848137 Mon Sep 17 00:00:00 2001 From: Danathar Date: Wed, 11 Nov 2026 16:22:36 -0500 Subject: [PATCH 2/2] ci: retrigger checks that were queued during a GitHub Actions incident Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1 Signed-off-by: Danathar