Troubleshooting

Use this guide when the AI Code Insights daemon is installed but data is missing, stale, or not matching expectations.

Before you begin

  • Run commands on the developer machine: The daemon must run on the same machine where code changes happen.
  • Use a monitored repository: The daemon only monitors AI sessions and code changes in repositories whose Git remote matches a repository imported into in your organization’s DX account.
  • Push a commit before checking commit data: AI code attribution data is sent to DX when changes are committed and pushed to a branch.
  • End the AI session before checking session data: AI session data is sent when the session ends. Session evaluations should appear within 1 hour after the session posts to DX.

Step 1: Confirm the latest version

Run the status command and compare the Version shown against the latest daemon version listed under AdminAI Code Insights.

On macOS or Linux:

aicodemetricsd status

On Windows (PowerShell):

& "$env:ProgramFiles\AICodeMetrics\aicodemetricsd.exe" status

If the installed version is out of date, install the latest daemon and retry the workflow that is failing.

Step 2: Resolve failed checks

Each check in the status output is marked (OK), (warning), or [FAIL], and failed checks include an inline hint describing how to remediate.

Most failed checks are self-explanatory from the output. A few benefit from additional context:

Failed check What to do
Service: stopped (after restart) If the daemon repeatedly stops after restarting, endpoint security software may be terminating it. On macOS, capture launchctl print gui/$(id -u)/com.getdx.aicodemetrics and share with DX support. See Endpoint considerations for processes and paths that may need EDR exclusions.
API connectivity The daemon cannot reach DX or is not authenticated. Confirm the api_url and api_key values match AdminAI Code Insights. For local config see Configuration; for managed deployments see MDM installation. Also verify HTTPS traffic for the DX API URL is not blocked by a proxy or firewall.
Monitored Repositories: no repos found The daemon has not yet fetched the repository list, or no local repos match repos imported into DX. Restart the daemon to force a fresh fetch. For a repository that should be monitored, run git remote -v in that repo — the origin URL must match the canonical URL in DX. If developers clone from an internal mirror or SSH alias, configure url_rewrites. Repositories nested inside another Git repository are not supported — if a parent directory contains a .git directory, the nested repo will not be discovered. If the issue persists, continue to Step 3.
Current data: 0 commits Expected immediately after install. If the count stays at 0 after using AI in a monitored repo and pushing a commit, continue to Step 3.

Step 3: Gather logs and escalate

If status shows all checks passing but data is still missing, or if the issue is inaccurate AI attribution, escalate to DX support with the following:

  • Full output of status command (see step 1)
  • Daemon logs and installer logs (paths below)
  • For attribution issues, the problematic commit SHA(s)

Daemon logs are stored here:

Platform Path
macOS ~/Library/Logs/AI Code Metrics/aicodemetrics.log
Linux ~/.aicodemetrics/aicodemetrics.log
Windows $env:LOCALAPPDATA\aicodemetrics\aicodemetrics.log

Installer logs are stored here:

Platform Path
macOS /tmp/aicodemetrics-install.log
Linux /tmp/aicodemetrics-install.log
Windows Run msiexec /i <installer>.msi /l*v install.log to capture a log

Common issues

If macOS shows a warning that the installer is from an unidentified developer, the .pkg file may not have passed Gatekeeper validation. Verify the installer was downloaded from AdminAI Code Insights and is signed. Right-click the .pkg file and select Open to bypass the warning for a verified installer.

The status command reports API connectivity failures, but does not distinguish between a missing config file and an unapplied MDM profile. If the daemon cannot authenticate and you expect credentials to be delivered via MDM:

On macOS, check managed preferences:

defaults read com.getdx.aicodemetrics

If the output is empty or missing api_url and api_key, the Configuration Profile has not been applied.

On Windows, check the registry key HKLM\SOFTWARE\GetDX\AICodeMetrics for api_url and api_key values.

See MDM installation for Configuration Profile and registry setup.

Set email explicitly in the daemon config or managed preferences whenever possible. The value must match the developer’s email address in DX. This is more reliable than relying on git config user.email, which can vary by repository, Git account, or over time.

Run aicodemetricsd status and check the Email entry. If it shows the wrong value, update email in the config file, macOS Configuration Profile, or Windows registry, then restart the daemon. If email is not set, the daemon falls back to agent-provided email when available, then repo-local and global Git config.

The daemon must run on the same machine where the code lives. For remote SSH sessions or devcontainer-based workflows, install the daemon on the remote host, not the developer’s local machine. If the remote environment is ephemeral, the daemon needs to be reinstalled each time the environment is created.

Attribution follows the edit that introduced the line. Blank lines inserted as part of an agent edit are attributed to AI. Blank lines added by the developer for spacing or formatting are attributed to human.

Deletions are attributed based on direct signals from the agent. Deletions made as part of an agent edit are attributed to AI; all other deletions are attributed to the developer.

When a developer manually edits AI-generated code before committing, the daemon tracks both the original AI insertion and the developer’s modifications. The similarity score in per-file metrics indicates how much the committed code differs from the original AI output. A score of 1.0 means the code is unchanged; lower scores indicate more developer modification.

Only accepted code is attributed to AI. Suggestions that the developer dismisses or ignores are not counted.

Only edits made through a supported agent’s native hook or plugin are attributed to AI. Code produced by agents without a native integration is counted as human-authored.

Code generated in a browser-based agent, such as ChatGPT or Claude.ai, and pasted into an editor is attributed to the developer. Pasted code carries no agent signal, so it is treated as human-written.

AI Code Insights can only classify code changes that occur while the daemon is running. Commits pushed before installation have no AI attribution data. Reports that span a period before and after installation show 0% AI-generated code for the pre-installation window.

Daemon logs rotate automatically at 25 MB, keeping the 3 most recent files for up to 90 days. The default log_level is debug, which generates verbose output useful for troubleshooting. If logs are filling up faster than expected, set log_level to info in the config file to reduce log volume.

The daemon stores data in SQLite databases in ~/.aicodemetrics on macOS and Linux, or $env:LOCALAPPDATA\aicodemetrics on Windows. Open them with any SQLite client to inspect what the daemon has recorded.

  • repositories.db: Repository metadata and monitored repository state.
  • content.db: Agent edit events, line-level attribution, commit metadata, and AI attribution metrics.

This data remains on the developer’s machine. Only aggregate metrics are transmitted to DX.

aicodemetricsd status           # Run diagnostic checks
aicodemetricsd --version        # Print version information
aicodemetricsd restart          # Restart the daemon
aicodemetricsd install-hooks    # Reinstall hooks for detected agents
aicodemetricsd uninstall-hooks  # Remove hooks from agent configs

On Windows, prefix commands with the full path: & "$env:ProgramFiles\AICodeMetrics\aicodemetricsd.exe" <command>.