# Module LittleGhost::CodeMode

Documentation version: Edge

Canonical HTML: https://littleghostai.org/docs/LittleGhost/CodeMode.html

Runs model-authored orchestration code in a child interpreter. Built-in
engines keep Tool authority in the parent process: each Tool call returns to a
trusted Broker for catalog validation and ordinary Agent dispatch. Custom
engines must preserve the Engine and Session containment contracts.

See the [Code Mode guide](../code_mode.md) for the first
Ruby program, Broker boundary, lifecycle, limits, optional JavaScript engine,
and extension contract.

## Class methods

<a id="method-c-register_engine"></a>
### `.register_engine`

```ruby
.register_engine(name, implementation)
```

Registers `implementation` under a trusted engine name.

<a id="method-c-resolve_engine"></a>
### `.resolve_engine`

```ruby
.resolve_engine(value)
```

Resolves a registered name or returns an explicit engine object.
