Supported agents
Context Graph works with seven coding agents. For each one, setup installs
hooks that record sessions, registers the Model Context Protocol (MCP) server
that serves the recall
and memory tools, and can turn off the agent’s own memory.
This page lists the files setup changes for each agent, and where the agents behave differently. For an app you build on an agent SDK, see Custom agents.
| Agent | Runtime name | How it’s connected | Applies to |
|---|---|---|---|
| Claude Code | claude-code | Context Graph plugin | Your user |
| Codex | codex | Context Graph plugin | Your user |
| GitHub Copilot CLI | copilot-cli | .github/hooks/memgraph-context-graph.json | One project |
| Cursor | cursor | .cursor/hooks.json | One project |
| OpenCode | opencode | .opencode/plugins/memgraph-context-graph/index.js | One project |
| Antigravity CLI | antigravity-cli | .agents/hooks.json | One project |
| Grok Build | grok | .grok/hooks/memgraph-context-graph.json | One project |
Use the runtime name to choose agents in memgraph-context-graph setup,
update, uninstall and doctor.
Claude Code and Codex sessions are recorded in any directory. For the other
agents, the hook file is in the project directory, never in your home
directory, so only sessions started in a connected project are recorded.
Connect more projects with --project-dir. If a hook file already exists,
setup keeps your own hooks in it.
MCP server registration
The recall and memory tools are served by memgraph-context-graph mcp, an
MCP server named context-graph. Memory belongs to you, not to one project,
so the server is registered in each agent’s user-level configuration:
| Agent | Where the server is registered | How its tools are allowed |
|---|---|---|
| Claude Code | The plugin | The plugin |
| Codex | The plugin | The plugin |
| GitHub Copilot CLI | ~/.copilot/mcp-config.json | Copilot CLI has no allow list: approve the tools once, or start it with --allow-tool=context-graph |
| Cursor | ~/.cursor/mcp.json | Mcp(context-graph:*) in ~/.cursor/cli-config.json |
| OpenCode | mcp.servers in ~/.config/opencode/opencode.json | An allow rule in permissions |
| Antigravity CLI | ~/.gemini/config/mcp_config.json | mcp(context-graph/*) in ~/.gemini/antigravity-cli/settings.json |
| Grok Build | ~/.grok/config.toml | MCPTool(context-graph__*) |
Setup adds the tools to the agent’s allow list because an agent that runs
without a person, for example in a script, refuses a tool that needs approval.
Each file setup edits keeps the rest of its content and is backed up once, to
FILE_NAME.context-graph.bak next to it.
Setup registers the server with the agent’s runtime name, as in
memgraph-context-graph mcp --agent cursor, so it uses the agent’s
profile.
Pass the same flag if you register it yourself.
Built-in memory
When you make Context Graph the agents’ memory, setup turns off the agent’s own memory, so the agent doesn’t keep two. Some agents have no memory of their own to turn off.
| Agent | Built-in memory | What setup changes |
|---|---|---|
| Claude Code | Auto memory | Sets autoMemoryEnabled: false in ~/.claude/settings.json and imports the existing memory files |
| Codex | Memories | Turns off features.memories, memories.use_memories and memories.generate_memories in ~/.codex/config.toml and imports the existing memory |
| GitHub Copilot CLI | Copilot Memory, stored on GitHub | Sets "memory": false in ~/.copilot/settings.json; the memory stays on GitHub and isn’t imported |
| Cursor | None | Nothing |
| OpenCode | None | Nothing |
| Antigravity CLI | None in the CLI | Nothing |
| Grok Build | Topic notes in ~/.grok/memory-v2/ | Sets [memory_v2] enabled = false and imports the notes to /memories/grok/ |
See Memory for how the import works and how to switch back.
Differences between agents
The agents’ hooks don’t all expose the same events. By default, an agent gets the session-start note, its session is processed when it ends, and its pre-tool hook can only allow, block or rewrite a tool call. The differences:
| Agent | Differs from the default |
|---|---|
| Claude Code | Gets a note right before a tool runs, such as that a GitHub issue it’s about to fetch is already in the graph. |
| Codex | Gets a note right before a tool runs, as Claude Code does. Reloads the memory index after it compacts the context. Sessions are processed at the end of each turn. |
| GitHub Copilot CLI | None |
| Cursor | The session-start note reaches the Cursor CLI; the Cursor editor’s agent window may not show it to the model. |
| OpenCode | With opencode run, sessions are processed at the end of each turn. |
| Antigravity CLI | Sessions are processed at the end of each turn. Context Graph reads prompts and replies from the agent’s session transcript. |
| Grok Build | Gets the session-start note through the MCP server’s instructions. |
Codex also differs in two smaller ways:
- Its session-start note is limited to 9,000 characters instead of 10,000, because Codex accepts about 2,500 tokens of hook text.
- A patch Codex rejects before applying it, and a
view_imagecall, are stored without a result.
Connect an agent manually
Setup connects agents for you. To install the Claude Code or Codex plugin
yourself, for example on a machine where you manage plugins by hand, install
context-graph from the Memgraph
marketplace, which also has the
Memgraph plugin:
claude plugin marketplace add memgraph/marketplace
claude plugin install context-graph@memgraph -yThe plugin doesn’t install the memgraph-context-graph command its hooks run.
Without it, nothing is recorded, and the agent offers to run the plugin’s
setup skill (/context-graph:setup in Claude Code), which asks before it
installs the command and runs setup.
For the per-project agents, the memgraph-context-graph hook init RUNTIME
command writes the hook file in the current directory, where RUNTIME is the
agent’s runtime name:
memgraph-context-graph hook init cursorThe hook init command writes only the hooks. Run memgraph-context-graph setup for the
MCP server registration and the memory switch.