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

# Claude Code CLI

> Connect your Claude Code CLI to CORE's memory system

CORE transforms Claude Code into a persistent memory agent that remembers your preferences, past decisions, and project context across all sessions.

## Prerequisites

* [Claude Code](https://docs.anthropic.com/en/docs/claude-code) installed
* CORE account - [Sign up at app.getcore.me](https://app.getcore.me)
* Node.js 18+ installed

## Installation

### Method 1: Plugin (Recommended) - \~2 minutes

The CORE Brain plugin automatically handles memory integration for you.

**Step 1: Install CORE CLI and login**

```bash theme={null}
npm install -g @redplanethq/corebrain
```

```bash theme={null}
corebrain login
```

**Step 2: Add Plugin Marketplace and Install**

Open Claude Code and run:

```bash theme={null}
/plugin marketplace add redplanethq/core
/plugin install core_brain
```

**Step 3: Restart and Authenticate**

```bash theme={null}
# Restart Claude Code, then authenticate:
/mcp
# Select core_brain from the list and authenticate via browser
```

That's it! CORE is now automatically integrated with your Claude Code sessions.

## How It Works

### Automatic Persona Loading

When you start a Claude Code session, the plugin automatically:

1. **Fetches your persona document** - A comprehensive summary of your preferences, rules, decisions, and patterns extracted from all your past conversations
2. **Injects it into Claude's context** - Claude always has your personalized context available without you needing to repeat yourself
3. **Enables memory search** - Claude can search your entire knowledge graph for relevant context

**Example**: If your persona includes "Prefers concise code reviews with actionable feedback" and "Always runs tests before commits", Claude will follow these rules automatically in every session.

### SessionStart Hook

On every session start (`startup`, `clear`, or `compact`), the plugin:

* Authenticates with CORE using your stored credentials
* Fetches your latest persona document
* Provides guided memory search instructions to Claude
* Exports your CORE auth token to the session environment

### Stop Hook (Memory Ingestion)

When you end a session, the plugin:

* Extracts conversation pairs from the session transcript
* Tracks what's already been ingested to avoid duplicates
* Queues new conversations for ingestion into your knowledge graph

## Features

### 1. Persistent Memory Across Sessions

Your persona document is auto-generated from all your conversations and includes:

* **Preferences**: Coding style, tools, patterns you prefer
* **Decisions**: Past architectural choices and their reasoning
* **Directives**: Hard rules like "always run tests" or "never skip code review"
* **Knowledge**: Technologies and concepts you're familiar with
* **Goals**: What you're working toward
* **Identity**: Your role, company, expertise level

### 2. Memory Search Tool

Claude automatically searches your memory when:

* You mention "previously", "before", "last time"
* Working on a project with history
* You reference past decisions or discussions
* Starting work on features that might have context

The plugin provides intelligent search patterns:

* **Entity-Centric**: "User's preferences for API design and error handling"
* **Multi-Entity Relationship**: "Manoj and Harshith discussions about BFS search implementation"
* **Semantic Questions**: "What causes BFS search to return empty results?"
* **Temporal**: "Recent changes to search implementation and reranking logic"

### 3. Integration Actions

Execute actions in your connected apps directly from Claude Code:

* Create/read GitHub and Linear issues
* Draft/send/read emails
* Manage calendar events
* Update spreadsheets

## Available Tools

The plugin exposes these MCP tools to Claude:

* `memory_search`: Search your knowledge graph for relevant context
* `get_integrations`: List your connected integrations (GitHub, Linear, Slack, etc.)
* `get_integration_actions`: Discover available actions for an integration
* `execute_integration_action`: Perform actions in connected apps

## Verify Connection

Test that everything works:

```bash theme={null}
# In Claude Code:
Search my memory for recent discussions about authentication

# Claude will automatically use the memory_search tool
```

You should see results from your past conversations.

### Method 2: Manual MCP Setup (Advanced)

For users who need manual control or custom configuration:

**Step 1: Install the CORE MCP Server**

```bash theme={null}
claude mcp add --transport http --scope user core-memory https://app.getcore.me/api/v1/mcp?source=Claude-Code
```

**Step 2: Authenticate**

1. Type `/mcp` in Claude Code
2. Select core-memory from the list
3. Authenticate via your browser

**Step 3: Configure Custom Agents (Optional)**

Create `.claude/agents/` directory and add custom memory search/ingest agents if needed. See the [advanced configuration guide](https://docs.getcore.me/providers/claude-code/advanced) for details.

## What Makes This Different

**Traditional RAG**: "What text chunks look similar to this query?"

**CORE Memory Agent**: "What does the user want to know, and where in their organized knowledge does that live?"

CORE doesn't just search text—it understands intent, classifies queries, and retrieves exactly what matters. Your preferences from 3 months ago, the decision you made last week, the problem you solved yesterday—all connected and surfaced at the right time.

## Troubleshooting

**Plugin Installation Issues:**

* Ensure Node.js 18+ is installed: `node --version`
* If `npm install -g @redplanethq/corebrain` fails, try with sudo: `sudo npm install -g @redplanethq/corebrain`
* After plugin installation, always restart Claude Code before authenticating

**Authentication Issues:**

* Run `corebrain me` to check authentication status
* If not authenticated, run `corebrain login` manually
* Ensure you're logged into your CORE account in the browser
* Restart Claude Code if authentication seems stuck

**Memory Search Not Working:**

* Verify plugin is installed: `/plugin list` should show core\_brain
* Check MCP connection: `/mcp` should show core\_brain as Connected
* Try manual memory search: "Search my memory for recent work"

**Persona Not Loading:**

* The persona is automatically fetched on session start
* If missing, check the SessionStart hook output in Claude Code logs
* Verify your CORE account has stored conversations

## Learn More

* **GitHub Repository**: [https://github.com/RedPlanetHQ/core](https://github.com/RedPlanetHQ/core) - CORE is open source! Star the repo, explore the code, contribute.
* **Discord Community**: [Join #core-support](https://discord.gg/dVTC3BmgEq) for help and discussions
* **Documentation**: [docs.getcore.me](https://docs.getcore.me) for comprehensive guides
