# Vibe Mind setup guide (for AI agents)

You are reading **setup instructions**: the user wants Vibe Mind connected to your environment. Do the steps below yourself and briefly tell the user the result of each. Skip anything already configured; don't add things twice.

Vibe Mind is cloud project memory: you record decisions, pitfalls and conventions, and any machine, account or agent can read them later. It is a remote MCP server (Streamable HTTP only, no SSE):

- Server URL: `https://vibe-mind.iguos.com/mcp`
- Two ways to authenticate, pick one:
  - **OAuth (recommended)**: agents that support MCP OAuth (Claude Code, Codex, Gemini CLI, Cursor…) only need the URL. When connecting, a browser opens; the user signs in to Vibe Mind and clicks "Allow". No token needed, and users without an account can sign up right there.
  - **Access token**: header `Authorization: Bearer <token>`; tokens start with `vm_` and are created at https://vibe-mind.iguos.com/ai . Use this for agents without OAuth support.

**What you get: every session goes through Vibe Mind.** At session start a hook puts the current project's memory and the rules into context; at the end, if code changed but nothing was written to Mind, the hook stops the agent once to record it. The agent's built-in local memory stays, but only as a fallback (use it when Mind is unreachable); if they disagree, Mind wins.

**Once per computer, not per project**: the MCP server, working habits and hooks are installed at user level (available in every project), and authorization happens once. Afterwards, in whichever repository work starts, the agent reads and writes memory under that repository's name. Only the final "import existing experience" step is per repository (optional). If the user asks you to follow this link again in another repository, check that everything is already set up and just tell them; don't add anything twice.

