Skip to main content

TasaTokens

¿Te sirven de verdad las herramientas para ahorrar tokens en Claude Code y Codex? ¿Y cuál te serviría?

TasaTokens lee tus sesiones en tu propio equipo y responde con tus números:

  • Dónde se te van los tokens: el contexto que arrastras, las respuestas del agente, las salidas de comandos, la lectura de ficheros…
  • Qué herramientas de ahorro tienes instaladas (RTK, Context Mode, Caveman, Serena, CodeGraph, Claude Mem… 20 en total) y si las estás usando.
  • Qué te recomendaría, ordenado por impacto: herramientas, pero también hábitos y configuración (/clear, /effort, subagentes, un CLAUDE.md más corto, skills propias, MCP que sobran).

Cada recomendación lleva su techo de ahorro: lo máximo que podría ahorrarte, calculado con tus registros. Si las salidas de tests suponen el 3 % de tu consumo, ningún compresor de salidas te ahorrará más de un 3 %.

English summary below.

Así funciona

Demo de TasaTokens: informe y comparación

Datos simulados de ejemplo.

En el ejemplo, lo que más pesa es la longitud de las sesiones. Tras empezar a cortarlas al cambiar de tarea, compare muestra el cambio.

Privacidad

  • Solo lectura: no escribe ningún fichero ni cambia tu configuración.
  • Sin red: ni telemetría, ni actualizaciones, ni llamadas a modelos.
  • Sin dependencias: solo la biblioteca estándar de Python. No lanza otros programas.
  • No muestra prompts, respuestas, código ni argumentos de comandos. Sí muestra nombres de proyectos, ficheros, herramientas y programas: revísalo antes de compartir un informe.
  • Las pruebas comprueban el código fuente: solo importa módulos permitidos y no contiene llamadas de escritura.

Requisitos

Python 3.9 o superior, en Windows, Linux o macOS. Sin dependencias.

Instalación

Con pipx (recomendado: lo instala aislado y crea el comando tasatokens):

pipx install git+https://github.com/GIPDOX/TasaTokens

O con pip: pip install git+https://github.com/GIPDOX/TasaTokens. Las dos formas necesitan tener git instalado.

Sin instalar nada: descarga el repo y, dentro de la carpeta, usa python -m tasatokens en lugar de tasatokens. En Windows sirve py -m tasatokens. Así funciona también en un servidor por SSH.

Uso

tasatokens                                   # informe de los últimos 30 días
tasatokens --days 60 --project ~/mi-proyecto
tasatokens compare --before 2026-11-20       # ¿mejoró algo desde que cambié X?
tasatokens compare --sessions abc123 def456  # misma tarea con y sin un cambio
tasatokens usage --by session                # consumo por sesión, día, proyecto o modelo
tasatokens --lang en                         # informe en inglés

El informe sale en español si tu sistema está en español y en inglés en cualquier otro caso; --lang es o --lang en lo fuerzan.

--project sirve para revisar las instrucciones (CLAUDE.md, AGENTS.md), los servidores MCP y las skills de ese proyecto. El análisis de consumo usa todas tus sesiones.

Para guardar el informe en un fichero: tasatokens > informe.txt.

Cómo calcula

  • Coste ponderado: cada tipo de token pesa como en los precios de la API (entrada 1, escritura en caché 1,25 a 5 min y 2 a 1 h, lectura de caché 0,1, salida 5). Con suscripción no se publica cómo pesa cada tipo en tu límite: úsalo para comparar, no como factura.
  • Lo que arrastra el contexto: cada salida de herramienta, cada fichero que escribe el agente y cada respuesta suya cuestan al entrar y otra vez en cada petición posterior, hasta el final de la sesión o hasta una compactación. TasaTokens cuenta cuántas peticiones arrastra cada cosa.
  • /clear: simula cortar la sesión al llegar a 100.000 y 150.000 tokens, añadiendo un resumen de 2.000 para continuar, y descuenta volver a escribir el inicio.
  • Herramientas instaladas: busca sus nombres en hooks, MCP, plugins, skills, barra de estado, proxy y en los propios registros. Si aparece, compara tus cifras antes y después de la primera vez que se usó.

