LeventAksakal/clearance
clearance
컴퓨터 전체의 Claude Code 세션과 서브에이전트를 위한 리소스 정리 도구입니다. 여유 공간을 확인하고 더 실행하기 전에 허용·보류·전환합니다. Windows 전용, v0.1.0입니다.
이 mod 소개
clearance는 컴퓨터의 모든 세션이 컴퓨터 리소스와 다른 세션을 파악하게 하는 Claude Code 모드입니다. AbovePrompt 띠에 여유 공간(세션/서브에이전트를 몇 개 더 수용할 수 있는지), RAM 스파크라인, 픽셀 조정자의 신호등 등급을 표시하고, /clearance로 전체 패널을 열어 읽기 전용 규칙 검사를 실행합니다. 새 세션과 서브에이전트 생성은 예측에 따라 보류·전환·거부하도록 제어하며, 서브에이전트별·세션별 비용을 상한 신뢰구간으로 학습하고 관찰된 페이징 압력으로 메모리 하한도 학습합니다. 상태는 ~/.claude/clearance/ 아래에 저장됩니다. 컴퓨터별 기록기가 Win32 메모리·프로세스·페이징을 샘플링하고 주기적으로 docker ps와 docker stats를 실행합니다. 훅은 session.start/end, tool.call, Agent, agent.spawn, SubagentStart/Stop, command.run, ui.render를 포함합니다. mcp__clearance__headroom과 /clearance를 등록합니다. 네트워크에 접근하지 않습니다($.http는 사용하지 않음). claude plugin marketplace add LeventAksakal/clearance와 claude plugin install clearance@clearance로 설치합니다. MIT입니다.
설치
먼저 작성자의 README에서 marketplace와 플러그인 이름을 확인하세요. 저장소 구조에 따라 명령어가 달라질 수 있습니다.
claude plugin marketplace add LeventAksakal/clearance claude plugin install clearance
원문 / README
clearance
Status: v0.1.0. All 7 build steps are done: the shared snapshot and scribe election, presence and the gate, admission, the
/clearancepane, empirical forecasts, Docker and desktop attribution with convention checks, and THRASH with a floor learned from paging pressure. Windows only.
A Claude Code mod that makes every session on a machine aware of the machine's resources and of the other sessions:
- See every Claude session, its subagents, child processes and containers, the desktop app and the WSL/Docker VM, and what each one uses.
- Know the headroom: how many more local sessions or subagents fit right now, updated every 5 s.
- Get clearance before launching more. Over the cap, a new session is held, with the choice to divert to a cloud session, Remote Control or ssh, or to wait. A subagent spawn is refused with a forecast, so the agent can resize its fan-out; a cloud subagent (
isolation: "remote") is never gated by this machine. - Learn, don't assume: what a subagent and a session cost is an upper confidence bound on what this machine was seen to use, and the memory floor is where this machine was seen to start paging hard.
What you see
The band above the prompt, always up:
[marshaller] ● cleared 2s·6a RAM ▁▂▃▅▆▇ 82% 2.8 GB free
2s·6a: two more sessions and six more subagents fit. The sparkline is RAM in use over the last 50 s.- The pixel marshaller takes the traffic-light tier: green waves both paddles (a session fits), yellow waves one (only subagents fit), red crosses them overhead (nothing fits), grey dozes (no snapshot). In THRASH it shakes and the line reads
▲ THRASH … spawns refused. - Hover the band for the machine, the floor and what it rests on, the forecasts, and every session's own, child and container memory, then the desktop app, the VM and everything else.
/clearance opens the full pane; /clearance check runs the convention checks (read-only): Supabase project_id left as default or shared, compose stacks without a working_dir label, hard-coded host ports, and host-port or project-name collisions between running containers.
The band takes the AbovePrompt slot. Another plugin that draws there without passing the band on (token-weather does) hides it; clearance passes the band on, so a plugin beneath it still shows.
Install
claude plugin marketplace add LeventAksakal/clearance
claude plugin install clearance@clearance
What it reaches
Shared state lives in ~/.claude/clearance/ (see docs/design.md).
$.process: runspwsh -Fileon the scripts inscripts/.sampler.ps1(the scribe's, one per machine) reads memory, the process list with start times, and paging pressure (\Memory\Pages Input/sec, PDH) through Win32, and every 6th tickdocker psanddocker stats --no-stream(read-only). It writes only under~/.claude/clearance/.claim.ps1creates one epoch file there.verify.ps1is a manual, read-only cross-check of the snapshot (pwsh -File scripts/verify.ps1).
$.fs:- reads
~/.claude/sessions/*.json(never the*.keyfiles); - reads and writes
~/.claude/clearance/: this session's presence file, its history filehistory/<yyyy-mm>/<sessionId>.jsonl(one line per finished subagent: type, duration, growth; one line of the session's peaks), and, while it is scribe,pressure.json(a histogram of paging against available memory); - reads every session's history of the last two months and
pressure.jsonto learn the forecasts and the floor; - for
/clearance checkonly: readssupabase/config.tomland compose files in each session's folder and one level down.
- reads
- Hooks:
session.start,session.end,tool.call(every tool, afternext, only to note progress; the call is never changed),turn.startandturn.complete(only to note whether the session is working),tool.callofAgent(notesisolation: "remote"),agent.spawn(refuses a subagent over the cap or in THRASH),classic.SubagentStart(adds the subagent's budget line; starts measuring it),classic.SubagentStop(records what it cost),command.runofclearance,ui.renderofAbovePrompt(the band) and ofPane(the pane). $.tool.register:mcp__clearance__headroom, the census for the model.$.command.register:/clearance.$.ui.ask(the session-start dialog on HOLD),$.session.append(a system notice with the divert steps, only when chosen),$.ui.toast(one per THRASH episode; when a held start clears),$.ui.open,$.ui.status(terminal),$.ui.log(debug log).$.stateclearance.badge,clearance.pane,clearance.startChecked,clearance.waitingForClearance.$.session.id,$.clock,$.env.get('USERPROFILE').- No
$.http.
Options (/config): minFreeGB 0 (learned from paging; 5% of RAM until pressure is seen), maxCommitPct 90, maxSessions 6, maxAgents 8, sessionBaselineGB 0 (learned). A positive minFreeGB or sessionBaselineGB fixes that value.
Develop
claude plugin validate .
claude plugin test .
npx tsc -p .
tsc needs .claude-plugin/types/, which the engine writes when the mod is hot-loaded (or /plugin-types).
License
MIT
