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

# Claude Code

> Give Claude Code project memory with nemu setup claude

```bash theme={null}
npm i -g nemu-cli
nemu login
nemu setup claude
```

`nemu setup claude` (also `nemu setup cc` and `nemu setup claude-code`):

1. Signs you in if needed and registers this computer as a device.
2. Registers an MCP server named `nemu` with Claude Code at user scope, using Claude Code's own
   `claude mcp add`. It runs `nemu mcp`, which uses your sign in and refreshes it, so no token is
   written into Claude Code's config.
3. Asks whether to install hooks in `~/.claude/settings.json` (or `$CLAUDE_CONFIG_DIR`). Pass
   `--hooks`, `--no-hooks` or `--yes` to answer in advance.

Claude Code starts `nemu` on every session, which is why the CLI needs a global install. If it is
missing, setup offers to install it.

## What the hooks do

| Event | Does |
| - | - |
| Session start | Loads the latest handoff, pinned notes and the list of saved notes, plus a short snapshot of the folder read on your machine |
| After an edit | Remembers which files inside the project changed, on your machine only. After the third, it reminds the agent quietly to save a handoff when it finishes. A `memory_write` resets the count |
| Stop | If the work is still unsaved, asks the agent once per session to save a handoff and anything durable it learned. Claude Code labels that one request "Stop hook error"; nothing failed |
| Before compaction | Makes sure the next stop asks for a handoff |
| Session end | Remembers unfinished work locally and mentions it at the next start |

Without hooks, the MCP server still works: Claude Code reads its instructions and calls
`context_load` and `memory_write` on its own, but less reliably.

## Start a session

```bash theme={null}
nemu claude              # sets up if needed, then starts Claude Code
nemu claude -- --resume  # arguments after -- go to Claude Code
```

## Bring in what Claude Code already knows

```bash theme={null}
nemu claude load memories          # Claude Code's saved memories for this project
nemu claude load memories --all    # for every project
nemu claude load sessions          # Claude reads your last sessions and saves what matters
```

`load sessions` never uploads a transcript. It opens Claude Code with your recent session files and
asks it to read them and save notes, so your own model decides what is worth keeping.

## Check and remove

```bash theme={null}
nemu status
nemu uninstall claude
```

`uninstall` removes the MCP server and only the hooks Nemu added. Your notes stay in your account.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.