# Connect Claude Code to Rakuten Shared Memory For Rakuten colleagues using Claude Code on Windows. Set this up once for each Windows user and computer; you don't need administrator access. Using the Claude app or Cowork instead? See [the Claude app setup](https://memory.rmgops.com/setup/claude-app). Codex has [its own page](https://memory.rmgops.com/setup/codex). The [illustrated user guide](https://memory.rmgops.com/guide) explains the features. Setup help: Rich Masters ([richard.masters@rakuten.com](mailto:richard.masters@rakuten.com)). ## Before you start You need Claude Code installed and working, your `@rakuten.com` email address and access to that inbox. Use your own Windows account on an approved work device. If your organisation manages Claude Code settings, ask your IT team before changing them; don't work around a restriction. There is no token to copy. Claude Code signs in to Shared Memory through your browser, the same way the Claude app does. ## 1. Sign in to Shared Memory in your browser 1. Open [memory.rmgops.com/login.html](https://memory.rmgops.com/login.html) in the browser you normally use. 2. Enter your Rakuten email address and select **Send sign-in link**. 3. Open the email and select the link. It works once and expires after 15 minutes. Don't forward it or paste it into an AI chat. Doing this first means step 3 goes straight to the **Allow** page. If you skip it, step 3 asks you to sign in on the way. ## 2. Add Shared Memory to Claude Code Open **Windows PowerShell** (not as administrator) and run: ```powershell claude mcp add --transport http shared-memory https://memory.rmgops.com/mcp --scope user ``` `--scope user` makes the connection available in every project. If a `shared-memory` entry already exists, for example from the older token setup, remove it first with `claude mcp remove shared-memory --scope user`, then run the command again. ## 3. Sign in from Claude Code In the same PowerShell window, run: ```powershell claude mcp login shared-memory ``` Or, inside a Claude Code session, type `/mcp`, select **shared-memory** and choose **Authenticate**. Your browser opens the Shared Memory **Allow** page: 1. If it asks you to sign in, select **Sign in**, follow the email link in the new tab, then come back to the first tab. It continues on its own; if it doesn't, select **I've signed in**. 2. Check that the page says **Allow an app on this computer?**, names Claude Code, and shows your own email address. 3. Select **Allow**. The browser shows a short Claude Code page saying sign-in worked; you can close that tab. The app name on that page is only what the app calls itself, so it isn't the real check. The real check is that you started this sign-in from Claude Code yourself, just now; if the page appears when you didn't, select **Cancel**. Once you've selected **Allow**, start a **new** Claude Code session; one that was already running won't see the new tools. ## 4. Check the connection without saving anything In a new session, ask: > Check whether the shared-memory MCP is connected. Use list_scopes as a read-only test and tell me whether it worked. Don't save, edit or delete anything. You're done when the live `list_scopes` call succeeds. If you see only **Your notes**, that's normal: you see a shared scope once its owner adds you. Don't test by saving a sample record. ## Staying signed in Claude Code keeps itself signed in: it renews its access every hour without asking you. You sign in again (step 3) only if you haven't used it for 30 days, and at least once every 90 days. Each sign-in is listed in the web app under **Apps** (in the menu under your email, top right), **Connected apps**. Select **Disconnect** to cut off that one app at once, for example on a computer you no longer use. Set up with a token before? It keeps working; you don't have to switch. To switch, do steps 2 to 4, then revoke the old token under **Apps**, **Advanced: tokens for scripts and services**. If you installed the optional hooks (step 5), keep that token: the hooks still use it. ## 5. Optional: hooks and the check-before-build skill The hooks run as small scripts outside Claude Code, so they can't use its sign-in. They still need a token of their own: 1. In the web app, open **Apps** (in the menu under your email, top right), then **Advanced: tokens for scripts and services**. 2. In the name box, enter a recognisable name, such as `Claude Code hooks - work laptop`, then select **Generate**. Leave the token box open; it's shown only once. 3. From a clone of the Shared Memory repository, run: ```powershell powershell -ExecutionPolicy Bypass -File harness\install.ps1 -Harness claude ``` At its hidden prompt, go back to the token box, select **Copy**, paste the token into PowerShell and press **Enter**. Then copy some ordinary text to replace the token on your clipboard, and close the token box. If a token is already saved, the installer keeps it and doesn't ask. It adds, for Claude Code only: a brief of your scopes and recent records at the start of each session (sending only your project folder's name, so matching scopes come first); a reminder to save anything durable on the 4th turn and every 10th after, skipped when the session has already saved since the last reminder, and again on the first prompt after a break of more than 10 minutes; enforcement of the `#memory` modes; the policy block in `~/.claude/CLAUDE.md`; and the `check-before-build` skill in `~/.claude/skills/`. Every file it changes is backed up first, and re-running it is safe. Re-run it to pick up later hook changes. ## Using it Ask in plain language, for example "what do we know about this account?" or "save that the renewal moved to March, from today's call". Claude Code checks for an existing record first, picks the scope whose subject fits (or asks you), and says what it saved and where. Typing `#memory off`, `#memory read-only` or `#memory on` in a message sets the mode for the rest of that session. With the hooks installed these are enforced; without them, Claude Code is asked to respect them. ### What never to store Never store: card and bank numbers, tax IDs, payment details, transaction-level client data, clients' customers' personal data (consumer emails, phone numbers, order-level data), credentials, and opinions or personal details about named people beyond their working role. Client contacts: names and roles only where the fact needs them; contact details stay in Salesforce. Label anything that identifies a person confidential or above. The service checks saves for card, bank, tax ID, phone and non-staff email patterns. ### Before building an AI agent or automation Ask Claude Code to check first ("check whether this already exists before we build it"). With the skill installed it compares your idea with the AiA automation catalogue, Mirai and Shared Memory's initiative records, and records the outcome. Your prompt is never stored, only a short purpose. ## Troubleshooting - **No tools in the session.** Start a new session; tools added mid-session don't appear. Check `claude mcp list`. - **After a Shared Memory update, a tool refuses a value or says a field is missing.** The session still has the old tool list. Start a new session. - **`/mcp` shows shared-memory as needing authentication, or you see 401.** Sign in again (step 3). This is expected after 30 days without use, after 90 days, or after you disconnect the app in the web app. - **No browser opens.** Run `claude mcp login shared-memory --no-browser`. It prints a link: open it in your browser, select **Allow**, then paste the address your browser ends up on back into Claude Code. - **The browser says "This sign-in can't continue".** Start again from step 3. If it keeps happening, update Claude Code and try again, then contact Rich with the message shown (it contains nothing secret). - **The Allow page shows someone else's email.** Select **Cancel**, sign in to the web app as yourself in that browser (step 1), then repeat step 3. - **No brief at session start (hooks installed).** Check the hooks token is saved: `-not [string]::IsNullOrWhiteSpace([Environment]::GetEnvironmentVariable('SHARED_MEMORY_TOKEN','User'))` should print `True`. Restart Claude Code after saving it. The check prints only `True` or `False`; never print the token itself. - **Pasted a token or sign-in link into a chat?** Treat it as exposed. Revoke the token under **Apps**, **Advanced**, and generate a new one; a sign-in link stops working once used or after 15 minutes. ## Scripts and services A token is only for something that can't sign in through a browser, such as a script on your computer or the optional hooks. Create it under **Apps**, **Advanced: tokens for scripts and services**. It acts as you with your access, so give each script its own, never share one, and revoke it when it's no longer used. An unattended job that shouldn't depend on one person, such as the Relevance service, gets a service identity from Rich instead.