> ## Documentation Index
> Fetch the complete documentation index at: https://agent-compass.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Analyzers

> Configure and run post-execution analysis.

Analyzers are the post-execution analysis layer of AgentCompass. After a task produces a `RunResult`, analyzers inspect trajectories, metrics, errors, latency, model output, and tool calls. Their output is attached to each attempt under `analysis_result.<AnalyzerId>` and aggregated into `analysis_summary.json` / `analysis_summary.md`.

<CardGroup cols={2}>
  <Card title="Badcase detection" icon="badge-alert">
    Flag failures such as runtime exceptions, truncation, JSON errors, repetition, latency spikes, or terminal misuse.
  </Card>

  <Card title="Statistics" icon="chart-no-axes-combined">
    Compute distributions such as step counts, tool-call counts, duration, token length, and value-count summaries.
  </Card>

  <Card title="Qualitative analysis" icon="sparkles">
    Use LLM-backed analyzers to annotate trajectory phases, summarize behavior, and render segment-graph reports.
  </Card>

  <Card title="Component registry" icon="list">
    `agentcompass list analyzer` prints registered analyzers, and `agentcompass list dump` exports them to `agentcompass_components.md`.
  </Card>
</CardGroup>

## Run with Evaluation

```bash theme={null}
agentcompass run \
  terminal_bench_2 \
  terminus2 \
  your-model \
  --env <env-provider> \
  --benchmark-params '{"sample_ids":["git-leak-recovery"]}' \
  --model-base-url "$MODEL_BASE_URL" \
  --model-api-key "$MODEL_API_KEY" \
  --model-api-protocol openai-chat \
  --enable-analysis \
  --analysis-params '{"analyzers":["ExceptionAnalyzer","TruncationAnalyzer"]}'
```

## Re-run on Existing Results

```bash theme={null}
agentcompass analysis \
  --input results/terminal_bench_2/your-model/20260703_120000 \
  --analysis-params '{
    "analyzers": ["ExceptionAnalyzer", "QualitativeAnalyzer"],
    "QualitativeAnalyzer": {"render_mode": "file"}
  }' \
  --task_concurrency 8
```

By default, `analysis` copies the input run into a new timestamped sibling. Use `--output` to choose the copy destination, or `--override` to mutate the input run in place.

## Selection Rules

| Field               | Meaning                                                                 |
| ------------------- | ----------------------------------------------------------------------- |
| `analyzers`         | Whitelist. If set, only these analyzer ids are considered.              |
| `exclude_analyzers` | Blacklist. Excluded analyzers are skipped even if otherwise compatible. |
| `<AnalyzerId>`      | Per-analyzer config, such as thresholds or qualitative model settings.  |

## Supported Families

Current `agentcompass list analyzer` output reports 25 registered analyzers:

* Basic statistics: `BasicMetricAnalyzer`, `TrajectoryTimeCostAnalyzer`, `CompletionLengthAnalyzer`.
* Error detection: `ExceptionAnalyzer`, `TerminalBench2ExceptionAnalyzer`, `TruncationAnalyzer`, `JSONErrorAnalyzer`, `EmptyContentAnalyzer`.
* Efficiency: `LLMInferLatencyAnalyzer`, `ToolExecutionLatencyAnalyzer`.
* Behavior patterns: repetition, keyword, mixed-language, network-operation, command-running, and reward-hacking analyzers.
* Qualitative: `QualitativeAnalyzer`, `MultiQualitativeAnalyzer`.

## Output Shape

Per-task details keep every analyzer result under `analysis_result`. Aggregated summaries group analyzers by category and render badcase ratios, average scores, numeric stats, and value counts declared by each analyzer.
