Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

fix: pre-landing review fixes (hosted block: an existing gbrain entry still runs setup)

garrytan2d6e16587802
diff --git a/INSTALL_FOR_AGENTS.md b/INSTALL_FOR_AGENTS.md
index bba5b4c70f..dc795f3a6d 100644
--- a/INSTALL_FOR_AGENTS.md
+++ b/INSTALL_FOR_AGENTS.md
@@ -8,11 +8,10 @@
> gbrainio workspace new # a person picks the plan in the browser
> curl -fsSL https://bun.sh/install | bash && export PATH="$HOME/.bun/bin:$PATH" # skip if Bun 1.4.4+ is installed
> bun install -g github:garrytan/gbrain#latest-stable # the gbrain CLI only; no local brain
-> # Already added gbrain to Claude Code or Codex? Run only its gbrain setup command below.
-> # Claude Code:
-> claude mcp add --transport http --scope user gbrain https://gbrain.io/mcp && gbrain setup claude-code --instructions-only
+> # Claude Code (an existing gbrain entry is kept):
+> (claude mcp add --transport http --scope user gbrain https://gbrain.io/mcp || claude mcp get gbrain) && gbrain setup claude-code --instructions-only
> # Codex:
-> codex mcp add gbrain --url https://gbrain.io/mcp && gbrain setup codex --instructions-only
+> (codex mcp add gbrain --url https://gbrain.io/mcp || codex mcp get gbrain) && gbrain setup codex --instructions-only
> ```
>
> `gbrain setup <harness> --instructions-only` tells the agent the brain is there; agents seldom call an MCP server nobody told them about. It writes the [brain-first block](docs/guides/setup.md#brain-first-instructions) into `~/.claude/CLAUDE.md` or Codex's `AGENTS.md` (a non-empty `AGENTS.override.md` instead when Codex has one) with a per-turn rule hook, and leaves the MCP entry alone; the same command with `--no-instructions` added takes them out.
diff --git a/README.md b/README.md
index ef3ac23c72..735ad1d3af 100644
--- a/README.md
+++ b/README.md
@@ -99,11 +99,10 @@ This is the difference between a search engine and a brain. Search finds the pag
> gbrainio workspace new # pick a plan in the browser
> curl -fsSL https://bun.sh/install | bash && export PATH="$HOME/.bun/bin:$PATH" # skip if Bun 1.4.4+ is installed
> bun install -g github:garrytan/gbrain#latest-stable # the gbrain CLI only; no local brain
-> # Already added gbrain to Claude Code or Codex? Run only its gbrain setup command below.
-> # Claude Code:
-> claude mcp add --transport http --scope user gbrain https://gbrain.io/mcp && gbrain setup claude-code --instructions-only
+> # Claude Code (an existing gbrain entry is kept):
+> (claude mcp add --transport http --scope user gbrain https://gbrain.io/mcp || claude mcp get gbrain) && gbrain setup claude-code --instructions-only
> # Codex:
-> codex mcp add gbrain --url https://gbrain.io/mcp && gbrain setup codex --instructions-only
+> (codex mcp add gbrain --url https://gbrain.io/mcp || codex mcp get gbrain) && gbrain setup codex --instructions-only
> ```
>
> `gbrain setup <harness> --instructions-only` tells the agent the brain is there; agents seldom call an MCP server nobody told them about. It writes the [brain-first block](docs/guides/setup.md#brain-first-instructions) into `~/.claude/CLAUDE.md` or Codex's `AGENTS.md` (a non-empty `AGENTS.override.md` instead when Codex has one) with a per-turn rule hook, and leaves the MCP entry alone; the same command with `--no-instructions` added takes them out.
diff --git a/docs/INSTALL.md b/docs/INSTALL.md
index 60ce4c84d1..932fee3ce2 100644
--- a/docs/INSTALL.md
+++ b/docs/INSTALL.md
@@ -9,11 +9,10 @@
> gbrainio workspace new # pick a plan in the browser
> curl -fsSL https://bun.sh/install | bash && export PATH="$HOME/.bun/bin:$PATH" # skip if Bun 1.4.4+ is installed
> bun install -g github:garrytan/gbrain#latest-stable # the gbrain CLI only; no local brain
-> # Already added gbrain to Claude Code or Codex? Run only its gbrain setup command below.
-> # Claude Code:
-> claude mcp add --transport http --scope user gbrain https://gbrain.io/mcp && gbrain setup claude-code --instructions-only
+> # Claude Code (an existing gbrain entry is kept):
+> (claude mcp add --transport http --scope user gbrain https://gbrain.io/mcp || claude mcp get gbrain) && gbrain setup claude-code --instructions-only
> # Codex:
-> codex mcp add gbrain --url https://gbrain.io/mcp && gbrain setup codex --instructions-only
+> (codex mcp add gbrain --url https://gbrain.io/mcp || codex mcp get gbrain) && gbrain setup codex --instructions-only
> ```
>
> `gbrain setup <harness> --instructions-only` tells the agent the brain is there; agents seldom call an MCP server nobody told them about. It writes the [brain-first block](guides/setup.md#brain-first-instructions) into `~/.claude/CLAUDE.md` or Codex's `AGENTS.md` (a non-empty `AGENTS.override.md` instead when Codex has one) with a per-turn rule hook, and leaves the MCP entry alone; the same command with `--no-instructions` added takes them out.
diff --git a/llms-full.txt b/llms-full.txt
index 38f53e8f03..ce2f58acec 100644
--- a/llms-full.txt
+++ b/llms-full.txt
@@ -2678,11 +2678,10 @@ Source: https://raw.githubusercontent.com/garrytan/gbrain/master/INSTALL_FOR_AGE
> gbrainio workspace new # a person picks the plan in the browser
> curl -fsSL https://bun.sh/install | bash && export PATH="$HOME/.bun/bin:$PATH" # skip if Bun 1.4.4+ is installed
> bun install -g github:garrytan/gbrain#latest-stable # the gbrain CLI only; no local brain
-> # Already added gbrain to Claude Code or Codex? Run only its gbrain setup command below.
-> # Claude Code:
-> claude mcp add --transport http --scope user gbrain https://gbrain.io/mcp && gbrain setup claude-code --instructions-only
+> # Claude Code (an existing gbrain entry is kept):
+> (claude mcp add --transport http --scope user gbrain https://gbrain.io/mcp || claude mcp get gbrain) && gbrain setup claude-code --instructions-only
> # Codex:
-> codex mcp add gbrain --url https://gbrain.io/mcp && gbrain setup codex --instructions-only
+> (codex mcp add gbrain --url https://gbrain.io/mcp || codex mcp get gbrain) && gbrain setup codex --instructions-only
> ```
>
> `gbrain setup <harness> --instructions-only` tells the agent the brain is there; agents seldom call an MCP server nobody told them about. It writes the [brain-first block](docs/guides/setup.md#brain-first-instructions) into `~/.claude/CLAUDE.md` or Codex's `AGENTS.md` (a non-empty `AGENTS.override.md` instead when Codex has one) with a per-turn rule hook, and leaves the MCP entry alone; the same command with `--no-instructions` added takes them out.
@@ -5127,11 +5126,10 @@ This is the difference between a search engine and a brain. Search finds the pag
> gbrainio workspace new # pick a plan in the browser
> curl -fsSL https://bun.sh/install | bash && export PATH="$HOME/.bun/bin:$PATH" # skip if Bun 1.4.4+ is installed
> bun install -g github:garrytan/gbrain#latest-stable # the gbrain CLI only; no local brain
-> # Already added gbrain to Claude Code or Codex? Run only its gbrain setup command below.
-> # Claude Code:
-> claude mcp add --transport http --scope user gbrain https://gbrain.io/mcp && gbrain setup claude-code --instructions-only
+> # Claude Code (an existing gbrain entry is kept):
+> (claude mcp add --transport http --scope user gbrain https://gbrain.io/mcp || claude mcp get gbrain) && gbrain setup claude-code --instructions-only
> # Codex:
-> codex mcp add gbrain --url https://gbrain.io/mcp && gbrain setup codex --instructions-only
+> (codex mcp add gbrain --url https://gbrain.io/mcp || codex mcp get gbrain) && gbrain setup codex --instructions-only
> ```
>
> `gbrain setup <harness> --instructions-only` tells the agent the brain is there; agents seldom call an MCP server nobody told them about. It writes the [brain-first block](docs/guides/setup.md#brain-first-instructions) into `~/.claude/CLAUDE.md` or Codex's `AGENTS.md` (a non-empty `AGENTS.override.md` instead when Codex has one) with a per-turn rule hook, and leaves the MCP entry alone; the same command with `--no-instructions` added takes them out.