---
title: "context-meter"
url: "https://claudemods.dev/ko/builds/context-meter-fa972f"
source: "https://github.com/lucenity0/claude-code-mods/tree/main/context-meter"
source_type: "github"
repo: "https://github.com/lucenity0/claude-code-mods/tree/main/context-meter"
author: "lucenity0"
author_handle: "lucenity0"
stars: 0
category: "대시보드 및 HUD"
categories: ["hud"]
tags: ["claude-code", "context-meter", "hooks", "plugin", "status-line", "typescript", "ui"]
permission_level: 0
scan_complete: true
install: "claude plugin marketplace add lucenity0/claude-code-mods\nclaude plugin install context-meter"
added: "2026-10-05T01:57:21.420Z"
updated: "2026-10-04T19:20:39Z"
locale: "ko"
content_locale: "ko"
---

# context-meter

프롬프트 오른쪽 아래의 컨텍스트 창 미터입니다. 클릭하면 전체 분석을 엽니다

## Description

# claude-code-mods

Claude Code용 작은 플러그인입니다. 각 mod는 function hooks를 사용하는 TypeScript 파일 하나입니다.

<img src="assets/hero.svg" alt="Claude Code에서 네 가지 mod 실행: 위험한 rm을 막는 seatbelt, session-dash 패널, turn-meter 상태 줄, ding 토스트" width="900">

```
turn-meter     a turn timer in the status line
seatbelt       blocks destructive commands and edits to secrets
ding           a chime when a long turn finishes
session-dash   /dash, a live pane of what the session did
context-meter  a context window meter under the prompt; click it for the breakdown
```

