> ## Documentation Index
> Fetch the complete documentation index at: https://docs.profclaw.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Code Analysis

> Static analysis, linting, type checking, and image analysis tools.

## Overview

Code analysis tools help the agent verify code quality after making changes. Rather than relying solely on reading code, the agent can run the actual type checker or linter and get machine-precise feedback.

## Tools

### `exec` (for Analysis Tasks)

The `exec` tool is used for running analysis commands. It is in the Essential tier and works with any model.

**Security level**: `dangerous` | **Tier**: Essential

**command** `string` *required*

Shell command to run (e.g., `"pnpm tsc --noEmit"`, `"pnpm lint"`).

**workdir** `string`

Working directory. Defaults to the conversation workdir.

**timeout** `number` (default: 300000)

Timeout in milliseconds (default 5 minutes).

**background** `boolean` (default: false)

Run in the background and return immediately. Check with `session_status`.

```json TypeScript type check theme={null}
{
  "command": "pnpm tsc --noEmit"
}
```

```json ESLint check theme={null}
{
  "command": "pnpm eslint src/ --max-warnings 0"
}
```

```json Run both in sequence theme={null}
{
  "command": "pnpm tsc --noEmit && pnpm lint"
}
```

***

### `image_analyze`

Analyze an image file and describe its contents. Useful for screenshots, diagrams, or design files.

**Security level**: `safe` | **Tier**: Standard

**path** `string` *required*

Path to the image file (PNG, JPG, GIF, WebP).

**prompt** `string`

Specific question to ask about the image (e.g., "What errors are visible?", "Describe the UI layout").

```json theme={null}
{
  "path": "screenshots/error-state.png",
  "prompt": "What error messages are visible and what might cause them?"
}
```

***

### `link_understand`

Analyze a URL and extract structured understanding of its content without fetching the full HTML.

**Security level**: `safe` | **Tier**: Standard

**url** `string` *required*

URL to analyze.

**focus** `string`

Aspect to focus on: `"summary"`, `"code"`, `"api"`, `"docs"`.

***

### `which`

Find the path to a binary (equivalent to `which` command).

**Security level**: `safe` | **Tier**: Standard

**command** `string` *required*

Command name to look up.

Returns the full path to the binary, or an error if not found.

***

### `env`

Read environment variable values.

**Security level**: `safe` | **Tier**: Standard

**key** `string`

Specific environment variable to read. Omit to list all (filtered for safety).

> [!NOTE]
>
> Secret-looking variables (containing `KEY`, `SECRET`, `TOKEN`, `PASSWORD`) are automatically masked in the output.

***

### `system_info`

Get system information: OS, CPU, memory, Node version, disk space.

**Security level**: `safe` | **Tier**: Standard

***

### `process_list`

List running processes.

**Security level**: `safe` | **Tier**: Standard

**filter** `string`

Filter processes by name.

## Recommended Analysis Workflow

**1. Make your changes**

Use `edit_file` or `write_file` to apply code changes.

**2. Type check**

```json theme={null}
{ "command": "pnpm tsc --noEmit 2>&1 | head -50" }
```

Pipe through `head` to limit output for large projects.

**3. Lint**

```json theme={null}
{ "command": "pnpm lint --quiet" }
```

**4. Run affected tests**

Use `test_run` with the `file` parameter to run tests for the changed module.

## Related Tools

> [card] [Test Runner](https://docs.profclaw.ai/tools/test-runner.md)
>
> Run automated tests after type checking passes.

> [card] [File Operations](https://docs.profclaw.ai/tools/file-operations.md)
>
> Read source files to understand the code before analyzing.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.