Agent integrations

AI Code Insights uses native coding-agent hooks or plugins to attribute edits and capture eligible sessions. Use this reference to understand each integration, validate its configuration, and disable or repair one tool without removing the daemon.

Note: Agent APIs change independently from the daemon. Use the current daemon version and include both versions when reporting an integration problem.

Supported agents

Agent Code attribution Transcripts Token usage Tool/MCP/Skill usage
Codex CLI Yes Yes Yes Yes
Codex Desktop app Yes Yes Yes Yes
Claude Code CLI Yes Yes Yes Yes
Claude Code Desktop app Yes Yes Yes Yes
Cursor Yes Yes — Yes
Devin CLI Yes Yes Yes —
Devin Desktop (Windsurf) Yes Yes — —
GitHub Copilot Yes Yes — —
Gemini CLI Yes Yes Yes —
Kiro Yes Yes — Yes
OpenCode Yes Yes Yes —
Pi Yes Yes Yes Yes
Rovo Dev Yes Yes Yes Yes

Devin CLI and Devin Desktop are captured only when enable_devin_session_tracking is on. It is off by default.

Tool/MCP/Skill usage

The daemon captures tool, MCP, and skill usage from eligible sessions for Claude Code, Codex, Cursor, Kiro, Pi, and Rovo Dev. See the tool usage schema for collected fields.

Tool usage is sent with session updates on stop, compact, or end events supported by each integration. It follows the same session-directory scope as other session data. The Transcripts & Agent Experience setting does not disable tool-usage collection or storage. See Security and privacy.

Manage integrations

The daemon detects installed tools and reconciles its owned hook entries during installation, on daemon startup, and once per hour. It merges its entries with supported existing configuration rather than replacing unrelated hooks.

  1. macOS and Linux
  2. Windows

Run an immediate reconciliation after installing or updating an agent:

aicodemetricsd install-hooks

Install or repair one integration:

aicodemetricsd install-hooks --tool <tool-name>

Remove one integration while keeping the daemon and other tools active:

aicodemetricsd uninstall-hooks --tool <tool-name>

Check the integration status after any change:

aicodemetricsd status

Run an immediate reconciliation after installing or updating an agent:

& "$env:ProgramFiles\AICodeMetrics\aicodemetrics.cmd" install-hooks

Install or repair one integration:

& "$env:ProgramFiles\AICodeMetrics\aicodemetrics.cmd" install-hooks --tool <tool-name>

Remove one integration while keeping the daemon and other tools active:

& "$env:ProgramFiles\AICodeMetrics\aicodemetrics.cmd" uninstall-hooks --tool <tool-name>

Check the integration status after any change:

& "$env:ProgramFiles\AICodeMetrics\aicodemetrics.cmd" status

The daemon persists tool-specific install or uninstall choices so the hourly reconciliation does not reverse them.

Integration notes

Codex

The integration supports local coding sessions in both the Codex CLI and desktop app.

CLI tool codex
Managed configuration ~/.codex/hooks.json, ~/.codex/config.toml

The daemon enables Codex hooks, writes its event handlers, and records the matching trust state. The Codex app can still prompt the developer to approve the hook after installation.

Trust the command that contains aicodemetricsd hook codex. If the trust prompt returns after an agent update, repair the integration using the codex tool name and approve the current entry.

Tool usage is read from completed items in Codex session data. It covers command execution, file changes, MCP calls, web search, image generation, and extension tools. Skill usage is identified when structured command metadata records a read of a skill definition. Timing and status fields depend on the session format.

Claude Code

The integration supports local coding sessions in both the Claude Code CLI and desktop app.

CLI tool claude
Managed configuration ~/.claude/settings.json

The daemon registers file-edit, shell-command, session lifecycle, stop, and compact hooks. End or compact a session before checking for its final session data.

Tool usage is reconstructed from calls and matching results in the session transcript. The daemon identifies explicit skill and MCP calls and records timing, duration, status, and model when available. Calls without a matching result can lack completion metadata.

If Claude Code rewrites its settings during an update, repair the integration using the claude tool name and check status again.

Cursor

CLI tool cursor
Managed configuration ~/.cursor/hooks.json

The integration covers file edits, tab edits, shell commands, session start, stop, and pre-compact events. Cursor does not provide token counts through this integration.

Session messages and tool usage are read from Cursor’s local session database on stop or pre-compact events. Tool records can include a start time, status, model, and skill or MCP tool identifiers. Completion times and durations are not currently available through this integration. Skill usage is identified from reads of recognized skill-definition paths.

Restart open Cursor sessions after the integration is first installed so they load the current hook configuration.

Devin Desktop and Devin CLI

CLI tool devin
Managed configuration Desktop: ~/.codeium/windsurf/hooks.json and JetBrains plugin hooks
CLI: ~/.config/devin/config.json on macOS and Linux, %APPDATA%\devin\config.json on Windows

Devin Desktop provides edit events and transcript snapshots. Devin CLI provides edit and shell events; its transcript becomes readable only after the session ends.

Devin code attribution and session capture both require the enable_devin_session_tracking setting, which is off by default. While it is off, the daemon ignores all Devin edits, shell commands, and sessions. Devin cannot always provide a reliable working directory, so enabling the setting can capture all Devin sessions rather than only sessions in monitored repositories. Review this scope with your security team before enabling it.

GitHub Copilot

CLI tool github-copilot
Managed configuration ~/.copilot/hooks/ai-insights.json and the hook location in VS Code settings