그 밖에도 프롬프트 위에서 세션에 반응하는 픽셀 동료 [claude-familiar](https://github.com/lucenity0/claude-familiar)와 접힌 `Read 3 files` 줄에 파일 이름을 표시하는 [claude-readout](https://github.com/lucenity0/claude-readout)가 있습니다.

&nbsp;

## 설치

```sh
git clone https://github.com/lucenity0/claude-code-mods ~/claude-code-mods
claude --plugin-dir ~/claude-code-mods/seatbelt --plugin-dir ~/claude-code-mods/session-dash
```

모든 세션에서 function hooks를 켜고 mod를 로드하려면 `~/.claude/settings.json`에 설정합니다.

```json
{
  "env": {
    "CLAUDE_CODE_ENABLE_FUNCTION_HOOKS": "1",
    "CLAUDE_CODE_PLUGIN_DIRS": "~/claude-code-mods/turn-meter:~/claude-code-mods/seatbelt:~/claude-code-mods/ding:~/claude-code-mods/session-dash:~/claude-code-mods/context-meter"
  }
}
```

`CLAUDE_CODE_ENABLE_FUNCTION_HOOKS`가 켜는 early-access API를 사용하며 Claude Code 2.1.287에서 테스트했습니다.

&nbsp;

## turn-meter

Claude가 작업하는 동안 상태 줄이 올라가고 턴이 끝나면 요약을 보여 줍니다.

```
✓ 41s · 12.3k in · 1.8k out
```

```ts
on('turn.start', ($, e, next) => { /* timer */ return next(e) })
```

&nbsp;

## seatbelt

모든 `Bash`, `Edit`, `Write` 호출을 실행 전에 확인하고 해로운 호출은 거부합니다.

```
● Bash(rm -rf /tmp/build/../../)
  ⎿  seatbelt: blocked `rm -rf /tmp/build/../../`
```

```
blocks                                  still allows
rm -rf /   rm -fr ~   rm -rf /x/../../  rm -rf node_modules
```

각 규칙은 [`rules.ts`](seatbelt/hooks/rules.ts)의 작은 객체입니다.

```ts
{ name: 'curl | sh', reason: 'pipes a script from the internet straight into a shell' }
```

사고를 막는 안전장치이지 샌드박스는 아닙니다.

&nbsp;

## ding

30초보다 긴 턴이 끝나면 ding이 토스트를 보여 주고 원래 제작한 두 음 [chime](ding/sounds/done.wav)을 재생합니다. 소리는 macOS에서만 재생됩니다.

```json
{ "pluginConfigs": { "ding": { "options": { "thresholdSeconds": 60, "sound": false } } } }
```

&nbsp;

## session-dash

`/dash`를 입력해 패널을 열고 다시 `/dash`를 입력하거나 `q`를 눌러 닫습니다.

```
╭─ Session ─────────────────────────────╮
│ 4 turns · 2m13s · 184k in · 9.2k out  │
│ Tools (23 calls)                      │
│ Bash  ████████████████████ 9          │
╰───────────────────────────────────────╯
```

```ts
on('tool.call', async ($, e, next) => { const ran = await next(e); return ran })
```

&nbsp;

## context-meter

미터는 입력 아래 프롬프트 오른쪽 아래에 있습니다. 60%에서 노란색, 80%에서 빨간색으로 바뀝니다.

```
ctx ▰▰▰▱▱▱▱▱ 42%
```

클릭하거나 `/ctx`를 입력하면 분석을 열고 Esc로 닫습니다.

```
42%  84k of 200k  claude-opus-5-5 · estimated
83k free · compacts in 83k
```

분석은 로컬 추정치입니다. Count exactly는 `/context`처럼 token-count API로 정확히 셉니다.

```ts
on('session.measure', async ($, e, next) => { await update($, fill, () => e.context); return next(e) })
```

&nbsp;

## 하나 만들기

```
hello/
├── .claude-plugin/plugin.json    { "name": "hello", "version": "0.1.0", "description": "…" }
└── hooks/
```

```ts
import type { Register } from 'claude-code'
export const register: Register = on => { /* register a hook */ }
```

```sh
claude plugin validate ./hello
claude plugin test ./hello
```

&nbsp;

---

<sub>MIT · built with Claude Code</sub>

## Install

```
claude plugin marketplace add lucenity0/claude-code-mods
claude plugin install context-meter
```

## Original README

# claude-code-mods

Small plugins for Claude Code. Each mod is one TypeScript file of function hooks.

<img src="assets/hero.svg" alt="Claude Code with all four mods running: seatbelt blocking a dangerous rm, the session-dash pane, the turn-meter status line and a ding toast" width="900">

```
turn-meter     a turn timer in the status line
seatbelt       blocks destructive commands and edits to secrets
ding           a chime when a long turn finishes
session-dash   /dash, a live pane of what the session did
context-meter  a context window meter under the prompt; click it for the breakdown
```

Also: [claude-familiar](https://github.com/lucenity0/claude-familiar), a pixel companion that sits above the prompt and reacts to your session, and [claude-readout](https://github.com/lucenity0/claude-readout), which names the files on the folded `Read 3 files` line.

&nbsp;

## install

```sh
git clone https://github.com/lucenity0/claude-code-mods ~/claude-code-mods
claude --plugin-dir ~/claude-code-mods/seatbelt --plugin-dir ~/claude-code-mods/session-dash
```

To turn on function hooks and load the mods in every session, set this in `~/.claude/settings.json`:

```json
{
  "env": {
    "CLAUDE_CODE_ENABLE_FUNCTION_HOOKS": "1",
    "CLAUDE_CODE_PLUGIN_DIRS": "~/claude-code-mods/turn-meter:~/claude-code-mods/seatbelt:~/claude-code-mods/ding:~/claude-code-mods/session-dash:~/claude-code-mods/context-meter"
  }
}
```

These use function hooks, an early-access API that `CLAUDE_CODE_ENABLE_FUNCTION_HOOKS` turns on, and were tested on Claude Code 2.1.287.

&nbsp;

## turn-meter

The status line counts up while Claude works. When the turn ends it shows the summary.

```
✓ 41s · 12.3k in · 1.8k out
```

```ts
on('turn.start', ($, e, next) => {
  ticker?.cancel()
  let seconds = 0
  $.ui.status('running 0s')
  ticker = $.clock.every(1000, () => {
    seconds += 1
    $.ui.status(`running ${formatDuration(seconds * 1000)}`)
  })

  return next(e)
})
```

&nbsp;

## seatbelt

Checks every `Bash`, `Edit` and `Write` call before it runs, and denies the ones that would hurt.

```
● Bash(rm -rf /tmp/build/../../)
  ⎿  seatbelt: blocked `rm -rf /tmp/build/../../` (rm -rf on / or ~): it
     recursively deletes the filesystem root, a top-level folder or your home folder…
```

```
blocks                                  still allows
rm -rf /   rm -fr ~   rm -rf /x/../../  rm -rf node_modules
git push -f origin main                 git push --force origin my-branch
curl … | sh                             curl -o install.sh …
mkfs   dd of=/dev/…   chmod -R 777      chmod 755 script.sh
edits to .env  *.pem  ~/.ssh/*          .env.example
```

Each rule is a small object in [`rules.ts`](seatbelt/hooks/rules.ts):

```ts
{
  name: 'curl | sh',
  reason: 'pipes a script from the internet straight into a shell',
  matches: command => /\b(curl|wget)\b[^|]*\|\s*(sudo\s+)?(ba|z|da)?sh\b/.test(command),
}
```

It's a guardrail against accidents, not a sandbox.

&nbsp;

## ding

When a turn that ran longer than 30 seconds finishes, ding shows a toast and plays an original two-note [chime](ding/sounds/done.wav). The sound plays on macOS only.

```json
{ "pluginConfigs": { "ding": { "options": { "thresholdSeconds": 60, "sound": false } } } }
```

&nbsp;

## session-dash

Type `/dash` to open the pane. Type `/dash` again, or press `q`, to close it.

```
╭─ Session ─────────────────────────────╮
│ 4 turns · 2m13s · 184k in · 9.2k out  │
│                                       │
│ Tools (23 calls)                      │
│ Bash  ████████████████████ 9          │
│ Read  ███████████████ 7               │
│ Edit  █████████ 4                     │
│                                       │
│ Turn time · max 1m12s                 │
│ ▂▄▃▆▁▅█▃▄▁▆▃                          │
│                                       │
│ Recent files                          │
│ src/server.ts                         │
│ README.md                             │
│                                       │
│ [ Reset ]  [ Close ]                  │
╰───────────────────────────────────────╯
```

```ts
on('tool.call', async ($, e, next) => {
  const ran = await next(e)
  await update($, stats, current =>
    countTool(current, e.tool, { isDenied: ran.deny !== undefined, isError: ran.isError === true }),
  )

  return ran
})
```

&nbsp;

## context-meter

A meter sits at the bottom right of the prompt, under the input. It turns yellow at 60% and red at 80%.

```
ctx ▰▰▰▱▱▱▱▱ 42%
```

Click it, or type `/ctx`, to open the breakdown. Esc closes it.

```
42%  84k of 200k                                     claude-opus-5-5 · estimated
██████████████████████████▌█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒▒▒▒
83k free · compacts in 83k

● Messages                 62k  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━   74%
● System tools             13k  ━━━━━━━━                                15%
● Skills                  4.9k  ━━━                                      6%
● System prompt           3.7k  ━━                                       4%
○ on demand                93k  MCP tools, not in the window

last request 84k in · 82k cached · 967 out

memory
  CLAUDE.md   ~/code/app                                             900

[ Count exactly ]  [ Refresh ]  [ Compact ]  [ Close ]
```

The breakdown is a local estimate. Count exactly counts it with the token-count API, as `/context` does.

```ts
on('session.measure', async ($, e, next) => {
  await update($, fill, () => e.context)
  if (e.changed.includes('context') && (await isPaneOpen($))) void loadDetails($, 'summary')

  return next(e)
})
```

&nbsp;

## make one

```
hello/
├── .claude-plugin/plugin.json    { "name": "hello", "version": "0.1.0", "description": "…" }
└── hooks/
    ├── hooks.json                { "modules": ["./register.ts"] }
    └── register.ts
```

```ts
import type { Register } from 'claude-code'

export const register: Register = on => {
  on('tool.call', { tool: 'Edit' }, async ($, e, next) => {
    const result = await next(e)
    $.ui.toast(`edited ${e.file_path.split('/').pop()}`)
    return result
  })
}
```

```sh
claude plugin validate ./hello
claude plugin test ./hello
```

&nbsp;

---

<sub>MIT · built with Claude Code</sub>
