Improve Token Efficiency logo

Improve Token Efficiency

Community
jha0313
improve-token-efficiency

한 프로젝트의 Claude Code 세션 기록을 모아 토큰, API 정가 환산 금액, 캐시 적중률, 어림 점수를 세고 HTML 보고서를 만든다. 가격을 모르는 모델은 금액을 짐작하지 않는다. '토큰 효율 분석', '세션 비용 분석', '이 프로젝트에서 얼마나 썼어', '토큰 줄이고 싶어', 'token efficiency report', 'how much did I spend on Claude'.

Overview

Publisherjha0313
Repositoryskills_repo
Skill nameimprove-token-efficiency
Stars
160
Forks
80
Bundled files
4
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 4 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by jha0313 on GitHub. Read the source before you install it.

Installation

Install the Improve Token Efficiency AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/jha0313/skills_repo/tree/main/improve-token-efficiency
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/jha0313/skills_repo.git /tmp/skills_repo
mkdir -p .claude/skills
cp -r /tmp/skills_repo/improve-token-efficiency .claude/skills/improve-token-efficiency
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Improve Token Efficiency in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Improve Token Efficiency on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Improve Token Efficiency is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Improve Token Efficiency

여러 세션의 사용량을 프로젝트 단위로 세고, 어디에 돈이 걸려 있는지 보여 준다.

먼저 말할 한계

  • 금액은 API 정가로 환산한 추정이다. 구독으로 썼다면 청구액이 아니다. 계약 할인, 웹 검색 요금, 클라우드 사업자 가격은 들어 있지 않다.
  • 기록이 남은 기간만 센다. Claude Code는 기본 30일 뒤 기록을 지운다(cleanupPeriodDays).
  • 기록 형식은 공개 규격이 아니다. Claude Code가 바뀌면 숫자가 틀릴 수 있다.

언제 쓰나

  • 한 프로젝트의 여러 세션을 합쳐 토큰·금액·캐시·모델별 비중을 볼 때.
  • 습관을 바꾸기 전과 뒤를 같은 방법으로 비교할 때.

쓰지 않는 때: 지금 세션의 비용이나 구독 한도 → /usage. 지금 컨텍스트에 무엇이 들었나 → /context. 실제 청구액 → Claude Console 또는 클라우드 청구서. API 앱의 비용 → 이 기록에 없다.

순서

<스킬>은 이 SKILL.md가 있는 폴더다.

  1. 대상과 결과 폴더를 정한다. 경로를 받지 않았으면 현재 폴더, 결과는 ./token-report.
    • 완료 기준: 두 경로를 한 줄로 알렸다.
  2. 집계한다.
    bash
    python3 -I <스킬>/scripts/analyze_sessions.py --repo . --out-dir ./token-report
    기록 폴더를 자동으로 찾지 못하면 --repo는 그대로 두고 --sessions-dir <폴더>를 더한다. 제목은 --label <이름>으로 바꾼다.
    • 완료 기준: [ok]가 나오고 token-analysis.json이 생겼다. 종료 코드 2면 "셀 기록이 없다"고 알리고 끝낸다.
    • [ok]가 없으면 다음 단계로 가지 않는다.
  3. 경고를 처리한다. [warn]이 있으면:
    • 가격을 모르는 모델: 몇 건이 금액에서 빠졌는지 사용자에게 말한다.
    • 다른 프로젝트이거나 어느 프로젝트인지 모르는 응답: 합계에서 빠진 건수와 토큰을 말한다. 짐작해서 더하지 않는다.
    • 가격표 90일 초과: 갱신할지 묻는다. 갱신은 references/pricing.json의 source_url을 직접 열어 값과 checked_on을 함께 고치고 2단계를 다시 한다. 열지 못한 모델은 null로 둔다.
    • 완료 기준: 경고마다 처리했거나 답에 적었다.
  4. 보고서를 만든다.
    bash
    python3 -I <스킬>/scripts/build_dashboard.py --out-dir ./token-report
    • 완료 기준: token-report.html이 생겼다. 경로를 알려 주고, 사용자가 원하면 연다.
  5. 답한다. 숫자는 token-analysis.json에서만 옮긴다.
    • 완료 기준: 아래 답 형식의 칸을 모두 채웠다.

