Skip to content

an open-source alternative to the dots, bots and muses of the world, run an office of claude code/codex like agents on your laptop, sandboxes or anywhere, uses your existing subscriptions

fix(hive): stop versioning each Codex worker's CODEX_HOME

Vyapak Goyalccff49b5e464
diff --git a/src/main/hive.ts b/src/main/hive.ts
index 16f5235c..4e95d137 100644
--- a/src/main/hive.ts
+++ b/src/main/hive.ts
@@ -191,8 +191,19 @@ function shortRand(): string {
/** Non-memory files `mempalace mine` must not ingest (Claude Code hooks config,
* cursor, raw inbox/outbox JSON). `mempalace mine` honors .gitignore, so we drop
- * one in each agent dir; written on birth here and refreshed by the mine loop. */
-const MINE_IGNORE_LINES = ['settings.json', 'cursor.json', 'inbox/', 'outbox/'];
+ * one in each agent dir; written on birth here and refreshed by the mine loop.
+ *
+ * `.codex/` is here for a second reason as well, and it is the load-bearing one:
+ * a Codex worker's CODEX_HOME lives INSIDE its agent dir (see installCodexHooks —
+ * Codex can only be given hooks through a config.toml in its own home, so it
+ * cannot share the user's ~/.codex). Codex then fills that folder with full
+ * session transcripts, an 80MB+ logs sqlite and a plugin cache, and the hive's
+ * git repo was faithfully versioning every revision of all of it. Twenty Codex
+ * agents took the hive's .git to 7.5GB, at which point git's own auto-gc tried to
+ * repack it and took 22GB of RAM doing so — the machine swapped, the app stopped
+ * responding. None of it was ever wanted in history: it is Codex's private
+ * scratch state, and it stays on disk (so resume still works) either way. */
+const MINE_IGNORE_LINES = ['settings.json', 'cursor.json', 'inbox/', 'outbox/', '.codex/'];
/** Idempotently ensure `<agentDir>/.gitignore` excludes the non-memory files.
* Append-only: writes only the missing lines, leaving any existing entries. */
diff --git a/src/main/memory.ts b/src/main/memory.ts
index 008e680b..4d353eb2 100644
--- a/src/main/memory.ts
+++ b/src/main/memory.ts
@@ -19,10 +19,17 @@ import { spawn, spawnSync } from 'node:child_process';
import { ensureKilled } from './procKill';
/** Non-memory files `mempalace mine` must not ingest: the Claude Code hooks
- * config (a large JSON blob that swamps the wake-up digest), the cursor, and
- * raw inbox/outbox message JSON. `mempalace mine` honors .gitignore, so we drop
- * one in each agent dir rather than touch the mine command. */
-const MINE_IGNORE_LINES = ['settings.json', 'cursor.json', 'inbox/', 'outbox/'];
+ * config (a large JSON blob that swamps the wake-up digest), the cursor, raw
+ * inbox/outbox message JSON, and a Codex worker's private CODEX_HOME. `mempalace
+ * mine` honors .gitignore, so we drop one in each agent dir rather than touch the
+ * mine command.
+ *
+ * MUST STAY IN SYNC with MINE_IGNORE_LINES in hive.ts — that copy is written when
+ * an agent spawns, this one on every mine cycle, and only this one reaches agents
+ * that are not currently running. See hive.ts for why `.codex/` matters beyond
+ * mempalace: it is also what stopped the hive's git repo from versioning every
+ * Codex transcript and sqlite log into a 7.5GB history. */
+const MINE_IGNORE_LINES = ['settings.json', 'cursor.json', 'inbox/', 'outbox/', '.codex/'];
/** Idempotently ensure `<agentDir>/.gitignore` excludes the non-memory files.
* Writes only the missing lines (append-only) so it's safe to call every cycle. */