ClaudeMods
☰
KO
● — 명 접속 중 · 조회 — 회
후원프로젝트 제출
GitHub 저장소 · 작성자 IT-BAER

session-reaper

시간 초과를 지난 유휴 Code 세션을 보관하고 종료된 세션이 남긴 유휴 프로세스 트리를 중지하여 Windows에서 RAM 및 커밋 요금을 회수하는 Claude Code 데스크톱 모드입니다.

I
IT-BAER@IT-BAER

IT-BAER/claude-forge/tree/main/mods/session-reaper

번역 완료

이 mod 소개

session-reaper는 Windows의 Claude 데스크톱 앱을 위한 Claude Code 모드입니다. 몇 분마다 (1) 구성 가능한 제한(기본 60분)보다 오래 유휴 상태인 Code 세션을 보관하고, 실행 중/고정/백그라운드 사용 중인 세션은 건너뜁니다(보관된 목록에서 복원 가능). (2) 세션의 claude.exe가 사라진 후 세션이 남긴 프로세스 트리를 중지합니다. 단, 모든 프로세스가 충분히 오래되었고 CPU가 유휴 상태일 때만 해당하며, 브라우저, 편집기, 탐색기 및 터미널에 대한 안전 목록이 있습니다.

동기: 각 데스크톱 Code 세션은 자체적으로 약 0.8GB의 claude.exe와 모든 MCP 서버의 복사본을 유지합니다. 하루 작업으로 38개의 claude.exe(15GB)와 88개의 node.exe(8GB)가 남아 커밋 요금이 47.1/47.6GB에 도달하여 Chrome이 충돌했습니다. 유휴 세션을 보관하고 남은 프로세스를 중지하여 30GB로 줄였습니다.

요구 사항: C:\Windows의 Windows(고정 경로 PowerShell 및 Win32_Process 사용), 보관 단계를 위한 데스크톱 앱의 Code 탭은 ccd_session_mgmt 서버를 통해(자동 모드의 경우 permissions.allow에 "mcp__ccd_session_mgmt__archive_session" 필요), 다른 호스트는 프로세스 단계만 실행합니다.

설치: /plugin install session-reaper --marketplace IT-BAER/claude-forge

옵션: idleMinutes (60), orphanMinutes (60), cpuIdleMs (1000), intervalMinutes (5). 모드가 실행되는 동안 실행 중인 claude.exe 아래에서 관찰된 프로세스만 추적됩니다.

설치

먼저 작성자의 README에서 marketplace와 플러그인 이름을 확인하세요. 저장소 구조에 따라 명령어가 달라질 수 있습니다.

claude plugin marketplace add IT-BAER/claude-forge
claude plugin install session-reaper@claude-forge
원문 / README

session-reaper

A Claude Code mod for the Claude desktop app on Windows. Every few minutes it:

  1. Archives Code sessions that had no activity for longer than a limit (default 60 minutes). Running and pinned sessions are skipped; the app itself also refuses sessions that are open on screen or still have background work. Archived sessions can be restored from the Archived list.
  2. Stops process trees that a session left behind. It records every process a claude.exe started (MCP servers, dev servers, shells). Once that claude.exe is gone, a tree is stopped only when every process in it is at least 60 minutes old and used almost no CPU since the previous check. chrome.exe, msedge.exe, Code.exe, claude.exe, explorer.exe and WindowsTerminal.exe are never stopped.

Every open session loads the mod, but only one of them does the work (a heartbeat in the plugin store picks it).

Why it exists

Each desktop Code session keeps its own claude.exe (about 0.8 GB) plus its own copy of every MCP server, and none of it goes away while the session sits in the sidebar. On a 32 GB machine, a day of work left 38 claude.exe (15 GB) and 88 node.exe (8 GB) processes running, the commit charge reached 47.1 of 47.6 GB, and Chrome crashed with an out-of-memory error. Archiving the idle sessions and stopping their leftover processes brought the commit charge down to 30 GB.

Requirements

  • Windows installed in C:\Windows (the process step runs C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe by its fixed path and reads Win32_Process).

  • The Claude desktop app's Code tab. The archive step calls the app's ccd_session_mgmt server, which other hosts (CLI, VS Code) do not have; there only the process step runs.

  • In auto permission mode the archive call from a mod is refused unless it is allowed. Add this rule to permissions.allow in ~/.claude/settings.json:

    "mcp__ccd_session_mgmt__archive_session"
    

    The rule also lets Claude archive sessions in any chat without asking.

Install

/plugin install session-reaper --marketplace IT-BAER/claude-forge

Options

| Option | Default | Meaning | | --- | --- | --- | | idleMinutes | 60 | Archive a session idle for this many minutes | | orphanMinutes | 60 | Minimum age of every process in a left-behind tree | | cpuIdleMs | 1000 | Most CPU time (ms) a process may use between two checks and still count as idle | | intervalMinutes | 5 | How often the active session checks |

Only processes seen under a running claude.exe while the mod runs are tracked; trees left behind before the mod loaded are not touched.

비슷한 프로젝트