explaingit

adityapal67/context-graph-compressor

17Audience · developerComplexity · 1/5LicenseSetup · easy

TLDR

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.

Mindmap

mindmap
  root((context-graph-compressor))
    What It Does
      Conversation compression
      JSON graph output
      Context handoff
    Node Types
      Facts and decisions
      Code snippets
      Open threads
    Output Modes
      Compact minimal
      Readable full text
    Use Cases
      Cost reduction
      Session continuity
      Team sharing
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Compress a 50-turn coding session down to ~400 tokens and continue it in a new Claude chat without losing any key context or decisions

USE CASE 2

Cut token costs on long AI work sessions by handing off a compressed graph instead of resending thousands of tokens of history each time

USE CASE 3

Archive a project's decision log and bug fixes as a readable JSON file teammates can load into their own AI sessions

Tech stack

Claude Skills

Getting it running

Difficulty · easy Time to first run · 5min

Installed as a Claude skill through the Claude.ai interface, no terminal or code required, trigger with phrases like 'compress this chat'.

MIT license, use, copy, modify, and distribute freely for any purpose, including commercial use, as long as you keep the copyright notice.

In plain English

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.

Copy-paste prompts

Prompt 1
Compress this entire chat using context-graph-compressor compact mode and give me the JSON graph I can paste into a new Claude session to continue this project
Prompt 2
Using the context-graph-compressor JSON format, write a context graph for my current project with nodes for the main goal, three decisions made, two bugs fixed, and one open thread
Prompt 3
Take this context-graph-compressor output and write a system message I can prepend to a new GPT-4 session so it understands my project state without the original conversation history
Prompt 4
Explain how to read a context-graph-compressor graph: what does each node type mean, and how should I prioritize high vs low importance nodes when resuming a session
Open on GitHub → Explain another repo

← adityapal67 on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.