DocsGuides
Repository analysis
The Architecture and Documentation tabs, code health scores, the Files map, and the repository tools agents use.
Rusty analyzes the repositories in your workspace: how files import each other, which framework routes and components connect them, how the code has changed in Git, and how complex each file is. The analysis runs on your machine, reads files without running or building anything, and uses no model. You can browse the results in two tabs, and agents can query the same data while they work.
Which languages and frameworks are covered is listed in Supported languages & frameworks.
Where to find it
Two entries on the left rail open the views:
- Architecture shows the repository as a graph of packages, folders and files.
- Documentation has three pages: Project documentation, Code health and Files.
When the workspace contains more than one repository, pick one with the selector at the top of either tab. The selection is shared with the Source Control sidebar.
The first analysis of a repository runs in the background. Running work appears in a small bubble at the bottom left, with a × to cancel each job. Results are saved, so reopening a tab or restarting Rusty does not start over, and unfinished work resumes after a restart.
Architecture
The summary strip at the top counts packages, files, imports, import cycles, languages and findings, and links the most important findings. Below it, each package is a bubble sized by the number of its files, and the lines between bubbles are imports, wider for more imports. A dashed line is an import used only for types, and a red line is part of an import cycle.
Double-click a group to open its folders, and keep going down to the files. The path at the top takes you back up.
| Control | What it does |
|---|---|
| Colour by | Each package (its own colour), Language, Kind, or Findings severity. |
| Edges | The share of import weight drawn. Lower it to hide weaker lines in a busy graph. |
| Spacing | The distance between nodes. |
| Imports | All, Runtime only, or Type-only imports. |
| Filter groups | Show only groups whose name matches. |
| With findings | Show only groups that have findings. |
| Refresh | Analyze the repository again now. |
The panel on the right has three tabs. Inspector explains the selected node: why the group exists, its findings, and the imports that cross its boundary. Findings lists everything the analysis flagged in the current view. Notes holds your own notes on files and groups, kept on this computer and never in the repository.
Less connected nodes are folded into a single +N more bubble, and the bottom of the canvas says how many nodes and weaker lines are hidden.
Findings
Findings are structural issues read from the import graph and Git history, such as import cycles, imports that cross a declared boundary, files that nothing imports, dependencies that are declared but not used (or used but not declared), tightly coupled files, and hotspots that change often. Each finding lists the files and lines involved. Findings are ranked by kind and size, not given a score.
Code health
Code health gives every file a score from 0 to 10. Each file starts at 10 and loses points for what the detectors find, with a cap per kind of issue so that no single issue dominates. No model is used, and every point lost comes with its evidence and line range.
The detectors look at three things:
- The code itself: complex or long functions, deep nesting, complex conditionals, functions with several separate complex sections, functions that are both long and complex, classes that do too much or whose methods share no state, and long lists of primitive parameters.
- How it handles failure, duplication and tests: errors that are caught and ignored (empty or catch-all handlers, results thrown away), functions that abort instead of returning an error (
unwrap,panic!,!!,printStackTrace), functions copied almost unchanged to other places (renamed copies count), sizeable files that no test imports or is named after, tests that assert nothing, and several skipped tests in one file. Test code is judged by its own detectors and is not held to the error-handling and duplication rules. - Its change history (when Git history is available): files that change often and are complex, files whose changes are spread across many places, files that are usually changed together with many others, files with many bug-fix commits, files owned mostly by one person or by someone no longer active, and files many people change at once. History can lower a score only so far, and less for code that is otherwise well structured.
The repository score is the average of file scores weighted by lines of code. Scores fall into five bands:
| Band | Score |
|---|---|
| Excellent | 8.5 and above |
| Good | 7.0 to 8.5 |
| Fair | 5.5 to 7.0 |
| Needs work | 4.0 to 5.5 |
| At risk | under 4.0 |
Infrastructure files are scored the same way: Terraform, Terragrunt, CI pipelines, Dockerfiles, Compose files, Kubernetes manifests, Ansible, shell scripts and Makefiles, plus repository files such as .gitignore and CODEOWNERS. Their findings cover pinning (providers, modules, actions and images), security exposure (open ingress, broad permissions, secrets written into files), hygiene, and relations across files, such as Terragrunt dependency loops or Terraform variables nothing reads. Supported languages & frameworks lists what is checked for each kind. Findings about security count in their own category of the score.
Next to the score, the page shows maintainability (how hard the code is to change), the health of hotspots (the files that change most), the number of open issues, the lowest-scoring file, the share of files scored, and how many points were lost to the code itself versus its change history. How scores work explains the calculation. Self-check compares the lowest-scoring files with the files that were actually bug-fixed recently, so you can see whether the score points at the right files in your repository. It needs at least 25 scored files with history, 5 of them bug-fixed.
The tabs below the distribution bar show the same results four ways: Files (worst first), Issues, Folders, and Map. Include tests adds or removes test files. Click a file to open its details, with each issue, where it is, and a Copy prompt button that copies instructions for fixing it, ready to paste into a chat.
Trend
Under the distribution bar, Trend shows a line of maintainability over time, the change since the previous analysis and since about 30 days earlier, and the files that fell the most since the last analysis. A point is recorded after every analysis; several analyses within ten minutes count as one point.
Build history re-scores up to 30 past commits, spread over the last two years, straight from Git's stored files without checking anything out, so the trend starts from the beginning. It runs as a background job in the process bubble and can be cancelled. Rebuilt points use maintainability, which counts only what the code shows (shape, duplication, error handling), so they compare with today's. They have no change-history findings or test links, because those need information that no longer exists for an old commit. Infrastructure files are not part of the trend.
Files
The Files page draws every file as a tile, grouped by folder and sized by lines of code (or switch Size). The lenses change what the colour means:
| Lens | Colour shows |
|---|---|
| Language | The language with the most lines in each tile. |
| Churn | Commits in the analyzed history; darker changed more. |
| Dependents | How many files import the most-imported file in the tile, as a percentile. |
| Findings | The most severe open finding in the tile. |
| Owner | Files where one person made 80% or more of the changes. |
The table below lists files with their language, lines, how many files import them, commits, main author and findings. Filter it by path, language and time range, show only files with findings, or hide tests.
Project documentation
Project documentation turns the analysis into pages you can read: an overview, getting started, key concepts, how it works, architecture, the active landscape, a glossary, and a page per top-level module. A model writes each page from a brief that Rusty builds out of the analysis, the README and excerpts of the code, and Rusty checks that the file paths and names the page mentions exist.
- Written by picks the model. By default it is your chat model.
- Write documentation writes every page that is missing or out of date. Before it starts, it shows the number of pages and an estimate of the input tokens; each page is one model call.
- Write this page writes only the page you are looking at.
The glossary is collected from the repository's own documents and is not written by a model. Pages are marked when the code they describe has changed since they were written. After a commit, Rusty asks whether to update the affected pages.
Two switches in the tab header control what happens in the background:
- Index in background analyzes the code again a few seconds after files change. Only changed files are measured again. No model is used.
- Use in chats adds the documentation pages that match a request to that chat's context.
Tools for agents
Agents can use the same analysis through read-only tools, available in Agent Mode, in every workflow step and on the Canvas:
| Tool | What the agent gets |
|---|---|
repo_overview |
The shape of an unfamiliar repository: the written overview, packages and their heaviest dependencies, entry points, the most depended-on files, code health, infrastructure files by kind with their Terraform modules and Terragrunt units, hotspots and where to start reading. |
repo_context |
A file's connections: what it imports, what imports it, what changing it may affect, and recent changes. |
repo_symbol |
One function, method or class, instead of the whole file. |
repo_risk |
Before editing: how risky a change to these files is, and which tests to run. |
repo_health |
After editing: the files' health scores and issues, or the repository's biggest issues when asked what to improve. It also reports the maintainability trend, so an agent can tell whether the last change helped. |
code_guidelines |
The project's own code guidelines: what applies to a file before editing it, and what an edit broke of them. |
repo_wiki |
The project documentation pages. |
When a language is not supported, these tools say so instead of returning an error, so the agent can fall back to reading files. Calls appear in Tool Execution Observability like any other tool.
Where the results are stored
The analysis and documentation pages are saved in Rusty's application data, not in your workspace, so they never show up in Git. Nothing is sent anywhere while analysing. A model only sees analysis results or documentation when you write pages, when Use in chats adds pages to a chat, or when an agent calls one of the tools above.