Model Router  ·  Documentation  ·  Previous: Glossary  ·  Next: Performance

# Security Python names are in `plugins/model-router/scripts/modelrouter/`, and Node tests in `tests/mod/router.test.ts`. ## Reporting a vulnerability Report it privately through the repository's GitHub security advisory form ([Report a vulnerability](https://github.com/crisnahine/claude-code-model-router/security/advisories/new)). Put no details in a public issue. ## What it stores Everything goes in one data folder: `CLAUDE_PLUGIN_DATA`, else `~/.claude/plugins/data/model-router-local`, with `CLAUDE_CONFIG_DIR` in place of `~/.claude` when set (`store.data_dir`). With `CLAUDE_CONFIG_DIR` unset and `CLAUDE_PLUGIN_DATA` an absolute path that ends in `plugins/data/`, the config folder, where `model-router.json`, `agents/` and the install records are read, is the one three levels above it (`store.claude_home`). On POSIX the folder is mode 0700 and each file the Python runtime writes is created 0600 (`store._private_file`). - `ledger.jsonl`: session and agent ids, agent names, levels, efforts, reasons, model names, token counts and Claude Code's dollar estimate. A Stop ask, an early line about unchecked agent edits, a line about files an agent's shell changed, a delegation reminder, a delegation refusal and the end of the refusals each leave a row with the session id and a kind (`ledger.gate`). A `usage` row also says whether the session is on a subscription. Rows older than 30 days go, in a trim about once a day, and past 4 MiB the usage rows a later one replaces go, then the older half if the rest still fills 2 MiB (`store.append_ledger`). - `routes.json`, `done.json`, `launched.json`, `pending.json`: where each call went and what came back. A call is known by a hash of its agent and prompt (`calls.identify`), its task by a hash of its agent and description (`calls.task`). No brief, prompt or description is stored (`SecurityClaims.test_no_brief_or_description_is_stored`). - `switches.json`: per session, the `/model-router` switch, whether the session check ran, and the session's model family and effort (`settings.switch`, `session.check`, `session.observe`). Dropped at `/clear` (`settings.forget`), and by a write after a day unwritten. Any other session end leaves it. - `sessions.json` (each session's model), `edits.json` (the time of the last project edit, whether an agent made the unchecked edits, the time of the last check or Stop ask, the change time and size, without paths, of the last 100 writes a file tool made, the IDs of the last 100 agents whose shell changes were noted, up to 6,000 characters of lines about those changes that the main conversation hasn't got yet, each naming up to 8 project files and removed when given, the time the line about unchecked work was last said, and the IDs of the last 20 agents a disk scan covered, each with two times), `allowlist.json` (the model settings the mod read, and the project path), `state.json` (model health, per provider), `locks.json` (lock waits and skipped writes), a `.flock` file per state file, empty marks under `mod-calls/`, and up to three `.corrupt-