Skip to content

Connect your Claude Code

alfe claude connect gives the Claude Code you already use access to an Alfe agent. After you run it, a plain claude session on that machine has Alfe’s tools, recalls that agent’s memory when it starts, and saves new messages to memory as it goes.

This is different from the Claude Code runtime, where Alfe runs the agent for you. Here, you stay at the keyboard in your own terminal sessions.

You need the following on the machine:

  • Claude Code installed, with claude on your PATH.
  • The Alfe CLI, installed with npm install -g @alfe.ai/cli.
  • An agent key in ~/.alfe/config.toml. Generate a setup token on the agent’s Overview tab, then run alfe login --token <SETUP_TOKEN>.

Run this once:

Terminal
alfe claude connect

It’s safe to re-run. It does two things:

  1. Registers the Alfe MCP server in Claude Code at user scope, as alfe-platform.
  2. Adds memory hooks to ~/.claude/settings.json for SessionStart, Stop, and SessionEnd. Your existing settings and hooks stay in place. If the file isn’t valid JSON, the command stops rather than overwrite it.

Start a new session and list its MCP servers:

Terminal
claude

Then type /mcp in the session. It should list alfe-platform.

A connected session gains these capabilities:

  • Alfe tools, including memory, voice, messaging, and search.
  • Recall at session start. The hook loads relevant memory into the session.
  • Capture as you go. The hooks send new user and assistant messages to the agent’s memory when Claude stops and when the session ends.

A hook never breaks your session. If Alfe is unreachable, it does nothing, and it retries the unsaved messages next time.

There’s no disconnect command, and alfe remove doesn’t touch Claude Code. To undo the connection, remove the MCP server:

Terminal
claude mcp remove --scope user alfe-platform

Then delete the alfe claude hook entries from ~/.claude/settings.json.