Devin
Secrets-detection hooks, the SonarQube MCP Server, and Sonar Vortex analysis and Vortex context for Devin, installed with the SonarQube CLI.
sonar integrate devin configures the SonarQube CLI to work alongside Devin. In an interactive terminal, the command shows these recommended components, then asks you to install them or customize the selection (see Install confirmation):
Secrets-detection hooks: a
PreToolUsehook on thereadtool that blocks a file read when the file contains a secret, and aUserPromptSubmithook that blocks a prompt that contains a secret.The SonarQube MCP Server, which lets Devin fetch projects, issues, and rules directly.
Vortex (when your connection has a Vortex subscription: SonarQube Cloud Team (annual) or Enterprise plan, or SonarQube Server 2026.5 or newer Enterprise and Data Center editions): installs Vortex analysis and Vortex context together. It adds:
A Vortex analysis
PostToolUsehook oneditandwritethat runs fastSTANDARDanalysis after each edit. The edit is not blocked.End-of-turn Vortex analysis instructions in
AGENTS.mdthat tell Devin to runDEEPanalysis on every file it modified in one command (repeat--filefor each path, or use the git change set)A
SessionStarthook that injects Vortex context when a session startsA
PreToolUsehook onrun_subagentthat prepends the Vortex context announcement to the subagent task. The subagent is not blocked.
Choose Devin from the bare sonar integrate menu, or run sonar integrate devin directly. When Claude Code and Devin are both detected, that menu includes them in one note that names every detected agent in a conflicting pair and states that they may conflict at the hook level.
Pass --non-interactive to accept every offered component without prompts (see Non-interactive install).
Prerequisites
Devin is installed.
sonaris on thePATHthat Devin uses.
Install
Install once for this machine:
The command writes hooks and config under ~/.config/devin/ on macOS and Linux, or %APPDATA%\devin on Windows. It applies to every Devin session on this machine. See Project versus global scope.
What the command does
The integrator runs in two phases:
Validation. It checks that your saved token can reach SonarQube. On SonarQube Cloud, your connection must include an organization. An invalid token stops setup and tells you to run
sonar auth login. An unreachable server stops setup and asks you to check the server URL and your network connection.Installation. The CLI shows a What will be installed summary of the recommended components (secrets detection, MCP server, and Vortex when eligible). In an interactive terminal, choose Install recommended to write that set, or Customize to accept or decline each component and then press Enter. Components that are not available are skipped with an explanation. In non-interactive mode, every eligible component is installed without prompts. The CLI then writes the accepted components into the Devin config directory.
A common skip reason is that your connection does not have a Vortex subscription (only available with SonarQube Cloud Team (annual) or Enterprise plan, or SonarQube Server 2026.5 or newer Enterprise and Data Center editions).
Secrets hooks
PreToolUse (read only)
Scans the file before Devin reads it. A secret blocks the read.
UserPromptSubmit
Scans the prompt before it is sent. A secret blocks the prompt.
Both hooks fail closed when you are not authenticated or the secrets analyzer is missing. The hook blocks the read or the prompt and tells you to run sonar auth login or re-run sonar integrate devin. A scan error during an otherwise healthy run does not block the operation.
A tool other than read is not scanned by the file hook. A prompt with no secrets is left unchanged.
The CLI does not add secrets-on-read instructions to AGENTS.md. Upgrading the CLI removes a secrets-on-read snippet that an earlier install wrote in that file, and leaves the rest of the file in place. Run sonar integrate devin again to remove that snippet without waiting for an upgrade.
Vortex analysis and Vortex context
When you accept Vortex, sonar integrate devin installs these touchpoints in the Devin config directory:
A
PostToolUsehook oneditandwriteruns fastSTANDARDanalysis (see the--depthoption ofsonar analyze agentic) after each edit and returns findings to Devin. The hook never blocks the edit. A missing project or a scan error stays silent. On HTTP 403, Devin can show the same unavailable notice as the other Vortex analysis hooks. See integrations/README.md.A managed snippet in
AGENTS.mdrequires an end-of-turnDEEPrun: onesonar analyze agentic --depth DEEPcommand covering every file Devin modified that turn. The instructions omit--projectand--branchbecause the CLI auto-detects the current git branch and analyzes each file against the project that owns it. In a repository with several projects, they tell Devin to run that command from a directory that contains every file changed in the turn, usually the repository root. Re-runsonar integrate devinso an existing snippet picks up that paragraph. The edit hook analyzes the edited file against the project that owns it, and stays silent when no project of the active connection owns the file. If analysis reports that no project is configured, the instructions tell the agent to stay silent for the rest of the session instead of repeating a skip notice. See Files and the project root.A
SessionStarthook injects Vortex context when a session starts, letting Devin use project guidelines, architecture, semantic navigation, and dependency context. When context cannot load, Devin asks the agent to tell you once per session. See When Vortex context does not load.A
PreToolUsehook onrun_subagentprepends that same announcement to the subagent task. The subagent is not blocked. That hook stays quiet when context cannot load. A read-only subagent profile, such assubagent_explore, receives the announcement but cannot runsonar context.
The CLI installs the Vortex context binary under ~/.sonar/sonarqube-cli/bin/. After that, sonar context forwards to the binary. Hook entries are written into config.json and your other hooks and settings stay in place.
For overviews of these features, see Vortex analysis and Vortex context.
MCP server
The command adds a sonarqube entry under mcpServers in mcp_config.json:
Devin starts that local command. The file does not include a project key. sonar run mcp resolves the project when it runs. Other MCP servers in the file are kept. Removing the feature removes only the sonarqube entry.
When SONAR_USER_HOME is set before you run the command, the entry also includes an env object with that path.
Options
--non-interactive
Non-interactive mode (no prompts).
--global, -g
Deprecated since 1.9.0. The install is already global; using the flag prints a warning and does not change the installation scope.
Where files are installed
macOS and Linux
~/.config/devin/config.json (hooks), ~/.config/devin/mcp_config.json (MCP server), and ~/.config/devin/AGENTS.md (Vortex instructions, when Vortex is installed)
Windows
The same file names under %APPDATA%\devin
Shared binaries
~/.sonar/sonarqube-cli/bin/ (the secrets analyzer, and the Vortex context binary when Vortex is installed)
State for the integration is recorded in ~/.sonar/sonarqube-cli/state.json. See State and storage.
Restart Devin
Devin loads hooks and MCP configuration when it starts. Restart Devin after you install or remove them.
Verify it works
Test a file read
Create a file in your project with a fake-looking but secret-shaped value:
Ask Devin to read it: "Read secrets.js."
Devin should block the read and explain that the file contains a secret.
After you've confirmed the hook is active, delete the test file.
Test a prompt
Send Devin a message that includes the same kind of fake token. Devin should block the prompt and explain that it contains a secret.
Test the MCP server
Ask Devin to list your SonarQube projects through the MCP server. If the call fails, run sonar auth status to confirm the token is healthy and restart Devin.
sonar system status lists the Devin integration and reports MCP server status for mcp_config.json. When the MCP entry is invalid, status recommends sonar integrate devin. See Check system status.
Test Vortex analysis
Make a code change through Devin (for example, ask it to edit a file). After the edit, Devin should receive the analysis. Before ending the turn, it should run DEEP analysis on the modified files. This requires a Sonar Vortex analysis subscription.
Test Vortex context
After you accept Vortex, start a Devin session in a linked project. Devin should receive Vortex context at session start. When Devin starts a subagent, the subagent task should include that announcement. This requires a Sonar Vortex context subscription.
Non-interactive install
For provisioning scripts, dotfiles, and onboarding automation:
In non-interactive mode, the CLI does not prompt for feature selection, install confirmation, token repair, or feature removal. When you authenticate with environment variables, integrate commands also run in non-interactive mode even without the flag. Every component that is not explicitly skipped is installed automatically, including Vortex when your connection has a Vortex subscription. Run sonar auth status afterward to confirm everything is configured correctly.
Uninstall
Run sonar integrate devin again in an interactive terminal and choose Customize. For each installed feature, the CLI asks Keep?: answer No, confirm Proceed with removal?, and the CLI removes that feature and its state. Vortex is removed as one unit (the analysis hook, the end-of-turn instructions, the session-start hook, and the subagent announcement). See integrations/README.md for the full flow.
For a manual cleanup or non-interactive environments:
Remove the SonarQube hook entries from
config.jsonin the Devin config directory (~/.config/devinon macOS and Linux, or%APPDATA%\devinon Windows). Leave your other hooks and settings in place.Remove the managed Vortex snippet from
AGENTS.md. If an earlier install left a secrets-on-read snippet, remove that block too. Leave any other content in that file.Remove the
sonarqubeentry undermcpServersinmcp_config.json. Leave other MCP servers in place.Remove the Devin entry from
~/.sonar/sonarqube-cli/state.json(underintegrations.installed).
See Uninstalling for the full removal procedure.
Related pages
Last updated
Was this helpful?

