---
title: 'ARCE0004: A command appends to Chronicle itself'
editUrl: https://github.com/Cratis/Arc.Elixir/edit/main/Documentation/code-analysis/ARCE0004.md
description: ARCE0004 warns when an Elixir command calls Chronicle.append itself instead of returning the event, so Arc skips key, concurrency and tenant handling.
lastUpdated: 2026-11-14T00:00:00.000Z
---


**Kind:** call. **Default severity:** warning.

## Rule

A command module that calls `Chronicle.append*` (on `Chronicle` or on a `Chronicle.EventSequences` module) appends on its own. The command should return what happened and let Arc append it.

## Why it matters

When `handle/2` returns `{:append, event}`, Arc appends it to the event source id in the command's `key: true` field, maps concurrency and constraint violations to validation results the client can show, and uses the caller's tenant. A direct append skips all of that, and the command also stops being a pure decision, which makes it harder to test.

## Bad

```elixir
def handle(%__MODULE__{} = command, ctx) do
  Chronicle.append(command.id, %MyApp.Authors.AuthorRegistered{name: command.name})
  {:ok, :registered}
end
```

## Good

```elixir
def handle(%__MODULE__{} = command, _ctx),
  do: {:append, %MyApp.Authors.AuthorRegistered{name: command.name}}
```

To append to another event source, return `{event_source_id, event}`. To also return a value to the client, return `{:append, events, response}`.

## How to fix

Return the events instead of appending them. If the append has to happen outside the command, move it into a reactor.

## Related rules

- [Commands](/arc/backend/elixir/commands/)
- [ARCE0001: A module declares a schema and handle/2 but does not use Arc.Command](/arc/backend/elixir/code-analysis/arce0001/)
