# Getting Started

## Requirements

* [pnpm](https://pnpm.io) 10+ on Node 22+, or [mise](https://mise.jdx.dev/) — if pnpm isn't installed, the CLI installs mise and uses it to fetch node + pnpm
* An AI coding agent that supports [Agent Skills](https://agentskills.io) — [Claude Code](https://claude.ai/code), Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf, Goose, … Setup asks which ones to install the skills for.
* [Obsidian](https://obsidian.md/) — optional but recommended

## Step 1 — Scaffold

```bash
npx claude-second-brain
```

Or install globally for a shorter command (`csb` is an alias):

```bash
npm i -g claude-second-brain
csb                    # same as: claude-second-brain
```

The CLI will ask:

* **Brain name** — what to call this brain (default: `my-brain`)
* **Git remote** — optionally host your vault on **[GitHub](https://jessepinkman9900.github.io/claude-second-brain/remotes/github)** (requires `gh` CLI) or **[Cloudflare Artifacts](https://jessepinkman9900.github.io/claude-second-brain/remotes/cloudflare-artifacts)** (requires a Cloudflare account + wrangler)
* **Register qmd collections after install?** — runs `pnpm qmd:setup` once dependencies are installed
* **Install skills for which agents?** — Claude Code plus any detected agent is preselected; see [Install skills for any agent](https://jessepinkman9900.github.io/claude-second-brain/cli/skills#install-skills-for-any-agent)

Every question is asked up front, so the rest of setup runs unattended.

Creates the brain at `~/.claude-second-brain/my-brain/`, registers it in `~/.claude-second-brain/config.toml`, runs `pnpm install` (using your system pnpm 10+, or mise to fetch node + pnpm if it's missing), registers the qmd collections, installs the skills for the agents you picked, and runs `git init`.

## Step 2 — Generate vector embeddings

```bash
csb reindex my-brain    # or: npx claude-second-brain reindex my-brain
```

Generates local vector embeddings. First run downloads ~2GB of GGUF models — once.

## Step 3 — Open in Obsidian (and push to GitHub if not done)

**If you created a GitHub repo during setup**, it's already pushed — skip straight to opening in Obsidian.

**If you skipped GitHub during setup**, connect it now:

```bash
git remote add origin https://github.com/you/my-brain.git
git push -u origin main
```

Open `~/.claude-second-brain/my-brain/` as a vault in Obsidian — the folder is already a valid Obsidian vault. The Git plugin is pre-configured — enable it and sync is automatic.

## Multiple brains

Run `csb create <name>` (or `npx claude-second-brain create <name>`) to create additional brains. Each gets its own folder under `~/.claude-second-brain/` and its own isolated qmd index. The global skills (`/brain-ingest`, `/brain-remember`, `/brain-search`, `/brain-refresh`) always operate on the **default brain** in `~/.claude-second-brain/config.toml`. The first brain created is set as the default automatically.

See the [CLI Reference](https://jessepinkman9900.github.io/claude-second-brain/cli) for `ls`, `use`, `rm`, `path`, `qmd`, `exec`, `skills`, `git-token`, `upgrade`, and `doctor` subcommands that manage and target specific brains.

## Access from anywhere

**Edit anywhere — your agent on desktop, web or mobile.** The vault is a plain git repo, so any agent that can clone it can work on it: run it locally, or use a cloud agent with GitHub access (Claude Code on the web and mobile, Codex cloud, Copilot coding agent, Cursor background agents, …) to ingest a source, run a query, or update a page from your phone.

**Read anywhere — Obsidian desktop and mobile.** Open the repo as an Obsidian vault. The bundled `.obsidian` folder pre-configures [obsidian-git](https://github.com/Vinzent03/obsidian-git) — no setup required. Your wiki syncs automatically on every commit. For iPhone and iPad, see [iCloud sync](https://jessepinkman9900.github.io/claude-second-brain/integrations/icloud).

**Browse anywhere — your git host.** It's a plain git repo. On GitHub (or any host with a web UI), view and edit files directly in the browser at any time.
