## TL;DR

A 5,000-line allowlist does not fit in context and does not need to. Index it by path or fingerprint, load only the entries relevant to the current findings, and keep the full list on disk.

## Error

```text
agent failed with context overflow reading a 5k-line allowlist
```

## Steps

1. Confirm the overflow is the allowlist, not the findings. Expected: the allowlist identified as the bulk.
2. Build an index: map file paths and fingerprints to allowlist entries. Expected: O(1) lookup per finding.
3. For each finding, load only its matching entries. Expected: tiny context per decision.
4. Keep the full allowlist in a file the agent can query, not in the prompt. Expected: on-demand access.
5. Periodically compact the allowlist; stale entries bloat it. Expected: it stays manageable.

## When to use

- Agents overflowing on large allowlists.
- Managing big exception lists.

## When not to use

- The allowlist is wrong (fix the entries).
- Small allowlists (load directly).

## Tool compatibility

- Indexed lookups; agent context management.

## Variant phrasings

### allowlist too big for context

Index it.

### context overflow reading exceptions

Chunked lookup.

## Why it happens

Allowlists grow monotonically; agents that inline them hit context limits eventually.

## Edge cases

- The index must rebuild when the allowlist changes.
- Path-based entries need normalization to match.
- Compaction needs review; do not auto-delete entries silently.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_VqxsZ6keGM03X_zVTXI8Mg
