$npx -y skills add AlexAI-MCP/hermes-CCC --skill hermes-compressCompress conversation context — summarize the current session, extract key decisions and facts, then compact history to free up context window.
| 1 | # hermes-compress |
| 2 | |
| 3 | Compress the current conversation context by extracting what matters, writing a structured summary to memory, and producing a compact session-state block that can replace the full history in future context windows. |
| 4 | |
| 5 | ## Invocation |
| 6 | |
| 7 | ``` |
| 8 | /hermes-compress |
| 9 | ``` |
| 10 | |
| 11 | No arguments required. Claude will process the full conversation history visible in the current context window. |
| 12 | |
| 13 | --- |
| 14 | |
| 15 | ## What This Skill Does |
| 16 | |
| 17 | When invoked, Claude executes the following steps in order: |
| 18 | |
| 19 | ### Step 1 — Review All Messages |
| 20 | |
| 21 | Claude reads every message in the current conversation from the beginning: user turns, assistant turns, tool calls, and tool results. Nothing is skipped. The goal is to produce a lossless inventory of everything meaningful that occurred. |
| 22 | |
| 23 | ### Step 2 — Extract Structured Content |
| 24 | |
| 25 | Claude identifies and categorizes content into six buckets: |
| 26 | |
| 27 | | Bucket | What goes here | |
| 28 | |--------|----------------| |
| 29 | | `decisions` | Choices the user or Claude made ("we decided to use Postgres", "REST over gRPC") | |
| 30 | | `artifacts_created` | Files written, code blocks produced, configs generated (include file paths) | |
| 31 | | `problems_solved` | Bugs fixed, errors resolved, blockers cleared | |
| 32 | | `facts_learned` | New information ingested from user, tools, or research | |
| 33 | | `open_issues` | Unresolved questions, TODOs, known bugs not yet fixed | |
| 34 | | `next_steps` | Explicit or implied follow-up actions | |
| 35 | |
| 36 | ### Step 3 — Write to Memory |
| 37 | |
| 38 | Claude writes the structured summary to the project memory file at: |
| 39 | |
| 40 | ``` |
| 41 | ~/.claude/projects/<project-slug>/memory/session_<YYYYMMDD_HHMM>.md |
| 42 | ``` |
| 43 | |
| 44 | If the file already exists (e.g., from a previous compress run in the same day), Claude appends rather than overwrites, with a `---` separator and a new timestamp header. |
| 45 | |
| 46 | Claude also updates `MEMORY.md` to add an index entry pointing to the new session file. |
| 47 | |
| 48 | ### Step 3a - Handle Memory Write Failures |
| 49 | |
| 50 | - Create the memory directory before writing if it does not already exist. |
| 51 | - Write the session file first and update `MEMORY.md` second so a partial failure does not lose the summary. |
| 52 | - If appending fails because an existing session file is malformed, leave the old file untouched and write a new timestamped file instead. |
| 53 | - If the memory index update fails, report that the session file was written and that index repair is still needed. |
| 54 | - If the environment is read-only or permission-restricted, skip file writes, tell the user exactly what could not be persisted, and still emit the session-state block. |
| 55 | - If the conversation is too large to process in one pass, summarize in chunks and merge the six buckets before writing. |
| 56 | - Never drop explicit user requirements, file paths, commands, or unresolved blockers during fallback processing. |
| 57 | |
| 58 | ### Step 4 — Identify What Can Be Dropped |
| 59 | |
| 60 | Claude classifies each segment of the conversation as: |
| 61 | |
| 62 | - **Retain** — essential for ongoing work (active code, current decisions, open issues) |
| 63 | - **Compress** — can be replaced by the summary (resolved discussions, background context) |
| 64 | - **Drop** — safe to discard (pleasantries, duplicate messages, superseded ideas) |
| 65 | |
| 66 | This classification is not surfaced to the user by default but informs the session-state block. |
| 67 | |
| 68 | ### Step 5 — Produce the Session-State Block |
| 69 | |
| 70 | Claude outputs a compact YAML block that contains everything needed to resume the session from scratch: |
| 71 | |
| 72 | ```yaml |
| 73 | # hermes-compress session state |
| 74 | # Generated: 2026-04-07T14:32:00Z |
| 75 | # Original message count: 47 |
| 76 | # Compressed to: ~800 tokens |
| 77 | |
| 78 | session: |
| 79 | project: ontology-workspace |
| 80 | date: 2026-04-07 |
| 81 | duration_approx: 90min |
| 82 | |
| 83 | decisions: |
| 84 | - "Use Neo4j as primary graph store for ontology nodes" |
| 85 | - "REST API over gRPC for external integrations" |
| 86 | - "Deploy to Vercel, not Railway" |
| 87 | |
| 88 | artifacts_created: |
| 89 | - path: "AlexAI/api/routes.py" |
| 90 | description: "FastAPI router with /query and /ingest endpoints" |
| 91 | - path: "CLAUDE.md" |
| 92 | description: "Updated with hermes-compress active persona note" |
| 93 | |
| 94 | problems_solved: |
| 95 | - "Fixed OpenCrab surrogate encoding error by normalizing Korean queries to English" |
| 96 | - "Resolved Neo4j connection timeout by bumping pool size to 20" |
| 97 | |
| 98 | facts_learned: |
| 99 | - "opencrab_flex.py fallback_cypher field contains a ready-made Cypher query" |
| 100 | - "Honcho profile stored at ~/.claude/projects/*/memory/user_honcho_profile.md" |
| 101 | |
| 102 | open_issues: |
| 103 | - "hermes-search --recent N subcommand not yet tested against real history file" |
| 104 | - "MEMORY.md index needs backfill for sessions before 2026-03-01" |
| 105 | |
| 106 | next_steps: |
| 107 | - "Run /hermes-search 'Neo4j connection' to verify memory is searchable" |
| 108 | - "Commit routes.py and push to main branch" |
| 109 | - "Set up Vercel project link with verce |