waterside0219/session-forge — explained in plain English
Analysis updated 2026-05-18
Automatically compress a long Claude Code session's transcript before it hits the context limit.
Start a fresh Claude Code session that still feels continuous by injecting a memory summary on startup.
Run a background watcher that triggers a session forge automatically once context usage crosses a threshold.
| waterside0219/session-forge | arlandaren/proagents | audietoffe/plasma-gpu-router | |
|---|---|---|---|
| Stars | 25 | 25 | 25 |
| Language | Python | Python | Python |
| Setup difficulty | moderate | easy | hard |
| Complexity | 3/5 | 1/5 | 3/5 |
| Audience | developer | vibe coder | ops devops |
Figures from each repo's GitHub metadata at analysis time.
Requires tmux, Python 3.9+, and an existing Claude Code installation.
session-forge is a toolkit for keeping a Claude Code AI session alive and responsive over long conversations. Claude Code, the AI coding assistant from Anthropic, works inside a context window: a fixed amount of text it can hold in memory at once. As a conversation grows longer, the AI slows down and eventually hits the limit. This project solves that without making you start over from scratch. The toolkit provides two moves. The first is called "forge": it compresses the current session by rewriting the conversation transcript to keep only the most recent portion, then resumes the same chat thread in Claude Code with the slimmed-down history. The model keeps recent context but loses older bulk. The second move is starting a brand-new session, which begins with an empty context but immediately injects a summary of recent conversation and any saved long-term memories via a startup hook, so the AI feels like it remembers what just happened even though the window is technically fresh. The main components are three Python scripts. forge.py handles the actual transcript rewriting: it locates the live session file, calculates how much text to keep based on a token estimate, rewrites the file with fresh identifiers, verifies the result is valid, and respawns the Claude Code pane inside tmux (a terminal multiplexer). server.py is a small HTTP server that exposes those operations as API endpoints so a graphical app can trigger them. watcher.py is a background process that monitors context size and automatically triggers a forge when it crosses a threshold, so the window never completely fills on its own. The project also includes a SessionStart hook script that injects memory and recent chat history whenever a new session opens, and an optional SwiftUI card for macOS that shows a context usage bar and buttons to forge or start a new session. The toolkit requires tmux, Python 3.9 or newer, and an installed Claude Code installation. The README notes this was extracted from a private companion app running in production since May 2026.
A toolkit that keeps a long-running Claude Code AI session alive by compressing its transcript or seeding a fresh session with a memory summary.
Mainly Python. The stack also includes Python, tmux, SwiftUI.
Setup difficulty is rated moderate, with roughly 30min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.