# Agent Installation Instructions This file is the canonical source for the full agent-driven onboarding sequence: evaluation, installation, activation, and tooling configuration. Short stable URL for site snippets: `install.md` at repo root. ## Design principle The canonical onboarding sequence is: **evaluation → installation → activation → tooling config** The activation phase follows: **detect context → discover → propose → preview → ingest → reconstruct → query → correct** Not: - install first without checking fit or tool constraints - scan everything → ingest everything → hope value appears - configure every integration before the user has seen first value - assume the install directory is a personal-data directory when it may be a developer/projects directory The agent optimizes for reaching the Installation Aha: a reconstructed timeline from the user's own files, with every event traced to a specific source. The first visible post-ingest output is never a file count -- it is a timeline with provenance. When the install directory is developer-oriented (multiple git repositories present), activation may branch from "detect context" into a [repo-integration path](#activation-branch-developer--repo-integration) that outputs a written integration plan instead of proceeding to ingest. ## Workflow ### Phase 1: Evaluation Start by deciding whether Neotoma is a fit and what the first successful path should be. 1. Assess fit from available context before asking broad questions. 2. Determine the user's current tool and environment constraints: - local agent environment vs hosted chat product - MCP support level - whether the current tool can support robust Neotoma usage 3. Identify the likely first data to store if the user proceeds. 4. Determine whether the user is already installed: - if no, proceed to installation after confirmation - if yes, skip directly to activation 5. If the current tool is constrained, say so explicitly and recommend the best-supported path. **Tooling guidance during evaluation:** - **ChatGPT hosted**: If the user lacks the plan/features for strong MCP support, recommend more robust options such as Cursor, Claude, Claude Code, or Codex for primary Neotoma usage. - **ChatGPT with suitable support**: Plan for either remote MCP or a Custom GPT, depending on the user's account and preference. - **Claude**: Plan for Project-based usage plus connector configuration and project instructions. - **Cursor / Claude Code / Codex**: prioritize local install and activation first; after activation, offer help configuring additional remote access points if useful. - **OpenClaw**: prioritize the native plugin install path first (`openclaw plugins install clawhub:neotoma`). Use manual MCP wiring only as fallback when the plugin path is unavailable or unsuitable. Data evaluation can happen here before installation if the user already has enough context available in the current tool. If not, perform that evaluation during activation after installation. Do not ingest anything before explicit confirmation. ### Phase 2: Installation The installation phase is optimized for agent harnesses with directory-scoped permissions. The agent MUST use the canonical `neotoma` commands below and MUST NOT improvise shell introspection (`python3 -c`, `grep -r`, `ls`, `cat`, `jq`, `find`, `which`, `node -e`). Each such command typically triggers a separate permission prompt; the canonical commands collapse the entire flow into two approvals: `neotoma *` (wildcard) and a one-time `npm install -g neotoma`. **Step 2.1 — Permissions pre-flight** Neotoma needs one wildcard allow entry so subsequent commands run without per-command prompts. For **allowlist-capable harnesses** (`claude-code`, `cursor`, `codex`): run `neotoma preflight --tool --apply` to write the entry directly. If the user prefers to apply it manually, run `neotoma preflight --tool ` (no `--apply`) to print a single copy-paste block. Harness file locations for manual reference: - Claude Code: `.claude/settings.local.json` (project) or `~/.claude/settings.json` (user) - Cursor: `.cursor/allowlist.json` (project) - Codex: `~/.codex/config.toml` (user) For **MCP-only harnesses** (`claude-desktop`, `openclaw`, `windsurf`, `continue`, `vscode`): these harnesses have no writable command allowlist. Skip this step — `neotoma setup` in Step 2.4 configures the MCP server entry, which is the only permission surface these harnesses expose. The `preflight` command is idempotent — re-running it after the entry is already present reports `already_ok: true` and makes no changes. Note that Step 2.4 (`neotoma setup`) also writes the same allowlist entries, so this step is only strictly necessary when the allowlist must be in place before `npm install -g neotoma` runs (i.e. when `neotoma` is not yet on PATH). If `neotoma` is not yet on PATH, skip this step; the install step (Step 2.2) will place the binary, then return here. **Step 2.2 — Install the binary (if needed)** If the user is not already installed: - OpenClaw: `openclaw plugins install clawhub:neotoma` - All other harnesses: `npm install -g neotoma` (global install is required so the binary resolves on the agent's PATH without per-repo `npx` prompts; an opt-in local-install path is documented at the bottom of this file) **Step 2.3 — Inspect state with a single call** Run `neotoma status --json`. (If that command is not found on an older install, fall back to `neotoma doctor --json` — `doctor` is the deprecated former name of this command and still works as an alias.) This returns a consolidated snapshot covering: - install state (installed, version, `path_fix_hint` when PATH is wrong) - data/init state (config_dir, data_dir, db_exists, initialized) - API runtime state (running, env, port) - detected MCP server configs per harness - CLI instruction files per harness (project + user scope) - permission-file status per harness - `current_tool_hint` and `suggested_next_step` Do NOT run shell introspection commands to recover any of this state. Every field above is available from `status --json`. **Step 2.4 — Apply the full setup in one call** Run `neotoma setup --tool --yes`. This composes: - `neotoma init --yes --idempotent` (safe to re-run; no-op when already initialized) - MCP configuration for the current tool - CLI instructions installation for the current tool - permission-file patches (merge-preserving; adds `neotoma *` wildcard and `npm install -g neotoma` allow entries) Use `--dry-run` first if the harness is strict; `--json` returns a structured report of every step, including changed files. For the full flag surface (`--install-scope` for MCP + CLI instruction files, permission `--scope`, `--mcp-transport`, `--rewrite-neotoma-mcp`, `--skip-hooks`, `--all-harnesses`, `--dry-run`, and `--skip-permissions`), see [`docs/developer/cli_reference.md#harness-setup`](docs/developer/cli_reference.md#harness-setup). **MCP transport presets** (`--mcp-transport `): | Preset | Description | Requires | |--------|-------------|----------| | `a` | Signed HTTP proxy via `/mcp`, auto-detected port | AAuth keypair, running API | | `b` | Unsigned local stdio (npm global binary) — **default for npm onboarding** | npm global install | | `c` | Direct stdio via `tsx src/actions.ts` (source checkout, hot-reload) | Source checkout, tsx | | `d` | Two slots: `neotoma` (signed proxy) + `neotoma-dev` (direct stdio) | Source checkout, AAuth keypair | | `e` | Single slot, signed shim, prod port profile (source-checkout recommended) | AAuth keypair, running API | The default MCP transport is **B** for standard npm onboarding. Use **E** when working from a source checkout with a running dev server (`neotoma auth keygen --register` first). See [Developer setup (source checkout)](#developer-setup-source-checkout) for the full workflow. **Step 2.5 — Verify install (grep for canonical confirmation line)** After `neotoma setup` completes, two plain-text lines appear on stdout: 1. `Neotoma installed at (resolved via ; v; data_dir=; mcp=)` — grep for `Neotoma installed at` to confirm success. 2. `Transport: local stdio MCP (no network egress). ...` — answers the privacy/transport question. If the first line is absent (for example, after a standalone `npm install -g neotoma` without running setup), run `neotoma setup --tool --yes` to produce it. If the binary is not on PATH, check `neotoma status --json` → `.neotoma.path_fix_hint` and surface that hint to the user before retrying. **If the user is already installed** Run `neotoma status --json` to verify, then `neotoma setup --tool --yes` (idempotent) to bring any missing pieces into compliance. Do not improvise shell introspection to confirm state. **Forbidden during installation** - Do NOT run `python3 -c`, `grep -r`, `ls`, `cat`, `jq`, `find`, `which`, `node -e` to introspect Neotoma state. Use `neotoma status --json`. - Do NOT run arbitrary `npm run