# SonarQube CLI in agentic workflows

This page explains how to use SonarQube CLI in agentic workflows, including integration with Claude Code.

## Claude Code integration

The `sonar integrate claude` command integrates [SonarQube CLI](https://docs.sonarsource.com/sonarqube-cli/) with Claude Code so you can perform tasks from the command line, such as:

**Secrets scanning**: Set up hooks that run before Claude reads or writes files. Once set up, Claude Code automatically blocks operations that would expose secrets. For more information, see [Set up the Claude Code hook](/sonarqube-cli/using/secrets-scanning.md#set-up-the-claude-code-hook).

**Code verification with Agentic Analysis**: Configure [Agentic Analysis](https://docs.sonarsource.com/sonarqube-cloud/analyzing-source-code/agentic-analysis) on SonarQube Cloud.

## List of commands

For the full list of SonarQube CLI commands, see [Commands](/sonarqube-cli/using/commands.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sonarsource.com/agent-centric-development-cycle/developer-tools/sonarqube-cli-in-agentic-workflows.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
