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

sessclone

토큰, 모델, 비용 사용량을 SessClone 배포에 보고하는 Claude Code 플러그인으로, 상태 표시줄과 슬래시 명령, 선택적 트랜스크립트 업로드를 제공합니다.

NotTahaAli@NotTahaAli

NotTahaAli/sessclone/tree/main/packages/plugin

번역 완료

이 mod 소개

SessClone Collector는 Claude Code 사용량(토큰, 모델, 비용 입력, 타이밍)을 SessClone 배포에 보고하여 개인과 조직이 사람、Project、Device、Session별 지출을 볼 수 있게 합니다. SessionStart、Stop、StopFailure、SessionEnd hooks와 상태 표시줄、/sessclone-status 및 /sessclone-sync 명령을 포함하며, mod에서는 /sessclone:status 및 /sessclone:sync로 대체할 수도 있습니다. 턴마다 bearer key가 포함된 메타데이터만 HTTPS로 전송합니다. 선택적 트랜스크립트 업로드를 켜지 않으면 프롬프트、답변、파일 내용은 전송하지 않습니다. Node 22.18+(또는 23.6+、24)가 필요합니다. MIT 라이선스입니다.

설치

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

claude plugin marketplace add NotTahaAli/sessclone
claude plugin install sessclone
원문 / README

sessclone

The SessClone Collector. It reports your Claude Code usage (tokens, models, cost inputs, timings) to a SessClone deployment, so you and your Org can see spend per person, Project, Device and Session on the dashboard.

Install

/plugin marketplace add NotTahaAli/sessclone
/plugin install sessclone@sessclone

Claude Code asks for two things, both optional:

  • API key: create one in the dashboard under Keys. It is shown once and kept in Claude Code's secure credential store, not in settings.json. Leave it empty in a Claude Code cloud environment whose SessClone API credential adds it.
  • Deployment URL: leave it empty for the hosted service at https://sessclone.com. Self-hosted deployments enter their own address.

Restart Claude Code. The next session says whether it connected, and which Org it reports to. Turns from before the install are backfilled from the transcripts Claude Code still keeps.

Requires Node 22.18 or newer (or 23.6+, or 24).

Commands and the status bar

  • /sessclone-status shows what the last session start found: the deployment, the key's first three characters and length, whether it was accepted and for which Org, plus this Device, how many of this session's Turns are not sent yet, what is waiting to send and the last push.
  • /sessclone-sync sends everything waiting now, without a Claude turn, and says what it sent.
  • A line above the prompt shows whether the key is connected, whether this session is synced or how many Turns it is behind, what is queued, and ↗, which opens this session in the dashboard.

These are the plugin's mod (hooks/register.tsx), which needs Claude Code 2.1.287 or newer. Where mods cannot load, /sessclone:status and /sessclone:sync do the same, except that status leaves out this session's unsent Turns, and sync is carried out by the hook that ends that turn.

What it sends, and where

Everything goes over HTTPS to the deployment URL above, with your key as a bearer token, except the opt-in transcript upload described last.

  • Session start (SessionStart): GET /api/ingest to ask whether the key is accepted and for which Org. If it is not, the plugin says so and sends nothing else until a session starts with a key that is. Then it re-sends what an earlier session could not (POST /api/ingest).
  • Every turn (Stop): POST /api/ingest with, per Turn, the token counts by kind, the model, timings, the Session, Project and Device it belongs to, the working directory, the git branch, and the git remote reduced to a Project key. No prompt, no reply, no file contents.
  • Session events (StopFailure, SessionEnd): POST /api/ingest saying that a turn ended on an API error, or that a session ended.
  • Transcripts, only if you opt in: the raw session transcript, which does contain prompts and code, is uploaded only when your Member settings on the deployment turn transcript upload on. It is off by default. The plugin asks the deployment for an upload URL (POST /api/logs/presign), uploads the compressed transcript to that URL, which is the deployment's object storage (Supabase Storage for the hosted service), and confirms it (POST /api/logs/confirm). Your Org's retention removes it.

What it reads and runs locally

  • Claude Code's own transcripts under ~/.claude/projects/ (or CLAUDE_CONFIG_DIR), from a cursor, so each turn costs a few hundred bytes.
  • git in the session's working directory, to read the branch and remote.
  • A state directory for cursors, the retry queue, and the last key check (~/.local/state/sessclone, ~/Library/Application Support/sessclone, or %LOCALAPPDATA%\sessclone).
  • When HTTPS_PROXY is set, each hook restarts itself once under Node's own proxy support so its requests go through that proxy.

The API key is read only from the plugin's setup prompt, never from your shell environment, and never written to a log, a file or a transcript.

Settings

| Setting | Where | Default | | ------------------- | ----------------------------- | ------------------------ | | API key | setup prompt (api_key) | none, optional in cloud | | Deployment URL | setup prompt, SESSCLONE_URL | https://sessclone.com | | State directory | SESSCLONE_STATE_DIR | per platform, see above | | Device name | SESSCLONE_DEVICE | derived from the machine | | Print hook failures | SESSCLONE_DEBUG=1 | off |

To change an answer, run /plugin configure sessclone and start a new session.

Source and license

Readable source, no build step: the hooks in hooks/ run as node <file>.mjs and import the modules in src/. MIT licensed, see LICENSE. Project home and issues: https://github.com/NotTahaAli/sessclone

비슷한 프로젝트