> ## Documentation Index
> Fetch the complete documentation index at: https://docs.membase.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Claude Code

> Connect Membase to Claude Code with the Membase Claude Code plugin. Add persistent memory, wiki retrieval, slash commands, hooks, and project-aware context to your coding sessions.

The Membase Claude Code plugin is the recommended way to use Membase in Claude Code. It runs locally with Claude Code, connects to your Membase Cloud account through OAuth, and exposes memory and wiki workflows through both slash commands and MCP tools.

<Steps>
  <Step title="Install the Membase Claude Code plugin">
    ```bash theme={null}
    claude plugin marketplace add aristoapp/claude-membase && claude plugin install membase@membase-plugins
    ```
  </Step>

  <Step title="Load the plugin in Claude Code">
    Open Claude Code. If Claude Code is already open, run:

    ```text theme={null}
    /reload-plugins
    ```
  </Step>

  <Step title="Connect your Membase account">
    In Claude Code, run:

    ```text theme={null}
    /membase:login
    ```

    The login flow opens browser OAuth and asks you to choose an auto-capture mode:

    * `wiki`: enable Wiki auto-capture for user/assistant conversation transcripts
    * `off`: disable hook-based auto-capture
  </Step>

  <Step title="Verify the connection">
    Run:

    ```text theme={null}
    /membase:status
    ```

    Confirm the connected account before saving memory or wiki data.
  </Step>
</Steps>

## What the Plugin Adds

* **Slash commands**: `/membase:login`, `/membase:status`, `/membase:recall`, `/membase:remember`, `/membase:wiki`, `/membase:index-project`, and `/membase:project-config`
* **Automatic recall**: Searches Membase before prompts when auto-recall is enabled and injects relevant context as untrusted reference data
* **Wiki retrieval**: Lets Claude Code search, add, update, and delete factual wiki documents through Membase tools
* **Hooks**: Supports session start context, prompt-time recall, and opt-in Wiki capture for durable conversation source material
* **Project-aware workflows**: Can scope memories to the current git repository when project mode is enabled
* **Local credential storage**: OAuth tokens are stored in Claude Code's plugin data directory, not in plugin user settings

<Tip>
  Auto-capture only controls hook-based capture. Claude can still write memories or Wiki docs through Membase tools when appropriate.
</Tip>

## Auto-Capture Privacy

Auto-capture is opt-in during `/membase:login`. Wiki capture stores the user/assistant conversation transcript as original source material in Membase Wiki, not as extracted Memory.

The plugin redacts secrets, `.env` values, private key blocks, and content wrapped in `<private>` or `<membase-private>` before capture.

## Session Start Context

Session start context (`sessionStartContext`) is separate from auto-capture. When configured, the plugin can provide relevant Membase context at the beginning of a Claude Code session so Claude starts with project background before your first prompt.

That context is read-only reference material. It does not write new memories or Wiki documents by itself, and Claude should treat retrieved content as untrusted context that still needs user intent before taking action.

## MCP Fallback

If Claude Code plugins are not available in your environment, you can still connect Membase as a standard MCP server:

```bash theme={null}
npx -y membase@latest --client claude-code
```

The MCP fallback provides the core memory and wiki tools, but it does not include Claude Code plugin slash commands, hooks, or project-aware workflows.

## Troubleshooting

<AccordionGroup>
  <Accordion title="Claude Code does not show Membase commands">
    Run `/reload-plugins` inside Claude Code. If the commands still do not appear, run `claude plugin marketplace add aristoapp/claude-membase && claude plugin install membase@membase-plugins` again and start a new Claude Code session.
  </Accordion>

  <Accordion title="I connected the wrong Membase account">
    Run `/membase:logout`, then `/membase:login` and verify the account with `/membase:status`. For the cleanest context after switching accounts, run `/clear` or start a new Claude Code session.
  </Accordion>

  <Accordion title="I already have the old Membase MCP setup installed">
    Keep the Claude Code plugin as the primary path. You can leave the remote MCP setup as a fallback, but if duplicate tools are confusing, remove the older MCP configuration after confirming the plugin works.
  </Accordion>
</AccordionGroup>

## Next Steps

<CardGroup cols={2}>
  <Card title="Bring Your Context" icon="download" href="/getting-started/bring-context">
    Import chat history, connect apps, and more.
  </Card>

  <Card title="Use Your Context" icon="comment-dots" href="/getting-started/use-context">
    Chat with Memory, agent retrieval, and dashboard exploration.
  </Card>

  <Card title="Knowledge Wiki" icon="book" href="/features/wiki">
    Store factual knowledge alongside your memories.
  </Card>

  <Card title="Membase MCP" icon="link" href="/features/membase-mcp">
    See every MCP tool your agent can call.
  </Card>
</CardGroup>