Límites

  • Los techos son máximos teóricos y se solapan: no se suman ni están garantizados.
  • Antes y después no demuestra causa, porque cambian las tareas. Para una prueba de verdad, repite la misma tarea con y sin el cambio y usa compare --sessions.
  • No mide la calidad del resultado.
  • La parte de respuestas del agente es un máximo: no siempre se conserva el razonamiento de turnos anteriores.
  • Las herramientas que actúan por hook o proxy (RTK, Headroom) no dejan rastro de uso en los registros.
  • Los formatos de registro no son una interfaz estable y el catálogo envejece: revisa las fechas.
  • Las sesiones de Codex comprimidas (.zst) no se leen; se avisa.

Proyectos parecidos

Hay muchas herramientas para medir el consumo (ccusage, Codeburn, tokstat, Token Meter, TokenTracker…) y algunas que también aconsejan, como tokenomics, que busca patrones de uso que desperdician tokens. TasaTokens se centra en otra pregunta: si las herramientas de ahorro que tienes, o que piensas instalar, te compensan a ti, con un techo calculado para cada opción y sin instalar ni modificar nada.

Otros comandos

  • audit: revisión detallada de instrucciones, MCP, skills, salidas grandes, relecturas y ajustes de privacidad.
  • diagnose: estructura de tus registros, sin contenido. Útil para informar de un fallo de lectura.

Pruebas

python3 -m unittest discover -s tests

Usan datos simulados; nunca leen tus registros.


English

Do token-saving tools for Claude Code and Codex actually help you? Which one would?

TasaTokens reads your local Claude Code and Codex session logs and tells you, with your own numbers:

  • where your tokens go (carried context, agent replies, tool outputs, file reads…);
  • which of 20 known token-saving tools you have installed (RTK, Context Mode, Caveman, Serena, CodeGraph, Claude Mem…) and whether you actually use them;
  • what to change, ranked by impact, including habits and settings (/clear, /effort, subagents, a shorter CLAUDE.md, your own skills, unused MCP servers).

Each recommendation comes with a savings ceiling computed from your logs: the most it could save you.

Read-only, no network, no dependencies (Python 3.9+ standard library). It never shows prompts, replies, code or command arguments.

TasaTokens demo: report and comparison

Simulated example data.

pipx install git+https://github.com/GIPDOX/TasaTokens
tasatokens --lang en                          # report for the last 30 days
tasatokens --lang en --days 60 --project ~/my-project
tasatokens --lang en compare --before 2026-11-20

Without installing: inside the repo folder, use python -m tasatokens (py -m tasatokens on Windows). The report is in English unless your system is set to Spanish; --lang en forces it. Optional short rules for your CLAUDE.md: docs/rules.md.

Licencia / License

MIT. Ver THIRD_PARTY_NOTICES.md. En docs/analisis.md está el análisis de las 20 herramientas del catálogo, en docs/reglas.md unas reglas breves opcionales (inglés) y en docs/privacidad.md cómo reducir lo que Claude Code y Codex envían.

Metadata

Release files for tasatokens 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tasatokens 0.1.0
File Size Uploaded Provenance Actions
tasatokens-0.1.0.tar.gz 52.0 kB With provenance Details for tasatokens-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tasatokens 0.1.0
File Interpreter ABI Platform Actions
tasatokens-0.1.0-py3-none-any.whl Python 3 none any Details for tasatokens-0.1.0-py3-none-any.whl

Total release size: 100.4 kB

Release files / tasatokens-0.1.0.tar.gz

Download URL tasatokens-0.1.0.tar.gz
Size 52.0 kB
Tags Source
SHA-256 checksum
How to use checksums
ef5a8a40f2e245ba856023c52ff303a1829d1c08344863597ca28950160713e7
BLAKE2b-256 checksum
How to use checksums
65a9f9244f8914a9d6b2fbbf8532f18ca2882ec731e64948c7590fcce5b41d41
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Release files / tasatokens-0.1.0-py3-none-any.whl

Download URL tasatokens-0.1.0-py3-none-any.whl
Size 48.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c5ccc4cb3494fac4f617e164a633ad74c75c78716eb6c6fddf6f08bbdc32683a
BLAKE2b-256 checksum
How to use checksums
bf9ca904abaebb358f6795415baa39c0f4d1f222deb87824af08bfd009d61a81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Security for tasatokens 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for tasatokens-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page