# Issue Fix

## Use Seer's issue fix to automatically find the root cause of issues and generate code fixes.

**Issue fix** is Seer's collaborative workflow to find the root cause of and solution to issues. It uses Sentry's context (issue details, tracing data, logs, and profiles), your codebases (integrated through GitHub), and its interactions with you to identify and reason through problems in your code.

Issue fix can be automated, allowing it to populate root cause analysis, solutions, and even pull requests as issues occur.

Issue fix builds upon the capabilities previously known as Autofix.

## [How Issue Fix Works](#how-issue-fix-works)

Seer's issue fix flow follows a three step process:

1. [Root Cause Analysis](#root-cause-analysis): Analyze the issue using Sentry's context and your codebases and determine the root cause
2. [Solution Identification](#solution-identification): Identify a solution based on the analysis
3. [Code Generation](#code-generation): Generate a code fix and open a PR

When you begin debugging an issue with Seer, you will see a screen like this, which includes the high-level issue summary and a button to start the issue fix flow:

[![Issue Fix Start Screen](/_next/image/?url=%2Fmdx-images%2Fissue-fix-start-screen-S32RAGME.png%231528x948\&w=3840\&q=75)](/mdx-images/issue-fix-start-screen-S32RAGME.png)

### [Root Cause Analysis](#root-cause-analysis)

Seer will then analyze the issue and relevant code to help identify the root cause and propose a solution. You'll see a live stream of Seer's thought process in real time as it works through the problem. Seer will share key insights as they come up and you'll have the option to expand each. You'll see the event data and code that support Seer's conclusions, building a clear chain of reasoning back to the root cause.

While Seer is reasoning through your problem, you can step in to add context or feedback; collaboration tends to lead to the best results. If Seer encounters gaps in its understanding, it will ask for your input.

The final root cause analysis will show you the sequence of events that led to the issue, and a detailed analysis of the most likely culprit. This analysis includes helpful annotations, such as links back to the exact lines of code or Sentry telemetry that are relevant to the analysis.

[![Screenshot of the root cause analysis completed by Seer](/_next/image/?url=%2Fmdx-images%2Frca-HUPG52GY.png%231480x1408\&w=3840\&q=75)](/mdx-images/rca-HUPG52GY.png)

### [Solution Identification](#solution-identification)

Once Seer has completed its root cause analysis, it will begin searching for a solution. The process will be familiar: you will see a chain of reasoning appear as it begins working through the problem, and you are free to collaborate with Seer at any point.

When it's finished, you will see the recommended solution. From here, you can:

1. Remove any steps or actions that you disagree with
2. Add any additional steps or instructions, for example request additional unit tests to prevent regressions of the original error

Once you are ready to proceed, you can select "Code It Up" to generate code resolving the bug.

### [Code Generation](#code-generation)

During the coding step, Seer will identify the code patch(or patches) needed to implement the solution. When it's done, you'll see a preview showing the suggested diffs across your codebase. If the fix involves service dependencies, you may see edits spanning across multiple repositories.

From here, you can choose to draft a PR, or checkout the code changes locally for further iteration. If you choose to checkout the code locally, Seer will make a new branch for you.

[![Screenshot of Seer showing code it generated](/_next/image/?url=%2Fmdx-images%2Fcoding-step-7KZ3DEAN.png%231502x1546\&w=3840\&q=75)](/mdx-images/coding-step-7KZ3DEAN.png)

## [What Issue Fix Uses](#what-issue-fix-uses)

Seer is a powerful debugging agent, with access to a wide variety of data sources and tools. While debugging issues, it may examine:

* **Issue details**: Error messages, stack traces, and event metadata from your [Issues](/product/issues/)
* **Tracing data**: Distributed [traces](/concepts/key-terms/tracing/#whats-a-trace) and span information
* **Logs**: Structured [Logs](/product/explore/logs/) from your application (beta)
* **Your codebases**: Relevant code from linked GitHub repositories, with support for multiple repos for distributed services
* **Performance data**: Profiles and performance metrics
* **Interactive feedback**: Your input and guidance during the process

This context is crucial to Seer's capabilities, and it allows it to do things like investigate a backend service that may be the true root cause for a frontend bug you are trying to troubleshoot.

## [Settings](#settings)

Issue fix's default behavior can be customized in several ways:

1. You can manually customize the repositories it has access to
2. You can define the default branch it should use in each repository
3. You can add any additional custom context that that may be useful within the scope of each individual repository

Seer already automatically parses rules files from [Cursor](https://docs.cursor.com/context/rules), [Windsurf](https://windsurf.com/editor/directory), [Cline](https://docs.cline.bot/features/cline-rules), and [Claude Code](https://docs.anthropic.com/en/docs/claude-code/tutorials#create-an-effective-claude-md-file)

[![Screenshot of the repository settings page](/_next/image/?url=%2Fmdx-images%2Frepo-settings-YALPF3CE.png%232216x698\&w=3840\&q=75)](/mdx-images/repo-settings-YALPF3CE.png)

## [Best Practices](#best-practices)

* Setup the GitHub integration, allowing Seer access to your codebase and enabling it to generate code fixes. Enabling the GitHub integration will help Seer to provide better results. See the [Sentry GitHub integration](/organization/integrations/source-code-mgmt/github/) to learn how
* The more Sentry context you have, the better equipped Seer will be to help: consider instrumenting your application to collect traces, profiles and logs, and send them to Sentry.
* For JavaScript / TypeScript projects that are minified in production, upload [source maps](/platforms/javascript/sourcemaps/) to Sentry for the best results

Currently, GitHub is the only SCM supported by Seer. We are currently working to add support for other services including GitLab and Bitbucket.