근거

  • 출력: 두 스크립트의 [ok]·[warn] 줄을 그대로 보여 준다.
  • 중복 제거: 한 응답이 여러 줄로 적히므로 메시지 id + requestId로 한 번만 센다. 뺀 줄 수는 notes.duplicate_lines.
  • 하위 에이전트 기록(<세션>/subagents/)은 부모 세션에 더한다.
  • 프로젝트 구분: 기록의 cwd로 가른다. 뺀 건수는 notes.other_project_*, notes.unclear_project_*. --repo 없이 --sessions-dir만 주면 가르지 않는다.
  • 가격: references/pricing.json 하나. 확인일과 출처가 들어 있다. fast 모드, 미국 전용 추론, 긴 프롬프트 가격도 여기서 읽는다.
  • 스크립트를 고쳤으면 python3 -I <스킬>/tests/run_tests.py를 돌려 통과를 보여 준다.

점수는 이 스킬이 정한 어림 기준이다(공식 기준 아님).

지표비중재는 법
캐시 활용도40%캐시 읽기 ÷ 총 입력, 0.85면 만점
산출 밀도20%출력 ÷ 총 입력, 2% 근처가 만점
파일 다시 읽기20%같은 파일을 다시 Read한 비율(다른 구간 읽기 포함)
도구 사용20%출력 1,000토큰당 도구 호출 수, 2회 근처가 만점

하지 말 것

  • 절감액을 지어내지 않는다. 보고서의 숫자는 그 항목에 걸린 크기다. 실제 절감은 바꾼 뒤 다시 재야 안다.
  • 모르는 모델에 비슷한 모델 가격을 쓰지 않는다. 예전 판이 그렇게 해서 금액이 틀렸다.
  • fast 모드를 절약 수단으로 권하지 않는다. 더 빠른 대신 더 비싼 요금이다.
  • 기록 원문을 대화나 결과에 옮기지 않는다. 프롬프트와 명령 출력에 비밀번호가 있을 수 있다. 스크립트는 본문과 파일 경로를 결과에 쓰지 않는다.
  • 보고서를 올리거나 보내지 않는다. 세션 id와 프로젝트 이름이 들어 있다. 공유는 사용자가 정한다.
  • 설정을 대신 바꾸지 않는다. 캐시 수명·모델·effort 변경은 제안만 한다.

답 형식

  1. 한 줄: 기간, 세션 수, 환산 금액(또는 "가격 모름"), 캐시 적중률. "API 정가 환산, 구독이면 청구액 아님"을 붙인다.
  2. 빠진 것: 가격을 모르는 응답 건수와 토큰, 다른 프로젝트·귀속 불명 응답 건수, 읽지 못한 줄, 가격표 확인일.
  3. 돈이 걸린 곳 1~3개: 항목, 걸린 크기, 바꿔 볼 한 가지.
  4. 보고서 경로.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Improve Token Efficiency AI skill do?

한 프로젝트의 Claude Code 세션 기록을 모아 토큰, API 정가 환산 금액, 캐시 적중률, 어림 점수를 세고 HTML 보고서를 만든다. 가격을 모르는 모델은 금액을 짐작하지 않는다. '토큰 효율 분석', '세션 비용 분석', '이 프로젝트에서 얼마나 썼어', '토큰 줄이고 싶어', 'token efficiency report', 'how much did I spend on Claude'.

Why use Improve Token Efficiency on TypingMind?

Because you install it once and use it with any model. Improve Token Efficiency is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Improve Token Efficiency in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/jha0313/skills_repo/tree/main/improve-token-efficiency. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Improve Token Efficiency?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Improve Token Efficiency?

As many as you like. As long as a model supports skills, you can use Improve Token Efficiency with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Improve Token Efficiency AI skill free?

Yes. It is published on GitHub by jha0313 under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