whatisgithub

What is session-forge?

waterside0219/session-forge — explained in plain English

Analysis updated 2026-05-18

25PythonAudience · developerComplexity · 3/5Setup · moderate

In one sentence

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.

Mindmap

mindmap
  root((session-forge))
    What it does
      Extends Claude Code sessions
      Compresses transcripts
      Injects memory on restart
    Components
      forge.py rewriter
      server.py API
      watcher.py monitor
    Tech stack
      Python
      tmux
      SwiftUI card
    Use cases
      Long coding sessions
      Auto context management
    Audience
      Claude Code power users

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

What do people build with it?

USE CASE 1

Automatically compress a long Claude Code session's transcript before it hits the context limit.

USE CASE 2

Start a fresh Claude Code session that still feels continuous by injecting a memory summary on startup.

USE CASE 3

Run a background watcher that triggers a session forge automatically once context usage crosses a threshold.

What is it built with?

PythontmuxSwiftUI

How does it compare?

waterside0219/session-forgearlandaren/proagentsaudietoffe/plasma-gpu-router
Stars252525
LanguagePythonPythonPython
Setup difficultymoderateeasyhard
Complexity3/51/53/5
Audiencedevelopervibe coderops devops

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires tmux, Python 3.9+, and an existing Claude Code installation.

So what is it?

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.

Copy-paste prompts

Prompt 1
Set up session-forge's watcher.py to automatically forge my Claude Code session when context usage gets high.
Prompt 2
Use session-forge's forge.py to compress my current Claude Code transcript and resume it in tmux.
Prompt 3
Add session-forge's SessionStart hook so new Claude Code sessions load my recent chat history automatically.
Prompt 4
Run session-forge's server.py so a GUI app can trigger a forge through an API endpoint.

Frequently asked questions

What is session-forge?

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.

What language is session-forge written in?

Mainly Python. The stack also includes Python, tmux, SwiftUI.

How hard is session-forge to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is session-forge for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.