0xGondarxyz/claude-code-mods/tree/main/active-time
active-time
Claude Code에서 실제로 보낸 시간(입력과 Claude 작업, 유휴 터미널 제외)을 계산해 상태 줄과 /claude-time에 표시하는 Claude Code 모드입니다.
이 mod 소개
active-time
Claude Code와 실제로 함께한 시간을 세는 Claude Code 모드입니다. 열어 둔 터미널은 포함하지 않습니다. 백그라운드에서 실행 중인 개발 서버도 포함하지 않습니다.
이 모드는 active-time이라는 폴더에 있습니다. Claude Code가 claude-로 시작하는 플러그인 이름을 예약하고 있기 때문입니다. 명령은 여전히 /claude-time입니다.
설치
/plugin marketplace add 0xGondarxyz/claude-code-mods
/plugin install active-time@claude-code-mods
설치하지 않고 시험할 수도 있습니다.
git clone https://github.com/0xGondarxyz/claude-code-mods
claude --plugin-dir claude-code-mods/active-time
모드는 샌드박스되지 않습니다. Claude Code와 동일한 접근 권한으로 실행됩니다. 이 모드를 포함해 어떤 모드든 설치하기 전에 소스 코드를 읽으세요.
무엇을 세는가
활성 시간은 2종류입니다.
you: 프롬프트 상자에 입력하는 시간입니다. 간격이 120 s 이하인 편집은 하나의 구간이 됩니다. 더 오래 멈추면 새 구간이 시작됩니다. 프롬프트를 제출하면 구간이 닫힙니다.claude: Claude가 작업하는 시간입니다. 모든 에이전트의 각 모델 요청과 각 도구 호출이 포함됩니다(도구 호출 하나는 최대 10분). 백그라운드 서브에이전트가 작업하는 시간도 포함됩니다. 이들 사이의 간격이 30 s 이하이면 이어집니다. 질문에 답하는 동안의 대기처럼 한 턴의 대기 시간은 포함하지 않고, 그 안의 모델 요청과 도구 호출만 셉니다.
전체 시간은 두 종류의 합집합입니다. 겹치는 부분은 한 번만 셉니다. 동시에 작동하는 두 세션도 한 번만 셉니다.
상태 줄
CC today 2h14m · week 11h05m
하루의 작업일은 현지 시간 05:00부터 05:00까지이므로 자정 후의 작업은 전날에 포함됩니다. 주는 월요일 05:00에 시작합니다. 매 턴 후와 60 s마다 업데이트됩니다.
명령
/claude-time은 다음을 표시합니다.
- 오늘, 이번 주, 이번 달을 각각
you와claude로 나눔 - 최근 7일을 하루에 한 줄씩
- 이번 주 저장소별(폴더 이름 기준 상위 5개)
데이터 위치
각 세션은 자체 파일에 기록되므로 서로 덮어쓰지 않습니다.
~/.claude/active-time/<YYYY-MM-DD>_<sessionId>.json
내용: { "repo": "...", "intervals": [{ "s": ms, "e": ms, "k": "you" | "claude" }] }. 05:00을 넘긴 세션은 작업일마다 파일 하나를 기록하며 <YYYY-MM-DD>가 작업일입니다. repo는 세션 폴더의 git 최상위 디렉터리 또는 폴더 자체입니다.
초기화하려면 폴더를 삭제하세요.
rm -r ~/.claude/active-time
트랜스크립트 백필
모드가 로드되기 전에 시작된 세션은 최근 40일 동안 ~/.claude/projects에 있는 트랜스크립트로 다시 구축됩니다. Claude 시간만 제공하며 과거 세션의 입력 시간은 복구할 수 없습니다.
- 각 트랜스크립트 항목에는 타임스탬프가 있습니다. 연속한 두 항목 사이에서 두 번째가 실제 사용자 프롬프트가 아니고 간격이 10분 이하라면 그 사이를
claude시간으로 계산합니다. 프롬프트가 대기를 시작합니다. 더 긴 간격도 대기입니다. 30 s 이하의 간격은 이어집니다. - 헤드리스 트랜스크립트(
claude -p, SDK)는 건너뜁니다. - 결과는
~/.claude/active-time/<YYYY-MM-DD>_<sessionId>.bf.json에 기록됩니다(같은 구조에"source": "transcript"를 추가). 라이브 파일은 건드리지 않습니다. 전체 합계는 모든 파일의 합집합이므로 두 종류가 함께 있어도 한 번만 셉니다. - 대화형 세션 시작 시 백그라운드에서 실행되며 그 후 10분마다 실행됩니다. 마지막 실행 이후 변경된 트랜스크립트만 다시 읽습니다. 첫 실행은 시간이 걸릴 수 있습니다.
python3(/usr/bin/python3) 및find가 필요합니다.
헤드리스 실행
프롬프트에 사람이 없는 세션(claude -p, SDK)은 아무것도 기록하지 않고 파일과 상태 줄도 만들지 않습니다.
제한
- Claude Code가 충돌할 때 아직 열려 있는 구간은 사라집니다.
- 권한 응답을 기다리는 도구 호출은 Claude 시간에 포함됩니다(최대 10분).
- 입력 감지는 기본 프롬프트 상자에서만 이뤄집니다.
- 합계는 벽시계 시간이며 청구 시간이 아닙니다.
설치
먼저 작성자의 README에서 marketplace와 플러그인 이름을 확인하세요. 저장소 구조에 따라 명령어가 달라질 수 있습니다.
claude plugin marketplace add 0xGondarxyz/claude-code-mods claude plugin install active-time
원문 / README
active-time
A Claude Code mod that counts the time you really spend with Claude Code. An open terminal does not count. A dev server running in the background does not count.
The mod lives in a folder named active-time because Claude Code reserves plugin names that start with claude-. The command is still /claude-time.
Install
/plugin marketplace add 0xGondarxyz/claude-code-mods
/plugin install active-time@claude-code-mods
Or try it without installing:
git clone https://github.com/0xGondarxyz/claude-code-mods
claude --plugin-dir claude-code-mods/active-time
Mods are not sandboxed. They run with the same access as Claude Code. Read the source before you install any mod, including this one.
What counts
Two kinds of active time:
you: you write in the prompt box. Edits with a gap of 120 s or less form one interval. A longer pause starts a new one. Submitting a prompt closes the interval.claude: Claude works. This is each model request and each tool call of any agent of any agent (one tool call counts at most 10 minutes). Background subagents count while they work. Gaps of 30 s or less between these join. The wait of a turn (for example on a question) does not count, only the model requests and tool calls inside it.
The total is the union of both kinds. Overlaps count once. Two sessions that work at the same time count once.
Status line
CC today 2h14m · week 11h05m
A day is a work day from 05:00 to 05:00 local time, so work after midnight counts for the day before. The week starts on Monday 05:00. It updates after each turn and every 60 s.
Command
/claude-time shows:
- today, this week and this month, each split into
youandclaude - the last 7 days, one line each
- this week per repo (top 5, by folder name)
Where the data lives
Each session writes its own file, so sessions never overwrite each other:
~/.claude/active-time/<YYYY-MM-DD>_<sessionId>.json
Content: { "repo": "...", "intervals": [{ "s": ms, "e": ms, "k": "you" | "claude" }] }. A session that crosses 05:00 writes one file per work day, and <YYYY-MM-DD> is the work day. The repo is the git top level of the session folder, or the folder itself.
To reset, delete the folder:
rm -r ~/.claude/active-time
Backfill from transcripts
Sessions that started before the mod loaded are rebuilt from the transcripts in ~/.claude/projects, for the last 40 days. This gives Claude time only. Typing time of old sessions cannot be recovered.
- Each transcript entry has a timestamp. For two entries in a row, the time between them counts as
claudetime when the second one is not a real user prompt and the gap is 10 minutes or less. A prompt starts a wait. A longer gap is a wait too. Gaps of 30 s or less join. - Headless transcripts (
claude -p, the SDK) are skipped. - Results go to
~/.claude/active-time/<YYYY-MM-DD>_<sessionId>.bf.json(same shape plus"source": "transcript"). Live files are never touched. Totals take the union of all files, so a session with both kinds counts once. - It runs in the background at the start of an interactive session, then every 10 minutes. Only transcripts changed since the last run are read again. The first run can take a while.
- It needs
python3(/usr/bin/python3) andfind.
Headless runs
Sessions without a person at the prompt (claude -p, the SDK) record nothing, write no file and show no status line.
Limits
- Intervals still open when Claude Code crashes are lost.
- A tool call that waits for your permission answer counts as Claude time (up to the 10 minute cap).
- Typing is seen only in the main prompt box.
- Totals are wall clock, not billed time.
