commit 1e7eba0f5a3cbb24f22ae7f536871a3fc89fc459 Author: BigMarc Date: Fri Sep 4 23:02:54 2026 +0200 TokenGem 1.0.0 — public download repo README, changelog, and upstream license/attribution surfaces for the public distribution of TokenGem. DMG binaries ship via GitHub Releases. diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e43b0f9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..1ef604a --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,50 @@ +# Changelog + +All notable changes to TokenGem are documented here. Upstream tool version bumps are called out +explicitly, because they are the changes most likely to affect routing behaviour. + +## [1.0.0] — 2026-09-04 + +First public release. + +**The menu-bar app** +- Native macOS app (universal binary, macOS 13+): measured net cost-per-turn delta in the menu + bar, red when net-negative; panel with session-by-session sparkline against the baseline + median, the four deltas verbatim, profile switcher, component health, hook-conflict list, + Repair install, and Open Dashboard. +- Starts at login and launches silently; adopts a dashboard server you started yourself and + restarts one that dies. +- Upgrades from pre-rebrand builds migrate `~/.codegem` → `~/.tokengem` once, on first run. + A baseline cannot be recaptured, so it is never left behind. + +**The router** +- One `PreToolUse` hook per agent, owned by TokenGem. Per-command dispatch: Graphify's index when + fresh, RTK where an equivalent exists, pass-through otherwise — never double-processing. +- Three profiles: **Balanced** (default), **Maximum savings**, **Index-only**. Switching re-writes + the router in place; the ledger records which profile was active for every event. + +**The measurement engine** +- Mandatory baseline capture per agent from real session history before install — `install` + refuses to run without it. +- Continuous local ledger: command, routing path, raw vs. delivered output bytes, per-session + token and cost totals, net delta vs. baseline. +- Output-token watch: when compression provokes longer output, the dashboard says so and names + the profile to switch to. Net-negative results are never softened. +- Model pricing table for every provider TokenGem can measure, user-overridable via + `~/.tokengem/pricing.json`; unknown models are reported UNPRICED, never guessed. + +**Agents** +- Claude Code, Codex, Cursor, OpenCode, Copilot, Gemini CLI, Qwen Code — plus proxy mode for apps + that call a model API directly (requests forwarded untouched; only token counts recorded). + +**Upstream pins** (see `LICENSES/` and `upstream.json` in the source tree) +- RTK v0.48.0 (`fde0a8f`) · Apache-2.0 +- Ponytail v4.9.0 (`0a4dd63`) · MIT +- Graphify v0.9.53 (`33362d9`) · Apache-2.0 (pre-relicense contributions under MIT) + +**Known limitations** +- The binary is ad-hoc signed; Developer-ID notarization is pending, so first launch needs + right-click → Open. +- Node 20+ is required for the CLI/dashboard the app supervises. +- Per-tool dollar attribution is reported only where instrumentation supports it; Graphify and + Ponytail effects are not inventable and are not invented. diff --git a/LICENSES/graphify-LICENSE-Apache-2.0.txt b/LICENSES/graphify-LICENSE-Apache-2.0.txt new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/LICENSES/graphify-LICENSE-Apache-2.0.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/LICENSES/graphify-LICENSE-MIT.txt b/LICENSES/graphify-LICENSE-MIT.txt new file mode 100644 index 0000000..b1d9746 --- /dev/null +++ b/LICENSES/graphify-LICENSE-MIT.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Safi Shamsi + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/LICENSES/graphify-NOTICE.txt b/LICENSES/graphify-NOTICE.txt new file mode 100644 index 0000000..791bf88 --- /dev/null +++ b/LICENSES/graphify-NOTICE.txt @@ -0,0 +1,8 @@ +Graphify +Copyright 2026 Safi Shamsi and the Graphify contributors. + +This product is licensed under the Apache License, Version 2.0 (see LICENSE). + +Portions of this software were contributed under the MIT License prior to the +relicensing and remain available under those terms. The original MIT license +text is retained in LICENSE-MIT. diff --git a/LICENSES/ponytail-LICENSE-MIT.txt b/LICENSES/ponytail-LICENSE-MIT.txt new file mode 100644 index 0000000..715d483 --- /dev/null +++ b/LICENSES/ponytail-LICENSE-MIT.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 DietrichGebert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/LICENSES/rtk-LICENSE-Apache-2.0.txt b/LICENSES/rtk-LICENSE-Apache-2.0.txt new file mode 100644 index 0000000..0afaf4b --- /dev/null +++ b/LICENSES/rtk-LICENSE-Apache-2.0.txt @@ -0,0 +1,190 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + Copyright 2024 rtk-ai and rtk-ai Labs + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md new file mode 100644 index 0000000..2e8c166 --- /dev/null +++ b/README.md @@ -0,0 +1,197 @@ +
+ +# 💎 TokenGem + +### Your Claude Code token tools are arguing with each other. +### TokenGem makes them cooperate — and shows you what they actually saved. + +[![Latest release](https://img.shields.io/github/v/release/BigMarc/TokenGem?color=7c3aed&label=download&sort=semver)](https://github.com/BigMarc/TokenGem/releases/latest) +[![Downloads](https://img.shields.io/github/downloads/BigMarc/TokenGem/total?color=7c3aed)](https://github.com/BigMarc/TokenGem/releases) +[![macOS 13+](https://img.shields.io/badge/macOS-13%2B-black)](https://github.com/BigMarc/TokenGem/releases/latest) +[![Universal binary](https://img.shields.io/badge/Apple%20Silicon-%20%26%20Intel-blue)](https://github.com/BigMarc/TokenGem/releases/latest) +[![Price](https://img.shields.io/badge/price-%2459%20once-success)](#pricing--license-terms) + +**[⬇️ Download the latest DMG](https://github.com/BigMarc/TokenGem/releases/latest)** + +A 1.6 MB download. No installer, no account, no daemon phoning home. + +
+ +--- + +You already know context is what your Claude Code bill is made of. You may even run the +open-source tools that shrink it — **RTK** to compress shell output, **Ponytail** to keep the +agent's code minimal, **Graphify** to stop it re-grepping your repo. + +Here's the part nobody tells you: **installed side by side, they fight.** All three register a +`PreToolUse` hook on Bash. One rewrites `grep` into its own command, another intercepts the same +command and nudges toward its index, a third injects rules at session start. Run together, they +silently no-op, double-process, or undo each other's work — and your hooks keep *looking* installed. + +And even when they work: **savings are not additive.** RTK's own issue tracker documents a case +where the filter cut input tokens and *raised* total cost by 18% — because compressed output made +the agent ask more follow-up questions, and output tokens cost roughly **5× input** on every +current Claude model. + +TokenGem is the layer that fixes both problems, and it is the only one that *proves* which one it +fixed for you. + +## What TokenGem actually does + +| | | +|---|---| +| 🧭 **One hook instead of three** | TokenGem writes a *single* `PreToolUse` hook — its router. Each command is dispatched to exactly one owner: Graphify's index when it's fresh, RTK when there's an equivalent, untouched pass-through otherwise. Every event is recorded, so nothing double-processes silently. | +| 📦 **Pinned, isolated installs** | The three upstream tools are installed at audited, pinned versions into `~/.tokengem/runtime/` — never your global Python, npm, or Cargo environments. A bump ships only after TokenGem's regression suite passes. | +| 📊 **Ground-truth measurement** | Before anything changes, TokenGem reads your agent's own session records and freezes a baseline. Every session afterwards is measured against it: tokens in, tokens out, **net cost per assistant turn** — the number that survives session-length skew. | +| 🚨 **The net-negative alarm** | If compression is provoking more output than it saves, TokenGem says so — in red, in your menu bar — and names the profile to switch to. A tool that admits when it isn't helping is the one worth paying for. | +| 🗑️ **One-button exit** | `tokengem uninstall` restores your pre-install settings **byte for byte** and deletes the managed runtimes. Your machine is exactly as it was. | + +## We don't estimate your savings. We read them. + +Most tools in this category show you a percentage they computed once, on their machine, and +pinned to a README. TokenGem can't afford that honesty problem — it *sells* measurement, so it +measures: + +1. `tokengem baseline` — mandatory, before install. Reads your last 20 real sessions per agent and + freezes the median cost per turn. **Install refuses to run without it**, because a savings + figure with nothing to compare against is a marketing artifact, not a measurement. +2. Every routed command lands in a local ledger: raw output bytes, delivered bytes, which path + handled it, which profile was active. +3. The Savings view reports the **net delta against your baseline** — and attribution only where + the instrumentation supports it. Graphify redirects are counted, not invented; Ponytail's + effect is reported as an aggregate. **The three tools' savings are never summed**, because + they don't compose. + +What shows up in your menu bar is the measured verdict — cost per turn vs. your own baseline, +green or red. Not a projection. Your numbers, your machine, your proof. + +## The menu-bar app + +The DMG gives you the native Mac app: a gem in your menu bar showing the measured delta, a panel +with a session-by-session sparkline against your baseline median, profile switching (Balanced · +Maximum savings · Index-only), component health, hook-conflict detection, and one-click +**Repair install** for the day a Claude Code update breaks a hook — that day will come. + +Prefer the terminal? The same product is a CLI: + +```console +$ tokengem hosts # which agents are on this machine, and what TokenGem can do for each +$ tokengem doctor # pre-flight checks + every hook registration and who owns it +$ tokengem baseline # mandatory: capture your before-numbers (this one is deliberately slow) +$ tokengem install # snapshot → pinned runtimes → one router +$ tokengem dashboard # http://127.0.0.1:7801 — six views, bound to localhost only +``` + +## Works with the agents you already run + +Claude Code · Codex · Cursor · OpenCode · Copilot · Gemini CLI · Qwen Code — plus a local +**proxy mode** that meters any app calling a model API directly, forwarding requests untouched +and recording only token counts. Run `tokengem hosts` to see exactly what TokenGem can do for +each agent it finds: route and measure, or measure only. + +## What leaves your machine: nothing + +All measurement, every ledger entry, and your baseline stay on your Mac. The dashboard binds to +`127.0.0.1` only. The license is a signed key verified **locally** — activation works on a plane, +and a server outage can never take your tool away. Every data flow the three upstream tools *can* +open is listed in one settings view, with switches and a purge button. + +## Honest limits + +Every tool should publish these. TokenGem will not help much, and may not help at all, when: + +- **Your repos are small.** There's little context to shrink and little to index. +- **Your sessions are mostly reasoning**, not file-reading. Compressed `grep` output can't save + what never got read. +- **Your hooks are already hand-tuned.** `tokengem doctor` will show the collisions, but adopt- + or-replace is a decision you get to make — nothing is silently clobbered. +- **You want per-tool dollar attribution.** RTK's character reduction is measured; Graphify and + Ponytail are reported at the confidence the instrumentation actually supports. Where a number + would be invented, there is instead a blank — deliberately. + +One published data point so you can calibrate expectations: Ponytail's *own* benchmark reports +**80–94% less code and 42–75% less cost** across five single-shot code-generation tasks, 3 models, +10 runs per cell (median reported). That is their measurement, not yours — yours is what the +ledger is for. And the failure mode is real: the 18%-net-*increase* case above is why the +baseline exists. + +## Pricing & license terms + +**$59. Once.** + +- Perpetual licence to the version you bought — your key keeps working even if you never update. +- Signed key, **verified offline** on up to 3 devices; a dead laptop doesn't burn a seat. +- The DMG you download is the full product — nothing is crippled while you evaluate it. We'd + rather convince you than lock you out. +- Uninstall is one command and restores your machine exactly. If the product isn't for you, it + leaves no trace. + + +Questions about licensing → [open an issue](https://github.com/BigMarc/TokenGem/issues/new). + +## Install in 90 seconds + +1. **[Download TokenGem-1.0.0-macOS.dmg](https://github.com/BigMarc/TokenGem/releases/latest)** + (1.6 MB, universal — Apple Silicon and Intel) +2. Open the DMG and drag **TokenGem** to **Applications**. +3. First launch: right-click the app → **Open** → **Open** (one time only — the binary is + ad-hoc signed while Developer-ID notarization is pending, so macOS checks you meant it). + Requires **Node 20+** (`brew install node`) — the app will tell you if it can't find it. +4. The gem appears in your menu bar. Click it → **Open Dashboard** → follow the four-command + quick start. The baseline step is the slow one; it's slow because it's reading your real + history, and it only ever happens once. + +## FAQ + +**Why pay for open-source tools?** +You're not. The three upstream projects stay free, stay linked below, and stay unmodified — +TokenGem never forks them. What you're buying is the part that doesn't exist anywhere else: the +deconfliction router (nobody has published a correct merge order for these three hooks), the +baseline-and-ledger measurement engine, the rollback guarantee, and the version pins that stop an +upstream Tuesday from silently breaking your setup. + +**Is "buy once" real?** +Yes, with a noun: the licence is perpetual for the version you purchased. There is no subscription, +no telemetry-driven upsell, and no kill switch — verification is a local signature check. + +**Will it survive a Claude Code update?** +The hook survives most; when one doesn't, the dashboard shows zero routing events and the +**Repair install** button re-asserts it idempotently. Upstream tool versions are pinned and only +bump after regression tests pass. + +**How do I remove it completely?** +`tokengem uninstall`, then drag the app to the Trash. Settings snapshots in `~/.tokengem/backups/` +are restored byte for byte; your global Python/npm/Cargo environments were never touched. + +**Where do I report a bug or request an agent?** +[Issues](https://github.com/BigMarc/TokenGem/issues) — the changelog is public and each release +notes exactly what changed, including upstream version bumps. + +## Under the hood — and in our debt + +TokenGem orchestrates three open-source projects as managed, pinned dependencies. They are named +here on purpose: you'd find them in five minutes anyway, and you deserve to find them in five +*seconds* instead — after purchase, which is how chargebacks happen. + +| Project | What it does in TokenGem | Pinned | License | +|---|---|---|---| +| [RTK](https://github.com/rtk-ai/rtk) | Compresses shell command output before it enters context | v0.48.0 · `fde0a8f` | Apache-2.0 | +| [Ponytail](https://github.com/DietrichGebert/ponytail) | Injects a minimal-code ruleset so the agent writes less | v4.9.0 · `0a4dd63` | MIT | +| [Graphify](https://github.com/Graphify-Labs/graphify) | Builds a queryable repo knowledge graph so the agent stops re-grepping | v0.9.53 · `33362d9` | Apache-2.0 | + +Verbatim license texts live in [`LICENSES/`](LICENSES), full notices in +[`THIRD_PARTY_NOTICES.md`](THIRD_PARTY_NOTICES.md). We are grateful to the upstream authors and +claim no endorsement, partnership, or affiliation with them. TokenGem's router, measurement +engine, dashboard, and licensing are original work. + +--- + +
+ +**Stop guessing what your token tools saved. +[Download TokenGem](https://github.com/BigMarc/TokenGem/releases/latest) and read it.** + +
diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.md new file mode 100644 index 0000000..2a3c1c4 --- /dev/null +++ b/THIRD_PARTY_NOTICES.md @@ -0,0 +1,98 @@ +# Third-Party Notices + +TokenGem incorporates the open-source software listed below as **managed dependencies**. TokenGem does +not fork, vendor, or modify any of them; it installs pinned upstream releases into its own isolated +prefix and orchestrates them. + +TokenGem is an independent product. **It is not affiliated with, endorsed by, sponsored by, or +maintained by the authors of any project listed here.** All product and project names are the +property of their respective owners; no trademark rights are claimed or granted. + +Verbatim license texts ship alongside this file in `LICENSES/`. + +--- + +## rtk + +- Homepage: https://github.com/rtk-ai/rtk +- Author: Patrick Szymkowiak +- License: **Apache License 2.0** — `LICENSES/rtk-LICENSE-Apache-2.0.txt` +- Pinned: `v0.48.0` (`fde0a8f185945556f51718de0f4c430bb62b3df6`) + +``` +Copyright 2024 rtk-ai and rtk-ai Labs + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +``` + +This project distributes no NOTICE file, so none is reproduced. + +--- + +## ponytail + +- Homepage: https://github.com/DietrichGebert/ponytail +- Author: Dietrich Gebert +- License: **MIT** — `LICENSES/ponytail-LICENSE-MIT.txt` +- Pinned: `v4.9.0` (`0a4dd63ad4541f4f655c4108a295916f3c1d8fda`), npm `@dietrichgebert/ponytail@4.9.0` + +``` +MIT License + +Copyright (c) 2026 DietrichGebert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +``` + +--- + +## graphify + +- Homepage: https://github.com/Graphify-Labs/graphify +- Author: Safi Shamsi and the Graphify contributors +- License: **Apache License 2.0** — `LICENSES/graphify-LICENSE-Apache-2.0.txt` +- Also: **MIT** for contributions made before the relicense — `LICENSES/graphify-LICENSE-MIT.txt` +- Pinned: `v0.9.53` (`33362d969292b57eda82f3fbd9eb5f3f5bc9bbc2`), PyPI `graphifyy==0.9.53` + +Reproduced in full as required by Apache License 2.0 §4(d) — `LICENSES/graphify-NOTICE.txt`: + +``` +Graphify +Copyright 2026 Safi Shamsi and the Graphify contributors. + +This product is licensed under the Apache License, Version 2.0 (see LICENSE). + +Portions of this software were contributed under the MIT License prior to the +relicensing and remain available under those terms. The original MIT license +text is retained in LICENSE-MIT. +``` + +Graphify's own dependency closure (networkx, numpy, rapidfuzz, and the tree-sitter grammars) carries +its own BSD-3-Clause / MIT / Apache-2.0 notices, reproduced in the installed distributions under +`~/.tokengem/runtime/uv/`.