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

# Find what changed before a pattern started

> Go from a metric that moved to the traces behind it and the commit most likely to have caused it, with the Kubit plugin in Claude Code or Cursor.

When a metric moves, such as an error spike, sentiment drift or more escalations, the Kubit plugin finds the traces behind it and the commits most likely to have caused it. You end with the top **5** suspect commits, each with a short summary of how it changed behavior. It takes about 10 minutes.

## Before you start

* [ ] The Kubit plugin installed in Claude Code or Cursor. See [Kubit Skills](https://learn.kubit.ai/lumos-ai/skills.md).
* [ ] A workspace with agent traces.
* [ ] Your agent's repo open locally, with full git history. A repo without git history isn't supported, and a shallow clone gets a warning with an offer to run `git fetch --unshallow`.

## Steps

### 1. Ask why the metric changed

Run `/kubit` with your question. It runs the investigation chain, starting at the step your question already covers.

```text theme={null}
/kubit why did errors spike on Tuesday?
```

### 2. Chart the metric and pin the window

`/kubit-report` charts the metric and pins the time window. The chain carries the workspace, time window and report link to the next step.

### 3. Pull the traces

`/kubit-inspect` pulls the traces in that window. It returns the total number of matches, up to 5 sample rows and a CSV export of every match.

### 4. Find the commit

The chain asks before it runs `/kubit-blame`. Confirm, and `/kubit-blame` maps agent names, tool names and prompts from the traces to files in your repo, asking you to confirm any match it isn't sure of. It then ranks commits in the window by how close they are in time, how much of the mapped code they touch and how large the change is.

## Verify

The result lists up to **5** suspect commits, each with a short summary of how it changed behavior. If no commit touched the mapped code in the window, it suggests a wider window.

## If it fails

| **Symptom** | **Cause** | **Fix** |
| - | - | - |
| No commit found | No commit touched the mapped code in the window | Accept the suggested wider window |
| LangChain spans marked unresolved | LangChain through Langfuse below v3 (`langfuse.callback` or `langfuse-langchain`) | Upgrade to `langfuse >= 3` |
| Warning about a shallow clone | The repo was cloned with limited history | Run `git fetch --unshallow` |

## Next Steps

* [Triggers](https://learn.kubit.ai/agent-observability/use/triggers.md): what Triggers compares in the app.
* [Kubit Skills](https://learn.kubit.ai/lumos-ai/skills.md#investigation-chain): the full investigation chain reference.


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