gitmyhub

context-graph-compressor

★ 33 updated 20d ago

Convert long AI conversations into portable conversation state graphs for LLM handoffs.

A Claude skill that compresses a long AI chat session into a structured JSON graph of around 400 tokens, capturing facts, decisions, code snippets, and open threads, so you can continue in a fresh session at a fraction of the token cost.

Claude Skillssetup: easycomplexity 1/5

context-graph-compressor is a Claude skill that solves a common problem with long AI chat sessions: every new message in a conversation resends the entire history, which means a 50-turn conversation might cost 15,000 tokens on every single message. This skill lets you compress the whole conversation down to around 400 tokens, save that as a file, and paste it into a fresh chat to continue exactly where you left off, at a fraction of the cost.

The output is a structured JSON graph rather than a plain-text summary. The graph breaks the conversation into typed nodes: facts about the project, decisions that were made, bugs and their fixes, goals, code snippets, and open threads. Each node gets an importance label (high, medium, or low) so the receiving AI knows what it must understand versus what is optional background. Nodes can also reference each other to capture dependencies or relationships between pieces of information.

Two output modes are available. Compact mode produces a minimal version with abbreviated field names and short summaries, aimed at keeping the token count as low as possible for handoff purposes. Readable mode uses full field names and longer descriptions, which is better for sharing with teammates or archiving a project's history.

Because the output is plain JSON, it works with any AI that accepts text input: Claude, GPT-4, Gemini, Mistral, or others. You paste the compressed graph into a new chat session with a short instruction to continue from that state, and the new session picks up the context without needing the original conversation history.

Installation is done through Claude's skill settings: you download the .skill file and upload it through the Claude.ai interface. After that, you trigger it by typing phrases like "compress this chat" or "start fresh" in any conversation. The project is released under the MIT license.

Where it fits