The hook file serves both Copilot CLI and Copilot agent mode in VS Code, including VS Code’s Copilot harness. The integration preserves unrelated VS Code settings. If Copilot sessions are missing, confirm both the hook file and the VS Code hook-location setting are present, then restart VS Code.

Gemini CLI

CLI tool gemini
Managed configuration ~/.gemini/settings.json

The integration captures edit, shell, session, after-agent, and pre-compress events. End or compress the session before checking final session data.

Kiro

CLI tool kiro
Managed configuration ~/.kiro/hooks/aicodemetrics.json

The daemon owns the whole hook file and rewrites it if its contents change. It registers hooks for prompt submission, edit and shell tools, and stop. Kiro IDE and Kiro CLI both report as Kiro, and the tool version shows which one a session came from (ide-<version> or cli-<version>).

  • Kiro IDE: hooks run only in trusted workspaces. Kiro reads workspace trust when the agent starts, so reload the window after trusting a folder. Kiro shows a DX AI Code Metrics card in the IDE chat each time a hook runs, and this cannot be hidden.
  • Kiro CLI: hooks run only with the V3 engine (kiro-cli --v3, or kiro-cli settings chat.agentEngine v3). The CLI defaults to the V2 engine, which ignores global hooks, so default-engine sessions are not captured.

Tool usage is read from the session transcript, including the MCP server and tool for MCP calls and the skill name for skill loads. Status comes from the call’s result. Kiro records when a call finishes, not when it starts, and a duration is available only for calls where Kiro records one.

Kiro reports credits, not tokens, so Kiro sessions have no token counts. The model is reported as auto when Kiro’s model is set to Auto.

The daemon does not attribute multi-file code-intelligence edits, such as Semantic Rename, because Kiro’s hooks do not include the file paths for them. It also reads Kiro files from ~/.kiro only and does not support a KIRO_HOME override.

If Kiro rewrites or removes the hook file, repair the integration using the kiro tool name.

OpenCode

CLI tool opencode
Managed configuration ~/.config/opencode

OpenCode loads a daemon-managed JavaScript plugin because it does not expose the same native hook file model as the other tools. The plugin requires OpenCode 1.18.29 or later.

If OpenCode uses a nonstandard config root, confirm the plugin was written to the directory used by that OpenCode installation.

Pi

CLI tool pi
Managed configuration ~/.pi/agent/extensions/aicodemetrics.js

Pi has no hook configuration, so the daemon writes a JavaScript extension into Pi’s global extensions directory, as it does a plugin for OpenCode. Pi loads the extension in every mode, including print mode (pi -p), JSON, and RPC, without a trust prompt. Restart open Pi sessions after the integration is first installed so they load the extension.

The daemon detects Pi by its agent directory, which Pi creates on first run. The extension follows PI_CODING_AGENT_DIR when that variable is set. If you set it, confirm the extension was written to that directory.

Pi waits for the hook before each tool call that can change files, which adds a short delay to the call. A hook that does not respond within 3 seconds is skipped so the call can proceed.

Tool usage is read from the session file, including MCP calls made through Pi’s codemode tool and skills loaded with /skill:name or by reading a skills/<name>/SKILL.md file. MCP server names use Pi’s spelling, such as dev_radius for a server named dev-radius. Session messages record files attached with @file as @path references, not their contents.

Sessions are not captured when Pi runs with --no-extensions, or when a program embeds Pi through its SDK without loading global extensions. Code from a session run with --no-session is attributed, but the session is not uploaded. Forks and nested pi -p runs are recorded as separate sessions.

Rovo Dev

CLI tool rovodev
Managed configuration ~/.rovodev/config.yml

The daemon preserves a backup before its first change. Session data is read from Rovo Dev’s persisted session directory.

Tool usage is reconstructed from calls and matching results in the persisted session data, including skill and MCP calls. Timing and model fields are included when available; status is recorded only when explicitly supported by the session data. Missing status does not indicate success or failure, and interrupted calls can lack completion times or durations.

Keep session persistence available until the session completes. If the configured persistence directory moves, run the integration check again and inspect the daemon log for session-context read errors.

Coverage limitations

  • Hooks report explicit agent events; the daemon does not infer unsupported agent use from code content.
  • Browser-generated code pasted into an editor has no agent signal.
  • Hooks are designed to fail open, so most errors create missing attribution without blocking the coding agent. An incompatible agent update can still hang or block an action; see the common issues in Troubleshooting.
  • Code attribution is limited to files in monitored repositories, wherever the agent session started. A shell command is attributed in the repository it runs in, including one it reaches with a leading cd <folder>. Codex reports the folder a command runs in from Codex 0.166; earlier versions report the session’s folder.
  • Session data is collected only for sessions started inside a monitored repository or an additional session directory.
  • Agent events, transcript contents, timestamps, model identifiers, and token fields differ by tool and version.
  • Tool-usage collection does not attribute committed lines to individual tool calls.
  • An ended session can have no score when its transcript is missing, too long, or contains insufficient evaluation evidence.

Validate a known commit for each agent and environment you deploy. See Verify deployment.

Troubleshoot an integration

Follow Troubleshooting to check daemon status, collect diagnostics, and escalate an integration problem.

If an integration blocks the agent, remove only that tool’s hooks to unblock development while leaving the rest of the deployment active:

  1. macOS and Linux
  2. Windows
aicodemetricsd uninstall-hooks --tool <tool-name>
& "$env:ProgramFiles\AICodeMetrics\aicodemetrics.cmd" uninstall-hooks --tool <tool-name>

Next steps