**Cloud agent sessions** (the container is discarded after use, so nothing in the home directory survives and OAuth isn't possible), or when the team should be connected just by cloning the repo: skip steps 1–4 and follow "Cloud / project-level install" below to put the config in the repo.

First work out which agent you are, then follow your agent's entry in each step.

## Step 1: Add the MCP server

**Claude Code**: check `claude mcp list` for vibe-mind first (don't use `claude mcp get`; it prints the request headers, token included). Listed and Connected: skip steps 1 and 2. Listed but "Needs authentication": go to step 2. Not listed: run (`--scope user` makes it available in every project):

```bash
claude mcp add --transport http --scope user vibe-mind https://vibe-mind.iguos.com/mcp
```

**Codex CLI**: add this to `~/.codex/config.toml` (skip if `[mcp_servers.vibe-mind]` exists):

```toml
[mcp_servers.vibe-mind]
url = "https://vibe-mind.iguos.com/mcp"
```

**Gemini CLI**: add this under `mcpServers` in `~/.gemini/settings.json` (merge with what's there):

```json
{ "mcpServers": { "vibe-mind": { "httpUrl": "https://vibe-mind.iguos.com/mcp" } } }
```

**Cursor**: add this under `mcpServers` in `~/.cursor/mcp.json` (merge; don't remove other servers):

```json
{ "mcpServers": { "vibe-mind": { "url": "https://vibe-mind.iguos.com/mcp" } } }
```

**Other agents with remote MCP support**: add an HTTP (Streamable HTTP) MCP server the way that agent configures it, URL `https://vibe-mind.iguos.com/mcp`.

## Step 2: Ask the user how to authenticate, and help them finish

**Ask the user first** (use your question / options feature if you have one, otherwise just ask), with two options, recommending the first:

1. **OAuth (recommended)**: sign in to Vibe Mind in the browser and click "Allow"; no token to copy, it refreshes itself hourly, and there's no need to sign in again as long as it's used within 90 days.
2. **Access token**: the user creates a token at https://vibe-mind.iguos.com/ai and sends it to you. Good for agents without OAuth support, machines without a browser, or when a fixed expiry is wanted.

**If the user picks OAuth** — first tell them: "A browser will open the authorization page; sign in (or sign up) if needed, choose which projects it can access, and click Allow":

- Claude Code: run `claude mcp login vibe-mind`; it opens the authorization page and waits until it's done. Then confirm with `claude mcp list` that it shows Connected. **It needs an interactive terminal**: your own shell tool usually isn't one (it prints "stdin isn't a terminal" and exits, and clicking Allow then goes nowhere). If you can run commands in the user's terminal (such as the desktop app's terminal panel), run it there; otherwise ask the user to run it. On remote / browserless machines use `claude mcp login vibe-mind --no-browser`: send the printed URL to the user, and after they click "Allow", have them send back the URL they were redirected to and paste it into the command.
- Codex CLI: run `codex mcp login vibe-mind` (also needs an interactive terminal).
- Gemini CLI: ask the user to type `/mcp auth vibe-mind` in Gemini CLI.
- Cursor: ask the user to open Cursor's MCP settings and sign in on vibe-mind.
- Other agents: trigger the OAuth sign-in the way that agent does it; if you can't, use an access token instead.

**If the user picks an access token**: ask them to open https://vibe-mind.iguos.com/ai , click "Generate token" (it can be limited to some projects and given an expiry) and send it to you; if `VIBE_MIND_TOKEN` is set, use that. Don't repeat the full token in your replies, and don't write it into files that get committed.

- Claude Code: if step 1 already added vibe-mind without a token, run `claude mcp remove vibe-mind --scope user` first, then:

```bash
claude mcp add --transport http --scope user vibe-mind https://vibe-mind.iguos.com/mcp --header "Authorization: Bearer <token>"
```

- Codex CLI: add `bearer_token_env_var = "VIBE_MIND_TOKEN"` to `[mcp_servers.vibe-mind]` and ask the user to set `VIBE_MIND_TOKEN` in their shell profile.
- Gemini CLI: add `"headers": { "Authorization": "Bearer <token>" }` to `mcpServers.vibe-mind`.
- Cursor: add `"headers": { "Authorization": "Bearer <token>" }` to `mcpServers.vibe-mind`.
- Other agents: add the header `Authorization: Bearer <token>` the way that agent configures it.

Check the token works:

```bash
curl -s -X POST https://vibe-mind.iguos.com/mcp -H "Authorization: Bearer <token>" -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
```

If the response contains `memory_write`, you're good; a 401 means the token is wrong or revoked.

## Step 3: Add the working habits

Put the block below in the agent's global instructions: `~/.claude/CLAUDE.md` for Claude Code, `~/.codex/AGENTS.md` for Codex, `~/.gemini/GEMINI.md` for Gemini CLI; for Cursor, ask the user to paste it into User Rules in settings (you can't edit those; the step 4 hook also brings the rules in at every session start); other agents: their global instructions / rules file. Wrap it in `<!-- VIBE_MIND_START -->` and `<!-- VIBE_MIND_END -->`; if the markers already exist, replace only what's between them, otherwise append it.

```markdown
<!-- VIBE_MIND_START -->
## Vibe Mind: brain, hands and work notes (different purposes, don't mix them up)
- Rule of thumb: will a future agent need to read this before starting work? Yes → memory (memory_write). Only for people to read → work notes (worknote_write).
- Where memory goes: true only for this project (anyone taking it over must follow it) → the current project, named after the repo, path "module/category/title", category one of conventions / decisions / pitfalls / runbooks / external / architecture / todo; about the user and true across projects → one of the 5 fixed files in project=@brain (the user may call it "Brain" or "灵犀") (boundaries / soul / goals / workstyle / profile), only what the user stated or corrected, with the evidence for each point, edited with append / replace_text; skills useful in other projects too → project=@knowhow.
- When the user corrects you or sets a rule, decide where it goes by scope, not by the fact that the user said it: true only in this project (how branches are cut, how releases go, who runs SQL, this product's feature choices) → the project's conventions; personal habits true in any project (reply language, commit attribution, taste, how to communicate) → @brain; when unsure, put it in the project. E.g. "cut bugfix branches from next" is a project convention, not the Brain.
- Starting work: call project_list, then memory_context with what you're about to do to get the Brain, relevant know-how, the project overview and memories in one call; work the way the Brain says, boundaries first, and weigh things by the soul when unsure. For a new project, first add three pages: README (what it is), project/runbooks/setup (how to set up a new computer; for keys, only where they live), project/todo/next-steps (progress and next steps). After a decision or a fix, write it down, reusing existing project and module names; before you finish, update progress and next steps under todo. Code is the truth for how things are now; memory is the truth for why and what's next; fix memory on the spot when they disagree.
- Tidying up: when the user says "tidy up", or the session-start context suggests it, call memory_tidy for the checklist, then merge duplicates, refile misplaced entries, fix stale ones and move general know-how into @knowhow; write a "tidy-up log" work note, then call memory_tidy again with done=true. Finish the task at hand first.
- Work notes: written for people, not read at session start — summaries, progress updates, investigations, option comparisons, questions that need a human decision. Write them with worknote_write by "project + title" (writing the same title again updates it; append adds progress), then share the returned link with the user. Notes you wrote can be viewed with worknote_list / worknote_read and deleted with worknote_delete (to the trash); notes written (or taken over) by the user are read-only for you.
- Don't put summaries or reports for people into memory; don't keep experience future agents need only in work notes (they aren't read at session start).
- Vibe Mind is the source of truth: experience always goes to Mind; your built-in local memory is only a fallback (note it locally when Mind is unreachable and write it to Mind once it's back); if they disagree, Mind wins.
- If a Vibe Mind tool the user asks for isn't in your tool list, this MCP connection was made before that tool shipped: ask the user to reconnect the Vibe Mind MCP server or start a new session; don't work around it another way.
- Version of these notes: vibe-mind-habits-v6. When the session-start context says there's a newer version, replace the part between VIBE_MIND_START and VIBE_MIND_END as instructed, without asking the user.
<!-- VIBE_MIND_END -->
```

**Also install the skill** (more detailed read / write guidance): Claude Code reads it from `~/.claude/skills/vibe-mind/`; Codex, Gemini CLI and Cursor all read the shared location `~/.agents/skills/vibe-mind/`, so install it where your agent looks. If it's already installed with the same content, skip; if it differs, overwrite it (Vibe Mind owns this file). The skill and the habits above both carry a version (`vibe-mind-skill-vN`, `vibe-mind-habits-vN`); when a new version ships, you'll be reminded to update at session start:

```bash
# Claude Code
mkdir -p ~/.claude/skills/vibe-mind && curl -fsSL https://vibe-mind.iguos.com/skills/vibe-mind/SKILL.md -o ~/.claude/skills/vibe-mind/SKILL.md
# Codex, Gemini CLI, Cursor
mkdir -p ~/.agents/skills/vibe-mind && curl -fsSL https://vibe-mind.iguos.com/skills/vibe-mind/SKILL.md -o ~/.agents/skills/vibe-mind/SKILL.md
```

## Step 4: Install the hooks so every session goes through Vibe Mind

Habits alone get forgotten. The hooks make sure that at **session start** the current project's memory and the rules are put into context (the agent doesn't have to remember to read them); on the **user's first message** it looks up once more by that message and adds the relevant memories and know-how (at session start it can't know what this session is for; only the first message of a session is looked up, later ones don't touch the network); and at the **end**, if this stretch changed code or made a commit, the user corrected something or set a rule, or the chat ran long, without writing to Mind, the agent is stopped once to write it to the right place or explicitly say there's nothing to record (once per stretch); when the **session ends or context is compacted** before that check could run, it's noted locally and brought into the next session start to catch up. Claude Code, Codex, Gemini CLI and Cursor support this; agents without hooks skip this step and rely on the rules from step 3.

**4.1 Download the hook script** (one script shared by every agent with hooks; if it's already there, overwrite it with the latest. After that it updates itself: whenever a session starts and a new version is out, it swaps itself in, so there's nothing to reinstall):

```bash
mkdir -p ~/.vibe-mind && curl -fsSL https://vibe-mind.iguos.com/hooks/vibe-mind-hook.sh -o ~/.vibe-mind/hook.sh && chmod +x ~/.vibe-mind/hook.sh
```

**4.2 Prepare the hook token** and write it to `~/.vibe-mind/hook-token` (`chmod 600`; don't show it to the user or commit it):

- If the user picked an access token in step 2: use that token.
- If the user picked OAuth: check whether vibe-mind's `hook_token` is in your tool list. If it is, call it and write the returned `token` there (this token can only read the session-start context; it can't call MCP tools, write or delete anything). If it isn't, skip this step and don't generate a token some other way: a newly added server is only available in a new session, and a connection made before this tool shipped won't show it. At the next session start the hook tells the agent to do it.

**4.3 Add the hooks to the agent's config** (merge with existing hooks; don't overwrite them; if an older Vibe Mind hook is there — one whose command runs `curl … /api/mcp/context` directly — remove it and use the one below). The trailing `zh` is the language of the hook's messages; use `en` for English-speaking users.

