tokenhabit

tokenhabit is a skill for Claude Code from epoko77-ai/tokenhabit. It costs 371 tokens per session (5,146 once invoked), scanned A, original, MIT.

A coaching tool that finds habits in past coding-agent conversations that waste tokens, the text units used to process requests and responses, and suggests ways to reduce that waste.

In plain words
What is it for?
It helps scan saved session history, rank wasteful habits, assign a score, and suggest immediate changes such as clearing context when switching tasks.
Why use it?
It shows whether long logs, repeated context, or poor session organization are increasing cost without improving the result.

Skill for Claude Code

Written for Claude Code: PreToolUse hook event. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions subagents.

Good fit It helps scan saved session history, rank wasteful habits, assign a score…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/epoko77-ai/tokenhabit/skill
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add epoko77-ai/tokenhabit --skill skill
Clone the repo
git clone --depth 1 https://github.com/epoko77-ai/tokenhabit

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for tokenhabit

README.md
[![agentmods](https://agentmods.dev/badge/skills/epoko77-ai/tokenhabit/skill.svg)](https://agentmods.dev/skills/epoko77-ai/tokenhabit/skill)
Your own site
<a href="https://agentmods.dev/skills/epoko77-ai/tokenhabit/skill"><img src="https://agentmods.dev/badge/skills/epoko77-ai/tokenhabit/skill.svg" alt="Measured on agentmods" height="20"></a>
Per session 371 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,146 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00371 $0.05146
Opus 5 $0.00186 $0.02573
Sonnet 5 $0.00074 $0.01029
Haiku 4.5 $0.00037 $0.00515

Measured 7d ago against content hash 954b12cc2e41, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

tokenhabit scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

The scan reads SKILL.md. This mod also ships 8 executable files (scripts/_vendor/tokenhabit/__init__.py, scripts/_vendor/tokenhabit/catalog.py, scripts/_vendor/tokenhabit/cli.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skill/SKILL.md · 201 lines

How it starts

The opening of the file, as written. The whole thing — 201 lines — stays where its author put it; the contents beside it link to each section on GitHub.

tokenhabit — 토큰 습관 코칭 스킬

이 스킬의 정체성. tokenhabit = "무의식중에 토큰을 태우는 대화/사용 습관을 자각시키고 고치는 사용자 코칭 스킬." 하네스·에이전트·모델 티어·캐싱 설계 감사 → tokensave 스킬을 쓰라. 우리는 운전자의 습관을 다룬다.

🎯 목표를 착각하지 마라 — "낭비 제거"이지 "적게 쓰기"가 아니다. 진단 결과를 "그러니 Claude를 덜 쓰세요"로 번역하는 순간 이 스킬은 해로워진다. 목표는 같은 결과를 더 싸게 얻어, 아낀 예산을 실제 작업에 쓰는 것이다. 토큰을 아껴서 할 일을 못 하는 것은 낭비보다 비싼 실수다. (이 긴장에 대한 근거와 반론은 references/measurement_and_hooks.md §5 참고.)

핵심 엔진은 본문 모드가 아니라 scripts/habit_scan.py다 — 진단 요청을 받으면 이걸 먼저 실행하라. 이 스크립트는 ~/.claude/projects/*.jsonl과거 전체 세션을 LLM 0회로 사후 스캔해 Token Waste Score(A~F)·습관 순위·즉시 fix를 낸다. 설치형 CLI는 tokenhabit(없으면 python3 scripts/habit_scan.py). 아래 트리거 문구의 "이 세션"에 속아 현재 대화만 보고 "진단할 내용이 없다"고 답하지 말 것. 세션이 종료돼도, 새 세션이라 현재 대화가 비어도 — 진단의 SSOT는 디스크에 영속된 과거 로그이고 그걸로 항상 진단한다. 📂 스킬 로드 시 scripts/·references/를 먼저 훑어라. 본문 설명만 읽고 단정하지 말 것 — 그 추측·도구 점검 생략이 바로 이 스킬이 잡으려는 습관(H5·H8)이다.


지금 당장 바꾸는 5가지 습관 (퀵카드)

31패턴 중 빈도·임팩트 최상위 5개. 이것만 바꿔도 세션 비용을 크게 줄일 수 있다.

# 습관 즉시 fix
1 작업이 바뀌면 /clear — 다른 주제로 넘어갈 때 이전 컨텍스트를 그냥 끌고 간다 작업 전환마다 /clear. 돌아올 세션은 /rename으로 이름 붙여두고 나중에 claude --resume(CLI) 또는 /resume(인터랙티브)으로 복귀
2 로그·에러는 30줄만 — 빌드 로그 전체를 Ctrl+V로 붙여넣는다 에러 핵심 20~30줄만 선별. 파일 저장 후 경로만 전달
3 프롬프트에 파일 경로·완료 기준 명시 — "이 코드 좀 고쳐줘"처럼 모호하게 요청한다 @src/auth.ts 35~42줄 try/catch 추가. 나머지는 그대로.
4 CLAUDE.md에 반복 입력을 1회만 작성 — 매 세션마다 스택·규칙을 손으로 다시 입력한다 /init → CLAUDE.md 작성. 반복 워크플로우는 .claude/skills/로 영속화
5 탐색은 "서브에이전트로 해줘" — 메인 세션에서 "파악해줘"를 시킨다 "서브에이전트로 src/auth/ 탐색 후 함수명·위치만 요약해줘"

4가지 모드


MODE 1: SESSION COACH — 세션 토큰 진단

트리거: "이 세션 토큰 진단", "왜 토큰을 많이 써", "지금 세션 어때", "내 토큰 습관 진단", "전체 세션 진단", "새 세션에서 진단", "토큰 습관 봐줘"

철칙 — 반드시 준수. 진단 요청을 받으면 현재 대화만 보고 단정하지 말고, 먼저 scripts/habit_scan.py(설치본 tokenhabit CLI)를 실행한다. 범위는 사용자가 선택 — 전체 누적(--days N) 또는 이 세션만(--current). 새 세션이라 현재 대화가 비어 있어도 절대 "진단할 내용이 없다"고 답하지 말 것. 진단의 단일 진실 원천(SSOT)은 현재 대화가 아니라 디스크에 영속된 세션 로그(~/.claude/projects/**/*.jsonl)다 — 세션이 종료돼도 jsonl은 남으므로 끝난 세션도 진단 대상이다. 현재 대화 직접 관찰(아래 1~3번)은 --current 결과를 정성적으로 보강하는 보조 단계일 뿐, 그것만으로 "내용 없음" 판정 금지.

Read the full file on GitHub · 201 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 201 lines · 0 tokens per session scan A 954b12cc2e41

Subscribe to this mod's changes

tokenhabit is a skill published in the GitHub repository epoko77-ai/tokenhabit (19 stars, last pushed 21d ago), licensed MIT. It adds 371 tokens to every session and 5,146 once invoked, about $0.0019 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

eco-max

Maximum-savings variant of /eco - the same frugality rules PLUS a low reasoning-effort override for the invoked task. Use for routine chores (rename, small fix, quick question, boilerplate) when the user wants absolute minimum token spend; prefer plain /eco for hard or high-stakes work. Works in any language.

sup3x/claude-code-eco · 71 tokens

stacks

Load stack-specific knowledge (conventions, exact lint/test/build commands, common failure patterns) onto the current role agent for the project's detected tech stack(s) — Next.js, React Native, Spring Boot, FastAPI, Django, Rust, etc. Use at the start of any task in an unfamiliar or newly-onboarded repo, or whenever…

randomittin/heimdall · 85 tokens

eco

Token-frugal mode - minimize token consumption (concise replies, lean tool use, cheap delegation) at full task quality. Use when the user mentions tokens, cost, budget, quota, or economical operation, in any language. Invoke once; applies for the rest of the session. "/eco setup" configures permanent savings.

sup3x/claude-code-eco · 68 tokens

handoff

Sauvegarder la progression et generer un prompt de continuation.

Bidiche49/claude-conf · 15 tokens

setup-project

Bootstrap a project for Claude Code — auto-detect stack, configure permissions, generate commands.

Bidiche49/claude-conf · 20 tokens

caveman

Ultra-compressed communication mode. Cuts token usage 75% by speaking like caveman while keeping full technical accuracy. Supports intensity levels: lite, full (default), ultra, wenyan-lite, wenyan-full, wenyan-ultra. Use when user says "caveman mode", "talk like caveman", "use caveman", "less tokens", "be brief", or…

randomittin/heimdall · 98 tokens