---
title: 'ARCE0005: Two commands or queries resolve to the same route'
editUrl: https://github.com/Cratis/Arc.Elixir/edit/main/Documentation/code-analysis/ARCE0005.md
description: ARCE0005 reports two Elixir commands or two queries that resolve to the same route, so only one can be served and their generated proxies collide.
lastUpdated: 2026-11-14T00:00:00.000Z
---


**Kind:** project. **Default severity:** error.

## Rule

Routes are built from the module namespace after `segments_to_skip` and the kebab-cased name. `MyApp.Authors.Register` and `Other.Authors.Register` both serve `/api/authors/register` when one segment is skipped. The rule reports every command that shares a route with another command, and every query that shares one with another query. A command and a query with the same route are not reported: they differ by HTTP method.

## Why it matters

Arc cannot send one request to two modules, so one of them is unreachable, and the generated proxies of the two would overwrite each other. It only shows when the second module is added, in a different part of the codebase, which is why it is a project rule.

## Bad

```elixir
defmodule MyApp.Authors.Register do
  use Arc.Command
  # ...
end

defmodule Backoffice.Authors.Register do
  use Arc.Command
  # ...
end
```

Both serve `/api/authors/register`.

## Good

Give one of them a name or a namespace of its own:

```elixir
defmodule Backoffice.Authors.RegisterByStaff do
  use Arc.Command
end
```

## How to fix

Rename one module or move it to a different namespace after the skipped segments. Set `segments_to_skip` under `config :cratis_arc, :analyzer` to the same value as your `Arc.Application`, so the rule sees the routes you serve.

## Related

- [Configuration reference](/arc/backend/elixir/configuration/)
- [Vertical slices](/arc/backend/elixir/vertical-slices/)