Claude Code (`~/.claude/settings.json`):

```json
{
  "hooks": {
    "SessionStart": [{ "matcher": "startup|clear|compact", "hooks": [{ "type": "command", "command": "bash ~/.vibe-mind/hook.sh claude start en" }] }],
    "UserPromptSubmit": [{ "hooks": [{ "type": "command", "command": "bash ~/.vibe-mind/hook.sh claude prompt en" }] }],
    "Stop": [{ "hooks": [{ "type": "command", "command": "bash ~/.vibe-mind/hook.sh claude stop en" }] }],
    "SessionEnd": [{ "hooks": [{ "type": "command", "command": "bash ~/.vibe-mind/hook.sh claude end en" }] }],
    "PreCompact": [{ "hooks": [{ "type": "command", "command": "bash ~/.vibe-mind/hook.sh claude end en" }] }]
  }
}
```

Codex CLI (`~/.codex/hooks.json`; afterwards ask the user to type `/hooks` in Codex and trust the hooks — untrusted hooks don't run):

```json
{
  "hooks": {
    "SessionStart": [{ "matcher": "startup|resume|clear|compact", "hooks": [{ "type": "command", "command": "bash ~/.vibe-mind/hook.sh codex start en" }] }],
    "UserPromptSubmit": [{ "hooks": [{ "type": "command", "command": "bash ~/.vibe-mind/hook.sh codex prompt en" }] }],
    "Stop": [{ "hooks": [{ "type": "command", "command": "bash ~/.vibe-mind/hook.sh codex stop en" }] }],
    "SessionEnd": [{ "hooks": [{ "type": "command", "command": "bash ~/.vibe-mind/hook.sh codex end en" }] }],
    "PreCompact": [{ "hooks": [{ "type": "command", "command": "bash ~/.vibe-mind/hook.sh codex end en" }] }]
  }
}
```

Gemini CLI (`hooks` in `~/.gemini/settings.json`):

```json
{
  "hooks": {
    "SessionStart": [{ "hooks": [{ "type": "command", "command": "bash ~/.vibe-mind/hook.sh gemini start en" }] }],
    "BeforeAgent": [{ "hooks": [{ "type": "command", "command": "bash ~/.vibe-mind/hook.sh gemini prompt en" }] }],
    "AfterAgent": [{ "hooks": [{ "type": "command", "command": "bash ~/.vibe-mind/hook.sh gemini stop en" }] }],
    "SessionEnd": [{ "hooks": [{ "type": "command", "command": "bash ~/.vibe-mind/hook.sh gemini end en" }] }],
    "PreCompress": [{ "hooks": [{ "type": "command", "command": "bash ~/.vibe-mind/hook.sh gemini end en" }] }]
  }
}
```

Cursor (`~/.cursor/hooks.json`):

```json
{
  "version": 1,
  "hooks": {
    "sessionStart": [{ "command": "bash ~/.vibe-mind/hook.sh cursor start en" }],
    "stop": [{ "command": "bash ~/.vibe-mind/hook.sh cursor stop en" }],
    "sessionEnd": [{ "command": "bash ~/.vibe-mind/hook.sh cursor end en" }],
    "preCompact": [{ "command": "bash ~/.vibe-mind/hook.sh cursor end en" }]
  }
}
```

Cursor's prompt hook (beforeSubmitPrompt) can only allow or block a message and can't add context, so there's no first-message event for Cursor: the rules loaded at session start tell the agent to call `memory_context` once with the task after the user's first message.

The hook script needs bash and curl (built into macOS and Linux; on Windows use Git Bash / WSL).

## Step 5: Activate and report

- The new MCP server, hooks and habits take effect in a **new session**: ask the user to start one. If the new session begins with "Vibe Mind project memory" and the rules, the hooks work; if `project_list` returns (a new account has at least the default project `@knowhow`; `@brain` shows up once the user turns on the Brain), MCP is connected.
- Tell the user what you did (which files you changed, e.g. the global instructions file, hook config, `~/.vibe-mind/`), that memories show up at https://vibe-mind.iguos.com, and that authorizations and tokens can be revoked any time at https://vibe-mind.iguos.com/ai .
- Tell the user: the Brain (their preferences) is one switch for the whole account, off for new accounts. To have agents read their preferences at session start and work their way, turn on "Use Brain" at https://vibe-mind.iguos.com/memory/@brain and every connected agent uses it; if their agent already keeps its own memory about them (e.g. Hermes, OpenClaw), they may leave it off to avoid two conflicting copies.

## Cloud / project-level install (lives in the repo, works on clone)

Use this for cloud agent sessions (each one starts a fresh container that's discarded afterwards, so anything installed in the home directory is gone next time, and there's no browser for OAuth), or when you want teammates to be set up just by cloning the repo. Everything goes into the repo (committed); the token goes into the cloud environment's **environment variables** and never into the repo. When the user asks you to "connect with the project-level install in install.md", do the steps below in the current repo instead of steps 1–4 above; skip what's already there, and merge into existing config files instead of overwriting them.

**P1. Token (the user does this)**: create an access token at https://vibe-mind.iguos.com/ai (ideally limited to this project, with an expiry) and set it as the environment variable `VIBE_MIND_TOKEN` of the cloud environment. Anyone who can use that environment can read its environment variables, so keep the token limited to this one project. Watch where it goes:
- Codex cloud Secrets are only available to setup scripts, not while the agent works; use an environment variable.
- Claude Code cloud "network secrets" add the header at the proxy, so the variable isn't visible in the session and the hook can't read the token; use an environment variable here too.

**P2. Allow the domain**: if the cloud environment's network uses an allowlist, allow `vibe-mind.iguos.com`. In Codex cloud, don't use the "GET / HEAD / OPTIONS only" setting: MCP sends POST requests.

**P3. MCP config** (commit it):

Claude Code (`.mcp.json` at the repo root; cloud sessions load it only when the session has just this one repository, not when a session has several repositories or runs in a Claude project; local interactive sessions ask the user once whether to enable it):

```json
{ "mcpServers": { "vibe-mind": { "type": "http", "url": "https://vibe-mind.iguos.com/mcp", "headers": { "Authorization": "Bearer ${VIBE_MIND_TOKEN}" } } } }
```

Codex (`.codex/config.toml`; loaded only in projects the user trusts):

```toml
[mcp_servers.vibe-mind]
url = "https://vibe-mind.iguos.com/mcp"
bearer_token_env_var = "VIBE_MIND_TOKEN"
```

Gemini CLI (`.gemini/settings.json`; every string in the settings file expands `${VAR}`, headers included):

```json
{ "mcpServers": { "vibe-mind": { "httpUrl": "https://vibe-mind.iguos.com/mcp", "headers": { "Authorization": "Bearer ${VIBE_MIND_TOKEN}" } } } }
```

Cursor (`.cursor/mcp.json`):

```json
{ "mcpServers": { "vibe-mind": { "url": "https://vibe-mind.iguos.com/mcp", "headers": { "Authorization": "Bearer ${env:VIBE_MIND_TOKEN}" } } } }
```

**P4. Habits**: put the block from step 3 (with the `VIBE_MIND_START` / `VIBE_MIND_END` marker lines) into the instructions file at the repo root: `CLAUDE.md` for Claude Code, `AGENTS.md` for Codex and Cursor, `GEMINI.md` for Gemini CLI. If the file exists, replace only what's between the markers.

**P5. Skill**: Claude Code reads `.claude/skills/vibe-mind/`; Codex, Gemini CLI and Cursor all read the shared location `.agents/skills/vibe-mind/`. Add the ones your team uses:

```bash
# Claude Code
mkdir -p .claude/skills/vibe-mind && curl -fsSL https://vibe-mind.iguos.com/skills/vibe-mind/SKILL.md -o .claude/skills/vibe-mind/SKILL.md
# Codex, Gemini CLI, Cursor
mkdir -p .agents/skills/vibe-mind && curl -fsSL https://vibe-mind.iguos.com/skills/vibe-mind/SKILL.md -o .agents/skills/vibe-mind/SKILL.md
```

**P6. Hooks**: put a pinned version of the script in the repo (a committed script never rewrites itself, so it can be audited; when there's a new version the session-start context says so, and you replace it with the newer numbered file and commit). It reads the token from `VIBE_MIND_TOKEN`.

```bash
mkdir -p .vibe-mind && curl -fsSL https://vibe-mind.iguos.com/hooks/vibe-mind-hook-v12.sh -o .vibe-mind/hook.sh && chmod +x .vibe-mind/hook.sh
```

Hook config (commit it; the trailing `en` is the language of the messages):

Claude Code (`.claude/settings.json`; in the cloud, like `.mcp.json` above, these run only in a session that has just this one repository):

```json
{
  "hooks": {
    "SessionStart": [{ "matcher": "startup|clear|compact", "hooks": [{ "type": "command", "command": "bash \"$CLAUDE_PROJECT_DIR/.vibe-mind/hook.sh\" claude start en" }] }],
    "UserPromptSubmit": [{ "hooks": [{ "type": "command", "command": "bash \"$CLAUDE_PROJECT_DIR/.vibe-mind/hook.sh\" claude prompt en" }] }],
    "Stop": [{ "hooks": [{ "type": "command", "command": "bash \"$CLAUDE_PROJECT_DIR/.vibe-mind/hook.sh\" claude stop en" }] }],
    "SessionEnd": [{ "hooks": [{ "type": "command", "command": "bash \"$CLAUDE_PROJECT_DIR/.vibe-mind/hook.sh\" claude end en" }] }],
    "PreCompact": [{ "hooks": [{ "type": "command", "command": "bash \"$CLAUDE_PROJECT_DIR/.vibe-mind/hook.sh\" claude end en" }] }]
  }
}
```

Codex (`.codex/hooks.json`; project hooks run only after the user trusts the project and reviews them):

```json
{
  "hooks": {
    "SessionStart": [{ "matcher": "startup|resume|clear|compact", "hooks": [{ "type": "command", "command": "bash \"$(git rev-parse --show-toplevel)/.vibe-mind/hook.sh\" codex start en" }] }],
    "UserPromptSubmit": [{ "hooks": [{ "type": "command", "command": "bash \"$(git rev-parse --show-toplevel)/.vibe-mind/hook.sh\" codex prompt en" }] }],
    "Stop": [{ "hooks": [{ "type": "command", "command": "bash \"$(git rev-parse --show-toplevel)/.vibe-mind/hook.sh\" codex stop en" }] }],
    "SessionEnd": [{ "hooks": [{ "type": "command", "command": "bash \"$(git rev-parse --show-toplevel)/.vibe-mind/hook.sh\" codex end en" }] }],
    "PreCompact": [{ "hooks": [{ "type": "command", "command": "bash \"$(git rev-parse --show-toplevel)/.vibe-mind/hook.sh\" codex end en" }] }]
  }
}
```

Gemini CLI (`hooks` in `.gemini/settings.json`):

```json
{
  "hooks": {
    "SessionStart": [{ "hooks": [{ "type": "command", "command": "bash \"$GEMINI_PROJECT_DIR/.vibe-mind/hook.sh\" gemini start en" }] }],
    "BeforeAgent": [{ "hooks": [{ "type": "command", "command": "bash \"$GEMINI_PROJECT_DIR/.vibe-mind/hook.sh\" gemini prompt en" }] }],
    "AfterAgent": [{ "hooks": [{ "type": "command", "command": "bash \"$GEMINI_PROJECT_DIR/.vibe-mind/hook.sh\" gemini stop en" }] }],
    "SessionEnd": [{ "hooks": [{ "type": "command", "command": "bash \"$GEMINI_PROJECT_DIR/.vibe-mind/hook.sh\" gemini end en" }] }],
    "PreCompress": [{ "hooks": [{ "type": "command", "command": "bash \"$GEMINI_PROJECT_DIR/.vibe-mind/hook.sh\" gemini end en" }] }]
  }
}
```

Cursor (`.cursor/hooks.json`; project hooks run from the project root):

```json
{
  "version": 1,
  "hooks": {
    "sessionStart": [{ "command": "bash .vibe-mind/hook.sh cursor start en" }],
    "stop": [{ "command": "bash .vibe-mind/hook.sh cursor stop en" }],
    "sessionEnd": [{ "command": "bash .vibe-mind/hook.sh cursor end en" }],
    "preCompact": [{ "command": "bash .vibe-mind/hook.sh cursor end en" }]
  }
}
```

The hook also reads two optional environment variables (set them in the cloud environment):
- `VIBE_MIND_PROJECT=<project>`: name the Vibe Mind project directly. The hook normally identifies the project by the repo (its first commit or remote URL, bound when you started a session in it locally); only when neither matches (e.g. the repo has never had a session) does it use this name, or the folder name if unset, and the folder name in the cloud may differ from your local one. Set it when a cloud environment is used for this one repo only; **don't set it when several repos share one cloud environment**: every unbound repo would be matched to this name (the second one onward becomes "name-2").
- `VIBE_MIND_STOP=off`: don't block at the end of work (for fully unattended tasks). Without it, the hook blocks at most once per stretch of work.

Any hook error (no network, expired token) never stops the task; it only adds a note at session start.

**P7. Tell the user**: list the files you added or changed (the MCP config such as `.mcp.json`, `CLAUDE.md` / `AGENTS.md` / `GEMINI.md`, `.claude/skills/vibe-mind/` / `.agents/skills/vibe-mind/`, `.vibe-mind/hook.sh`, the hook config) and ask the user to commit them; remind them to set `VIBE_MIND_TOKEN` (and, if the environment is used for this repo only, `VIBE_MIND_PROJECT`) in the cloud environment and to allow `vibe-mind.iguos.com`. Each teammate uses their own token and reads and writes the project memory in their own account; to let a colleague read yours, share the project with them on the Vibe Mind website (read-only).

## Optional: import existing experience

Ask the user whether to move the experience already on this computer into Vibe Mind. Sources: your local memory (e.g. Claude Code's `~/.claude/projects/*/memory/`), global instructions (`~/.claude/CLAUDE.md`, `~/.codex/AGENTS.md`, `~/.gemini/GEMINI.md`, excluding the part between `VIBE_MIND_START` and `VIBE_MIND_END`), and this repository's CLAUDE.md / AGENTS.md / GEMINI.md / `.cursor/rules` / README / design, decision and convention docs under `docs/`. If yes, in a session with MCP connected, decide for each point where it goes:

- Decide by scope first: most of another repo's memory is that project's own rules (branches, releases, environments, who runs SQL, feature choices); even if the user corrected you on it, it doesn't go into the Brain — import it later from that repo; when unsure, leave it out.
- About the user and true across projects (boundaries, how they weigh things, goals, workstyle, who they are) → the matching file in `project=@brain` (skip it if the user hasn't turned on the Brain) (boundaries / soul / goals / workstyle / profile), written with append, each point with the evidence "imported from local memory"; condense, don't paste.
- Skills useful in other projects too (approaches and pitfalls) → `project=@knowhow`, path "area/category/title".
- True only for this repository → the current project (call `project_list` and reuse an existing name, otherwise the repository name), path "module/category/title", category one of conventions / decisions / pitfalls / runbooks / external / architecture / todo. Other repositories' project memory isn't imported here; do it when you start work in that repository.
- Don't import: secrets and tokens, contact details and IDs, things that only belong to this computer (ports, local paths), one-off debugging sessions.

One topic per memory (context, conclusion, reason); `memory_search` before writing and update instead of duplicating. When done, write an "import log" with `worknote_write` (what went where, what wasn't imported and why) and give the user the link. Keep your local memory as a fallback; no need to delete it.
