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 your organization’s DX account.
  • Start the agent inside the monitored repository: A session started from a parent folder or an additional session directory is not eligible for code attribution, even if the agent edits files inside a monitored repository.
  • 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: Check daemon status

Run the diagnostic command on the developer machine.

  1. macOS and Linux
  2. Windows
aicodemetricsd status
& "$env:ProgramFiles\AICodeMetrics\aicodemetrics.cmd" status

Resolve every required [FAIL]. Review [WARN] entries for missing hooks, identity, protected-directory access, or repository coverage before continuing.

Step 2: Resolve failed checks

Each check in the status output is marked [ OK ], [WARN], 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:

If the daemon repeatedly stops after restarting, endpoint-security software may be terminating it. On macOS, capture the LaunchAgent state and share it with DX support:

launchctl print gui/$(id -u)/com.getdx.aicodemetrics

See Endpoint considerations for processes and paths that may need EDR exclusions.

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 reference. For managed deployments, see Enterprise deployment.

Also verify that a proxy or firewall is not blocking HTTPS traffic to the DX API URL.

The daemon has not yet fetched the repository list, or no local repositories match repositories imported into DX. Restart the daemon to force a fresh fetch.

On any platform, run this command from a repository that should be monitored:

git remote -v

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 repository will not be discovered. If the issue persists, continue to Step 3.

This is expected immediately after installation. If the count stays at 0 after using AI in a monitored repository 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 AI attribution is inaccurate, escalate to DX support with:

  • The full status output
  • Daemon and installer logs
  • The affected commit SHA or SHAs for attribution issues

Run the report command to collect the status output and logs into one zip archive.

  1. macOS and Linux
  2. Windows
aicodemetricsd report
& "$env:ProgramFiles\AICodeMetrics\aicodemetrics.cmd" report

The report is saved in the current directory and includes daemon logs, archived logs, updater-helper logs when available, installation logs, and status output.

Daemon logs are stored here:

  1. macOS
  2. Linux
  3. Windows
~/Library/Logs/AI Code Metrics/aicodemetrics.log
~/.aicodemetrics/aicodemetrics.log
$env:LOCALAPPDATA\aicodemetrics\aicodemetrics.log

Installer logs:

  1. macOS and Linux
  2. Windows
/tmp/aicodemetrics-install.log

Run the installer with logging enabled:

msiexec /i <installer>.msi /l*v install.log

The log is written to:

.\install.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 unapplied managed settings. If the daemon cannot authenticate and you expect credentials to be delivered through endpoint management:

  1. macOS
  2. Windows

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.

Check HKLM\SOFTWARE\GetDX\AICodeMetrics for the api_url and api_key values.

See Enterprise deployment for Configuration Profile and registry setup.

Run status and check the Auto-updates row.

  • Disabled from API: Under AdminAI Code InsightsAutomatic daemon updates, turn on Enable auto-updates. Allow up to one hour for the next settings refresh and up to 10 additional minutes for the randomized update check.
  • Disabled from default: The daemon has not received a current setting from DX. Check API connectivity, then restart the daemon to request settings again.
  • Pending or failed: The previous daemon version remains installed or is restored automatically. Run report and send the archive to DX support.

macOS and Windows endpoints running a version older than 0.7.0 do not include automatic-update support. Run the current installer once to install the supported daemon and privileged updater helper.

Linux installations from before 0.7.2 need the fixed updater helper. Download the current Linux .tar.gz, extract it, and run its ./install.sh once. An enabled status reflects the account setting and does not prove that the installed helper can apply updates.

If Linux updates fail with a socket permission error after installation, restart the machine to refresh the systemd user manager’s group membership. If the helper was started after the daemon, restart the daemon so it detects the helper socket.

Run interactive Windows commands through the MSI-installed aicodemetrics.cmd wrapper. PowerShell can return to its prompt while the GUI-subsystem aicodemetricsd.exe is still running, which can cause the shell and daemon to compete for keyboard input.

For example, use:

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

Check whether the wrapper is installed:

Test-Path "$env:ProgramFiles\AICodeMetrics\aicodemetrics.cmd"

If the command returns False, run the current MSI over the existing installation. Automatic daemon updates replace aicodemetricsd.exe but do not add or update installer-managed files such as the wrapper.

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.

Check the Email entry in the Step 1 status output. 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 repository-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.

Start a new agent session with its working directory inside the monitored repository. The daemon uses the session’s launch directory to decide whether code-attribution hooks are eligible. An absolute edit path inside a monitored repository does not override an ineligible launch directory.

additional_session_directories expands session and transcript collection only. It does not authorize code attribution for a session launched outside a monitored repository.

The daemon preserves attribution through common Git operations, including clean rebases, cherry-picks, and commit amendments. Attribution can be incomplete when a workflow changes patches, combines or splits commits, performs rapid branch transitions, or recreates commits through detached HEAD or a custom stack-restack tool.

When investigating:

  • Confirm whether the final commit was created by a standard Git operation or by a tool-specific restack workflow.
  • Record whether the workflow used a temporary worktree or detached HEAD.
  • Include both the original and replacement commit SHAs in the support request when available.

The daemon calculates attribution locally, holds it as pending, and sends it only after confirming the commit on a remote branch. Deleting the local branch immediately after a push can remove pending attribution before that confirmation completes.

When possible, wait for the commit to appear in DX before deleting its local branch. If data is missing, include the commit SHA, remote branch, approximate push time, and whether the local branch was deleted in the support request.

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.

Very large monorepos can require more local processing and can reduce attribution accuracy. Pause the broader rollout and test one machine with a known commit before adding participants. If machine performance is affected or attribution remains implausible, run the report command and send the archive and affected commit SHAs to DX support.

See Endpoint considerations for expected resource usage and rollout guidance.

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.

AI tools can make breaking changes to their hook behavior, causing interoperability problems with AI Code Insights. Symptoms include hanging at the start of a session or a blocked message when an agent attempts to edit a file or run a shell command.

As a short-term fix, remove the affected tool’s hooks to unblock development:

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

Report the issue to DX so we can investigate. After installing a release that resolves the issue, reinstall the affected integration:

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

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.

Source snapshots and local attribution state remain on the developer’s machine. DX receives commit metadata and attribution metrics. Supported session integrations can also send scrubbed session messages when transcript collection is enabled. See Security and privacy.

  1. macOS and Linux
  2. Windows
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
& "$env:ProgramFiles\AICodeMetrics\aicodemetrics.cmd" status          # Run diagnostic checks
& "$env:ProgramFiles\AICodeMetrics\aicodemetrics.cmd" --version # Print version information
& "$env:ProgramFiles\AICodeMetrics\aicodemetrics.cmd" restart         # Restart the daemon
& "$env:ProgramFiles\AICodeMetrics\aicodemetrics.cmd" install-hooks # Reinstall hooks for detected agents
& "$env:ProgramFiles\AICodeMetrics\aicodemetrics.cmd" uninstall-hooks # Remove hooks from agent configs

Next steps