compress

A command that saves the current coding session to a configured memory vault and updates its searchable memory index.

In plain words
What is it for?
Use it to archive a session and add it to the Deus memory system, using the safest available vault configuration.
Why use it?
It preserves session context for later use and keeps the memory index aligned with the saved session log.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/sliamh11/deus/compress
Clone the repo
git clone --depth 1 https://github.com/sliamh11/Deus

Made for: Claude Code.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,144 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01144
Opus 5 $0.00000 $0.00572
Sonnet 5 $0.00000 $0.00229
Haiku 4.5 $0.00000 $0.00114

Measured 2d ago against content hash 5e3b08a67f7f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

compress scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/compress.md · 89 lines

How it starts

The opening of the file, as written. The whole thing — 89 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Save this Claude Code session to the vault and update the semantic memory index.

First, resolve the vault path using this per-instance order (highest priority first). $VAULT means the resolved path:

  1. DEUS_VAULT_PATH env var, if set.
  2. vault_path in ./.deus/config.json (the current working directory's instance-local config), if that file exists. If the file exists but has no usable vault_path, STOP and tell the user it is present but missing vault_path — do not fall through to the global config (that fall-through is what corrupts another instance's vault).
  3. vault_path in ~/.config/deus/config.json (global fallback).

Tiers 1 and 2 are the per-instance mechanisms: when several Deus instances run on one machine they share the global config (tier 3), so resolving from it alone can silently point this instance's /compress at a different instance's vault and corrupt its memory. The instance-local ./.deus/config.json keeps each instance self-contained. The memory_indexer.py calls below resolve the vault by the same order, so their writes land in this instance's vault too.

Review the conversation and create a session log at: $VAULT/Session-Logs/YYYY-MM-DD/{topic}.md

Create the YYYY-MM-DD folder if it doesn't exist. The filename should be the topic only (no date prefix), since the date is already in the folder name.

Use this format — tldr frontmatter is mandatory, decisions is mandatory when applicable, full sections are optional:

---
type: session
date: YYYY-MM-DD
topics: [topic1, topic2]
tldr: |
  What happened (1 sentence). Key decision or outcome. Pending: X, Y.
decisions:
  - "chose X over Y: brief reason"
  - "rejected approach A: brief reason"
---

<!-- Full details — only loaded on demand -->

## Decisions Made
- ...

## Key Learnings
- ...

## Files Modified
- ...

## Pending Tasks
- [ ] ...

Rules for decisions: array:

  • Maximum 3 items. Only include decisions that affect future sessions (tool choices, format preferences, architectural calls, explicit rejections).
  • Each item: quoted string, verb-first, ≤12 words.
  • Omit the decisions: key entirely if the session had no future-relevant stable decisions (e.g. purely exploratory sessions).

Keep tldr to 2–3 lines. Skip sections with no content.

After saving the session log, do three things:

  1. Update vault CLAUDE.md ($VAULT/CLAUDE.md):

    previous: block — rolling list of the last 3 sessions. Do NOT hand-edit it (concurrent /compress runs race on a manual read-modify-write and have corrupted the file). Use the atomic, lock-serialized splice:

    • Run: python3 ~/deus/scripts/sync_linear_pending.py --write-previous "YYYY-MM-DD: <tldr one-liner>" (≤120 chars).
    • It prepends, trims to 3, converts a single-line previous: "..." to list form, inserts before pending: if absent, and writes atomically under a lock — refusing (file unchanged, nonzero) rather than dropping a body key. If it exits non-zero, leave previous: as-is; never hand-splice.

    pending: block — merge, never replace:

    1. Read the current pending: block from CLAUDE.md. If missing, treat as empty list.
    2. Remove any items that match [x] completed tasks from the session log (fuzzy match on description).
    3. Add any new [ ] items from the session log that don't already exist (avoid duplicates).
    4. Cap at 10 items. If over 10, archive the oldest to $VAULT/CLAUDE-Archive.md.
    5. Write the merged list back to pending:.
  2. Index the new log into the semantic memory index by running: python3 scripts/memory_indexer.py --add "" (If the script fails, skip silently — the log is still saved.)

  3. Extract atomic facts from the session log: python3 scripts/memory_indexer.py --extract "" (If the script fails or prints "No decisions content — skipping extraction", skip silently.)

  4. Delete today's checkpoint now that the session log supersedes it: find "$VAULT/Checkpoints" -name "$(date +%Y-%m-%d)-*.md" -delete 2>/dev/null (Silent — no output expected.)

Read the full file on GitHub · 89 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 89 lines · 0 tokens per session scan A 5e3b08a67f7f

Subscribe to this mod's changes

compress is a command published in the GitHub repository sliamh11/Deus (51 stars, last pushed 8d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,144 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.