Say goodbye to Claude Code context limits.
Progressive session compaction keeps sessions under the limit without losing the thread.
EverSession is built around one idea:
you should not have to manually run /compact or maintain a custom workflow to keep context relevant.
Threshold = 100k tokens (Claude: /context → Messages)
┌──────────────────────────────────────────────────────────────┐
│ EVS status (optional) │
│ Waiting 97k/100k [███████▒] │
└──────────────────────────────────────────────────────────────┘
│ threshold reached
v
┌──────────────────────────────────────────────────────────────┐
│ Auto-compact starts │
│ 102k/100k │
└──────────────────────────────────────────────────────────────┘
│ next Stop hook
v
│ supervised (auto mode) │ unsupervised (manual mode)
v v
┌─────────────────────────────┐ ┌────────────────────────────┐
│ Auto reload + resume │ │ Manual reload + resume │
│ │ │ restart manually │
└─────────────────────────────┘ └────────────────────────────┘
│ │
│ │
└───────────────┬───────────────────┘
│ reload boundary
v
┌──────────────────────────────────────────────────────────────┐
│ Apply compact + resume │
│ 102k → 78k (summary + recent thread) │
└──────────────────────────────────────────────────────────────┘
v
┌──────────────────────────────────────────────────────────────┐
│ Keep working. No manual /compact. │
└──────────────────────────────────────────────────────────────┘
- Automatic compaction — keep sessions under the token budget without manual
/compact. - Relevant context — the thread stays coherent because EVS preserves structure and injects a summary.
- Safe by default — backups + atomic writes + locks/guards to avoid losing data.
Claude Code is the primary focus. Codex support is early/experimental.
Requirements: Node.js >= 20.
npm i -g eversession
evs --helpRun this in the project directory you use with Claude Code (writes <project>/.claude/settings.json):
evs install --agent claudeThen run Claude under the EVS supervisor:
evs claude --reload autoIf claude isn’t on your PATH:
EVS_CLAUDE_BIN=/path/to/claude evs claude --reload autoRun Codex under the EVS supervisor:
evs codex --reload autoIf codex isn’t on your PATH:
EVS_CODEX_BIN=/path/to/codex evs codex --reload autoIf you run Codex directly (without evs codex), install the notify hook once:
evs install --agent codex
# If you already have notify configured:
evs install --agent codex --force
# later:
evs uninstall --agent codexThis edits ~/.codex/config.toml (or $CODEX_HOME/config.toml) and adds/removes:
notify = ["evs", "codex", "notify"]EVS targets Claude Code /context → Messages tokens (the visible message chain).
It does not measure the full runtime/system context used by Claude Code.
EVS reads config from:
- Global:
~/.evs/config.json - Local:
<project>/.evs/config.json(deep-merged; local overrides global)
View the resolved config (plus diagnostics about where values come from):
evs config showMinimal example:
{
"schemaVersion": 1,
"backup": false,
"claude": {
"reload": "manual",
"autoCompact": {
"enabled": true,
"threshold": "120k",
"amountTokens": "40%",
"amountMessages": "25%",
"model": "haiku",
"busyTimeout": "10s",
"notify": false,
"backup": false
}
},
"codex": {
"reload": "manual",
"autoCompact": {
"enabled": true,
"threshold": "70%",
"amountTokens": "40%",
"amountMessages": "35%",
"model": "haiku",
"busyTimeout": "10s",
"notify": false,
"backup": false
}
}
}Notes:
- Most users only need to tweak
threshold,amountTokens, andmodel. - Backups are opt-in: use
backup: true(or per-agentautoCompact.backup: true), or--backupon write commands.
Inside evs claude / evs codex (supervisor mode), you can omit the session ref:
evs session
evs log
evs analyze
evs lint --fix
evs compactOutside the supervisor, pass an explicit ref (UUID or .jsonl path). Use --agent claude|codex only when a UUID is ambiguous:
evs session <ref>
evs log <ref>
evs compact <ref>
evs remove <ref> 10,11,12
evs fork <ref>
evs pin <name> <ref>Uninstall removes only EVS-installed integration artifacts (hooks/statusline/notify). It does not delete ~/.evs/config.json.
evs uninstall --agent claude
evs uninstall --agent claude --global
evs uninstall --agent codex- Re-run
evs install --agent claude --statusline(or add--globalto use~/.claude/settings.json). - Restart Claude Code.
Outside the supervisor, pass an explicit session UUID or a .jsonl path:
evs session <uuid>
evs session /full/path/to/session.jsonlEVS logs are created only after EVS writes events (e.g. auto-compact runs).
evs log will not create a log file by itself.
This project is early and evolving. Expect some sharp edges; safety defaults are intentional.