> For the complete documentation index, see [llms.txt](https://help.swarmia.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.swarmia.com/features/metrics/code-metrics/codebase.md).

# Codebase

See which parts of your codebase change the most

### About

The Codebase view shows what's happening in your codebase: which parts of it change the most and who's changing them.

You can find it at [Metrics → Code metrics → Codebase](https://app.swarmia.com/metrics/code/codebase). It shows a tree of repositories, folders, and files, aggregated from the files changed in merged pull requests.

{% hint style="info" %}
The metrics are based on the filenames modified in your pull requests. Swarmia doesn't read your source code. Read more about [data access](/resources/security-and-data-retention/data-access.md).
{% endhint %}

### File changes

Each row in the table is a repository, folder, or file. Expand rows to drill down the tree. For each row, you can see:

* **PRs**: the number of pull requests that changed files in this location. Click the count to see the pull requests.
* **Authors**: the number of people who authored those pull requests. Click the count to see who they are.
* **Changes**: the lines added and deleted.
* **% changes**: this location's share of all line changes in the current view.

Sort by any of these columns to surface the most active parts of the codebase. By default, the view covers your whole organization; narrow it down with:

* **Teams**: focus on the pull requests of one or more teams.
* **Timeframe**: pick the date range in the top-right corner.
* **Pull request filters**: for example, filter by repository or by [AI attribution tag](/features/ai-tools/ai-tool-detection-and-filters.md) to see which files AI tools have been changing.

Some questions the view can answer:

* Which files have the most pull request activity this quarter? Would they benefit from refactoring, better test coverage or clearer ownership?
* Which parts of the codebase has our team worked on recently?
* Where have AI coding assistants made changes, and how much?
* Who has contributed to this legacy module lately?
* Are there knowledge silos, such as critical areas with only one recent author?

### Where does the data come from?

The view is based on merged pull requests and the file paths, additions, and deletions reported by GitHub or GitLab. Pull requests excluded by your [pull request settings](/settings/organization/pull-request-data-quality.md) don't appear here. You can change the status filter to include open or closed pull requests, too.

A few limits to be aware of:

* One view can cover up to 100,000 pull requests. If your filters match more, Swarmia shows a warning and asks you to narrow them down for complete results.
* For exceptionally large pull requests, Swarmia stores only part of the file list, so some files from those pull requests may be missing.
* Author counts are based on the pull request author, not individual commit authors.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.swarmia.com/features/metrics/code-metrics/codebase.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
