# Connect your agents

> How to give Claude Code, Codex, Cursor, Gemini CLI, OpenCode, Continue, Warp or any MCP client DMN's code search and shared notes, with the skill, MCP or hooks, and how to check and undo it.

Source: https://getdmn.com/docs/connect/

## Three ways in

| Way | What it gives the agent | Best for |
|---|---|---|
| The skill (`dmn skill-init`) | Teaches the agent the `dmn` command line, which it runs in its own shell | Agents with a shell: Claude Code, Codex, Gemini CLI, Cursor, OpenCode. The lightest way: no tool definitions ride along in every request |
| MCP (`dmn mcp-init`) | DMN's tools: search, read, memory, claims and the rest | Agents without a shell, or that prefer tools |
| Hooks (`dmn hook-init`) | A briefing at the start of each session, and in Claude Code a re-index of each file it edits and the fix when a failed command matches a lesson | Claude Code and Codex |

You can use all three together. Each command shows what it would change; add `--apply` to write it, `--check` to verify it later, and `--remove --apply` to undo it. [Files and folders](/docs/files/#in-your-agents-settings) lists exactly what each writes.

## Agents in the DMN app

Start an agent with **+ agent** in the Fleet panel and it's connected before its first turn: DMN adds its MCP server to the agent's project config, and the agent gets the project's briefing as it starts. Run `dmn skill-init --apply` once as well, so agents can use the lighter command line.

Settings ▸ Connect your AI tools does the same for the agents it finds on your machine: a Connect button for each, or Connect all.

## Claude Code

```sh
dmn skill-init --apply --agent claude    # the dmn skill, and the short-answers rule
dmn hook-init --apply                    # the briefing, edit re-index and lesson hooks, for this project
dmn hook-init --apply --global           # or the same for every project
```

Restart Claude Code afterwards. `dmn mcp-init --apply --agent claude` adds the MCP server as well, if you want the tools too.

Short answers are on by default for Claude Code: the briefing asks it to answer tersely, which [in our benchmark](/benchmarks/#levers) cut tokens by a further 23% with answers rated about as useful. To turn them off, put this in `%APPDATA%\dmn\config.toml`:

```toml
[skill]
compact = "off"
```

## Codex

```sh
dmn skill-init --apply --agent codex     # ~/.codex/skills/dmn
dmn hook-init --apply --agent codex      # the briefing, in ~/.codex/hooks.json
dmn mcp-init --apply --agent codex       # optional: the MCP server, in ~/.codex/config.toml
```

## Cursor

```sh
dmn skill-init --apply --project --agent cursor   # .agents/skills in this project
dmn mcp-init --apply --agent cursor               # .cursor/mcp.json
```

Cursor also reads the skill Claude Code and Codex use from your user folder. `dmn mcp-init --deeplink` prints a link that adds the MCP server to Cursor in one click.

## Gemini CLI, OpenCode, Continue and Warp

| Agent | Command |
|---|---|
| Gemini CLI | `dmn skill-init --apply --agent gemini` and `dmn mcp-init --apply --agent gemini` |
| OpenCode | Reads the Claude Code and Codex skills. For an OpenCode-only setup: `dmn skill-init --apply --agent opencode` |
| Continue | `dmn mcp-init --apply` writes `.continue/mcpServers/dmn.yaml` |
| Warp | `dmn mcp-init --apply` writes `.warp/.mcp.json` |

## Any other MCP client

DMN's MCP server is the `dmn-mcp-bridge` program, which speaks MCP over standard input and output and finds the project from the folder it starts in. Most clients take a block like this:

```json
{
  "mcpServers": {
    "dmn": { "command": "dmn-mcp-bridge", "args": [] }
  }
}
```

`dmn mcp-init --print` prints the exact block for each client it knows. [MCP tools](/docs/mcp-tools/) lists the tools the server offers.

## Check it worked

```sh
dmn config verify     # every skill, MCP entry and hook, and whether each is current
```

Then ask the agent something about your code. A connected agent runs `dmn search` (or the `search` tool) instead of grepping.
