# Configuration

> Environment variables, files and project instructions that change how RaptorCode behaves, and where it keeps its state.

RaptorCode needs very little configuration: a DeepSeek key, and optionally a model choice and project instructions.

## Environment variables

- `DEEPSEEK_API_KEY` (string):
Your DeepSeek API key, used instead of the saved one. A key from the environment is never written to disk.

- `RAPTOR_MODEL` (model id):
The model for every command, for example `deepseek-flash`. Overrides the `/model` choice; `raptor run --model` overrides it in turn.

- `CI` (true):
Plain output for automation: `raptor` prints its startup line instead of opening the REPL, `raptor tui` prints a snapshot, and `raptor swarm run` refuses to start.

- `NO_COLOR, FORCE_COLOR`:
Turn colour off, or force a colour depth.

- `RAPTORCODE_NO_EMOJI`:
Use ASCII icons on the startup screen, like `--no-emoji`.

## Files in your home folder

| Path | Contents |
|---|---|
| `~/.raptor/.credentials` | The DeepSeek key saved by the REPL, owner-only (`0600` on Linux and macOS, a restricted ACL on Windows). |
| `~/.raptor/model` | The model chosen with `/model`. |

To reset, delete the file, or set `DEEPSEEK_API_KEY` to use a different key without touching it.

## Files in your repository

| Path | Contents |
|---|---|
| `RAPTOR.md`, `AGENTS.md` or `CLAUDE.md` | Project instructions for the agents. The first one found is used. |
| `raptor.toml` | Provider configuration written by `raptor init`. Never holds keys, tokens or endpoints. |
| `.raptor/tasks/<task-id>.toml` | Single-task metadata. |
| `.raptor/swarms/<task-id>.toml` | Swarm metadata, one entry per role. |
| `.raptor/agents/<agent-id>.toml` | Records written by `raptor agent create`. |
| `.raptor/worktrees/` | Task and swarm worktrees. |

Creating a task or swarm adds `/.raptor/` to `.git/info/exclude`, which is local to your clone, so none of this state shows up in `git status`.

## Project instructions

The REPL agent, every swarm agent and `raptor run` add the first of `RAPTOR.md`, `AGENTS.md` or `CLAUDE.md` found in the agent's working directory, or else in the nearest parent directory that contains `.git`, to their system prompt. It is capped at 24,000 bytes and framed as guidance from the repository's maintainers.

```md RAPTOR.md
# Project notes for agents

- Build with `npm run build`; test with `npm test`.
- Use TypeScript strict mode and the existing ESLint config.
- Never edit files under `generated/`.
```

> **Warning:** Instruction files are repository content and can carry prompt injection. They cannot change the tool policy, but in a repository you don't trust, read them before granting consent.

## `raptor.toml`

`raptor init` writes a minimal file at the repository root:

```toml raptor.toml
# RaptorCode project configuration
version = 1

[providers.deepseek]
enabled = true
```

It holds provider enablement only. Keys never go in this file.
