Skip to main content
Agent skill

Install Tokenless

Install and configure Tokenless (LLM token optimization toolkit) on Linux or macOS. Use when the user asks to install Tokenless, set up token optimization, reduce LLM token usage, or enable Tokenless for an agent framework (cosh, OpenClaw, Hermes, Qoder, Claude Code, Codex, Qwen Code).

Get started

Get the complete skill folder, including its scripts and reference files.

When to use this skill

Use Install Tokenless when an AI agent needs a reusable SKILL.md workflow for this job: Install and configure Tokenless (LLM token optimization toolkit) on Linux or macOS. Use when the user asks to install Tokenless, set up token optimization, reduce LLM token usage, or enable Tokenless for an agent framework (cosh, OpenClaw, Hermes, Qoder, Claude Code, Codex, Qwen Code).

When not to use it

Skip Install Tokenless when the task is outside the coding category, or when a more specific skill in this directory already covers the same workflow with clearer triggers.

How to install

Where will you use it?

Install scope
Claude Code folder setup
mkdir -p ~/.claude/skills/install-tokenless
# Save SKILL.md to ~/.claude/skills/install-tokenless/SKILL.md
  1. Claude Code personal install: place the skill and its bundled files at ~/.claude/skills/install-tokenless/SKILL.md. For a shared project, commit the folder at .claude/skills/install-tokenless/ instead.
  2. Current Claude Code detects SKILL.md changes in watched directories during the session. If you just created a top-level skills directory, run /reload-skills. Check that the skill is listed before testing its trigger.
  3. For Claude chat or Cowork in the Desktop app, manage uploaded skills in Customize > Skills; copying files into a local Claude Code folder is not a Desktop install. Other agents may use different install locations.

Full install guide for Claude, Cursor, and Codex →

Try a starter prompt

After installing the skill, paste this starter prompt into your agent to verify it triggers on a small task.

Starter prompt
Use the Install Tokenless skill for this task: Use Install Tokenless when this documented workflow matches the task. Confirm any required inputs or files before making changes.

What supports this recommendation?

71/100 provisional content score. This measures documentation, practical detail and source signals. It is not a measured task success rate or a security certification.

Documentation
77/100
Practical detail
68/100
Source evidence
63/100
Source signals
72/100
Model compatibility evidence
  • claudeinferred

    The skill text mentions Claude or a closely associated term. This is keyword-derived compatibility; no hands-on model test is recorded.

  • chatgptinferred

    The skill uses model-agnostic prompt or LLM terminology. Portability is inferred and has not been verified on this model.

  • geminiinferred

    The skill uses model-agnostic prompt or LLM terminology. Portability is inferred and has not been verified on this model.

  • copilotinferred

    The skill text mentions Copilot or a closely associated term. This is keyword-derived compatibility; no hands-on model test is recorded.

  • llamainferred

    The skill uses model-agnostic prompt or LLM terminology. Portability is inferred and has not been verified on this model.

  • perplexityinferred

    The skill uses model-agnostic prompt or LLM terminology. Portability is inferred and has not been verified on this model.

  • mistralinferred

    The skill uses model-agnostic prompt or LLM terminology. Portability is inferred and has not been verified on this model.

  • grokinferred

    The skill uses model-agnostic prompt or LLM terminology. Portability is inferred and has not been verified on this model.

Inferred compatibility is based on content signals. Check the app, its available tools and setup requirements before running a skill.

What this skill does

# Install Tokenless

Tokenless is the token optimization component of ANOLISA. It compresses tool schemas, API responses, and CLI output to reduce LLM token consumption — without changing prompts or agent behavior.

## System Requirements

- **OS**: Linux or macOS. This Skill's Bash workflow requires WSL2 on Windows; native Windows x64 npm installation is documented in the Tokenless user guide. - **Architecture**: x86_64 or arm64 - **Network**: Internet access required - **Shell**: Bash

Per-method prerequisites:

| Method | Requires | Installs | |--------|----------|----------| | A — anolisa CLI | `curl` | full component suite including adapters | | B — npm | Node.js 16.7+ with `npm`, glibc Linux or macOS | `tokenless` (0.9.2 and earlier: also `rtk`), adapter resources | | C — curl | `curl`, `tar`, plus Node.js 16.7+ **or** a Rust toolchain (`cargo`; after 0.9.2 also `git` and `patch`), depending on the path taken | npm path: as Method B. Source-build path (Linux only): the `tokenless` CLI only | | D — Skill | whichever of A/B/C the agent runs | as that method |

The package postinstall enables the `claude-code` adapter by running that adapter's own `install.sh`, which registers the plugin with the Claude CLI when one is reachable; with no Claude CLI it skips registration and says so. That registration lives in Claude's own configuration, outside both the npm prefix and the adapter directory, so deregister it with the adapter's `uninstall.sh` (or `scripts/uninstall.sh`) rather than by deleting the package.

The source-build path is validated on Linux only, and the installer refuses it on macOS: there it either takes the npm path or exits with an error, and never runs `cargo`. On musl Linux (Alpine) the source build is the only available path, because prebuilt binaries are glibc-linked.

## Installation Workflow

Copy this checklist and track progress:

``` Task Progress: - [ ] Step 1: Install Tokenless CLI - [ ] Step 2: Verify installation - [ ] Step 3: Enable for an agent framework (optional) - [ ] Step 4: Test compression ```

### Step 1: Install Tokenless CLI

Try these methods **in order**. Move to the next only if the previous one fails.

**Method A: anolisa CLI (Recommended)**

```bash curl -fsSL https://get.agentic-os.sh | bash anolisa install tokenless ```

This installs the full ANOLISA component suite including adapters.

On Alinux with the YUM repository configured, the managed RPM is the alternative to this method, and the documented install priority puts it ahead of every route below:

```bash sudo yum install anolisa tokenless sudo anolisa --install-mode system adopt tokenless ```

`adopt` records the directly installed RPM in system state so the adapter commands can use its component contract. Methods B–D create no anolisa component record, so prefer Method A or the RPM route whenever either is available.

**Method B: npm Global Install**

Requires Node.js 16.7+ — the release `fs.cpSync` arrived in, which the package postinstall needs to place the adapter resources. Installs prebuilt binaries for your platform:

```bash npm install -g anolisa-tokenless ```

This automatically installs the `tokenless` binary plus the framework adapter resources. How RTK, the command rewriter, is installed depends on the release that npm resolves; check it with `tokenless --version`:

- **0.9.2 and earlier:** a separate `rtk` binary is installed next to `tokenless`, which has no `rtk` subcommand. - **Releases after 0.9.2:** RTK is linked into `tokenless` and runs as `tokenless rtk`; no `rtk` binary is installed.

(`toon` is no longer a standalone binary — TOON encoding is a `tokenless` subcommand.)

The adapter resources land in `~/.local/share/anolisa/adapters/tokenless`, which is shared with the anolisa CLI. Ownership there has to be **proven**, not assumed: the postinstall only refreshes a tree carrying the marker (`.tokenless-owner`) that this package or the standalone curl installer wrote. Anything else is kept unchanged and reported — a managed anolisa component install, a tree left by a release from before the marker existed, or a directory somebody copied by hand — because nothing about its content says who put it there, and every framework registration pointing into it would dangle otherwise. The copy this package ships stays available inside the package under `adapters/tokenless`; pass `ANOLISA_TOKENLESS_FORCE_ADAPTERS=1` to take the directory over anyway.

The npm package declares `os: win32, linux, darwin`; prebuilt Linux packages require glibc. Intel macOS (x86_64) uses the published `@anolisa/tokenless-darwin-x64` package. Method A does not cover Intel macOS; use Method B or Method C's npm path there. Do not pass `TOKENLESS_FORCE_BUILD=1` on macOS — the installer refuses the source build on that platform and exits with an error instead of running `cargo`. Native Windows x64 can use npm directly, but the remaining Bash commands in this Skill require WSL2.

**Method C: Standalone curl Install**

One-liner that tries npm first and builds from source instead. The method is chosen **before** npm runs (npm unavailable, musl Linux, or `TOKENLESS_FORCE_BUILD=1`). Once `npm install` has been invoked the installer does not switch method automatically — npm's exit status cannot prove its postinstall left no framework registration behind — so a failure at that stage is reported as an incomplete installation, keeping and naming whatever could not be rolled back. Re-run it, or choose the source build explicitly with `TOKENLESS_FORCE_BUILD=1`:

```bash curl -fsSL https://raw.githubusercontent.com/alibaba/anolisa/main/src/tokenless/scripts/install.sh | bash ```

Options via environment variables. Pass them to `bash`, not to `curl`, otherwise the installer never sees them:

```bash # Pin a specific version curl -fsSL https://raw.githubusercontent.com/alibaba/anolisa/main/src/tokenless/scripts/install.sh | TOKENLESS_VERSION=0.7.4 bash

# Custom install directory curl -fsSL https://raw.githubusercontent.com/alibaba/anolisa/main/src/tokenless/scripts/install.sh | TOKENLESS_INSTALL_DIR=/usr/local/bin bash

# Force the source build even when npm is available (needs cargo, and after 0.9.2 git and patch; Linux only) curl -fsSL https://raw.githubusercontent.com/alibaba/anolisa/main/src/tokenless/scripts/install.sh | TOKENLESS_FORCE_BUILD=1 bash ```

A pinned version is a hard pin: the source build downloads only the matching `tokenless/v<VERSION>` tag, and fails if that tag does not exist. It never falls back to the `main` branch.

The source-build path installs the `tokenless` CLI only, with no adapter resources. Treat it as a CLI-only install (see Step 3). It runs on Linux only. Without `TOKENLESS_VERSION` it builds the version npm reports as latest.

Whether RTK is part of that build depends on the tag:

- **Releases after 0.9.2** link RTK into `tokenless`. Before building, the installer fetches the pinned RTK source with `git` and `patch` and stops if either is missing. - **0.9.2 and earlier**, such as the 0.7.4 example above, build without RTK and need neither tool.

The installer records every path it created in `~/.local/share/tokenless/install-receipt`, which the uninstall step below relies on.

### Step 2: Verify Installation

```bash tokenless --version ```

If `command not found`, ensure the install directory is in PATH:

```bash export PATH="$HOME/.local/bin:$PATH" ```

### Step 3: Enable for an Agent Framework (Optional)

Pick the enable path that matches how Step 1 installed Tokenless. Installation only places files on disk; it never registers Tokenless with an agent.

**Installed via Method A (anolisa CLI)** — the component is recorded, so use the adapter commands:

```bash anolisa adapter scan anolisa adapter enable tokenless <agent> anolisa adapter status tokenless ```

**Installed via Method B, or via Method C's npm path** — the package postinstall copied the adapters to `~/.local/share/anolisa/adapters/tokenless/`, but there is **no anolisa component record**, so `anolisa adapter enable` is not available. Run the framework's bundled script instead:

```bash ls ~/.local/share/anolisa/adapters/tokenless/ # confirm the directory exists bash ~/.local/share/anolisa/adapters/tokenless/claude-code/scripts/install.sh ```

**Installed via Method C's source-build path** — CLI-only. No adapter resources were installed, so no adapter can be enabled. Use the `tokenless` subcommands directly, or reinstall through Method A or B for agent integration.

> **Note:** The script paths below are examples for npm-installed adapters. Not all frameworks ship a standalone install script, and directory names may differ. Always check `ls ~/.local/share/anolisa/adapters/tokenless/` first. For anolisa CLI installs, `anolisa adapter enable tokenless <framework>` is the recommended path.

| Agent | anolisa CLI install | npm-based install | |-------|---------------------|-------------------| | cosh / Copilot Shell | `anolisa adapter enable tokenless cosh` | no bundled script — cosh integrates through the ANOLISA cosh extension, so use the anolisa CLI path | | OpenClaw | `anolisa adapter enable tokenless openclaw` | `bash ~/.local/share/anolisa/adapters/tokenless/openclaw/scripts/install.sh` | | Hermes | `anolisa adapter enable tokenless hermes` | `bash ~/.local/share/anolisa/adapters/tokenless/hermes/scripts/install.sh` | | Qoder | `anolisa adapter enable tokenless qoder` | `bash ~/.local/share/anolisa/adapters/tokenless/qoder/scripts/install.sh` | | Claude Code | `anolisa adapter enable tokenless claude-code` | `bash ~/.local/share/anolisa/adapters/tokenless/claude-code/scripts/install.sh` | | Codex | `anolisa adapter enable tokenless codex` | `bash ~/.local/share/anolisa/adapters/tokenless/codex/scripts/install.sh` | | Qwen Code | `anolisa adapter enable tokenless qwencode` | `bash ~/.local/share/anolisa/adapters/tokenless/qwencode/scripts/install.sh` |

Each bundled adapter also ships a matching `scripts/uninstall.sh` next to its `install.sh`; use it to disable that framework again. Run it **before** removing the adapter resources — a registration points into that directory, so deleting the directory first leaves the framework hooked, plugged or symlinked to a path that no longer exists. The [Uninstall](#uninstall) section gives the full order per install method.

Restart the agent CLI, IDE, or gateway after enabling.

### Step 4: Test Compression

```bash printf '%s\n' \ '{"status":"ok","data":{"name":"demo","items":[1,2,3]},"debug":{"trace":"verbose"},"metadata":null}' \ | tokenless compress-response ```

If the output is shorter than the input (debug/metadata fields removed), Tokenless is working.

Check savings after using an agent:

```bash tokenless stats list --limit 5 tokenless stats summary ```

## Troubleshooting

| Symptom | Fix | |---------|-----| | `command not found: tokenless` | Add install dir to PATH: `export PATH="$HOME/.local/bin:$PATH"` | | npm install fails with EACCES | Fix npm prefix: `mkdir -p ~/.npm-global && npm config set prefix '~/.npm-global'` | | `GLIBC_xxx not found` | Linux binaries require glibc 2.17+. Update: `sudo dnf update glibc` | | No stats after enabling | Content may not have passed through Tokenless or had no compressible fields | | musl Linux (Alpine) | Prebuilt binaries not available; build from source |

## Uninstall

Uninstall must match how Tokenless was installed, and must only remove files that installation created. Do not run a blanket `rm` across `~/.local/bin` or the adapter tree — those paths may belong to another method.

**anolisa CLI installation (Method A):** ```bash anolisa uninstall tokenless ```

**Standalone curl installation (Method C):** the installer recorded its method, npm prefix, install directory, and every file it created in `~/.local/share/tokenless/install-receipt`. Remove exactly those:

```bash curl -fsSL https://raw.githubusercontent.com/alibaba/anolisa/main/src/tokenless/scripts/uninstall.sh | bash

# Preview first, or also delete the runtime data directory: # ... | bash -s -- --dry-run # ... | bash -s -- --purge ```

The receipt-driven uninstaller removes the recorded binaries from the recorded install directory (including a custom `TOKENLESS_INSTALL_DIR`), uninstalls the global npm package from the recorded prefix when the npm path was used, removes the adapter directory only when that npm run created it, strips only the PATH line the installer appended, and leaves `~/.tokenless` (stats and stash data) in place unless `--purge` is passed. A source-build install recorded no adapters, so none are removed.

`~/.local/share/anolisa/adapters/tokenless` is shared with the anolisa CLI and with a direct `npm install -g`. When that directory already belonged to another installation, the npm postinstall leaves it untouched, the curl installer compares it against the snapshot it took beforehand and only restores it if something really did replace it, does not record the directory, and says so — the receipt then owns only the launcher links, and this uninstaller leaves the shared resources and their framework registrations alone. A snapshot that cannot be taken at all stops the run before `npm install -g` replaces anything.

Each recorded file also carries its sha256, and the adapter directory carries the digest of its stamped `manifest.json`. A path whose content no longer matches was taken over by another installer (anolisa, a manual `npm install -g`) and is kept. Before deleting the adapter directory the uninstaller runs each bundled framework's own `scripts/uninstall.sh`, so an enabled framework registration is removed rather than left pointing at a deleted directory. If one of them fails, the uninstaller **stops short**: the adapter resources and the receipt are both kept and it exits non-zero, so the registration still resolves and the script the warning names still exists. Fix that framework and re-run to finish.

Content alone is not proof of ownership — a newer anolisa or npm install of the same version leaves byte-identical binaries and manifests behind. So the receipt also records this install's id, the link target each launcher resolves to, and an ownership marker (`.tokenless-owner`) inside the adapter tree and the npm module directory. A path whose recorded identity or marker no longer matches belongs to that newer install and is kept, including its framework registrations and its npm package.

Re-running the installer with a different method retires the previous receipt, so switching npm → source does not orphan a launcher link, the npm global package or the adapter tree — but only once the replacement is verified. The previous install is moved aside first and put back if the new one fails, so a missing tag, a build error or an unwritable directory leaves the working install and its receipt exactly as they were. That guarantee is fail-closed: if the copy aside cannot be made at all — no staging directory, or a recorded file that cannot be read — the installer stops before writing anything instead of replacing an install it could not put back. An npm → npm upgrade keeps a copy of the previous package payload for the same reason: the launcher links resolve into it, so a broken new binary is rolled back instead of being left behind a working-looking link. The new receipt is written to a temporary, moved into place and flushed before anything is retired; when it cannot be written and the previous receipt cannot be removed either, the run fails and restores the previous install, because a stale receipt would let a later uninstall delete the new one. Where the previous npm prefix and the install directory overlap (`--prefix ~/.local` with `~/.local/bin`), that package is retired by hand instead of through `npm uninstall`, which would otherwise take the freshly installed CLI with it. A failed npm attempt is rolled back the same way, so the source-build fallback never inherits an unowned package, launcher link or adapter tree.

**Direct npm installation (Method B), not through the curl script:** no receipt exists, so undo the three things the install did, in this order. Deregister the frameworks enabled in Step 3 **first**, while their resources are still on disk — otherwise every hook entry, plugin directory and symlink keeps pointing at a directory that no longer exists:

```bash # 1. Once per framework enabled in Step 3 (claude-code, codex, hermes, openclaw, # opencode, qoder, qwencode, qwenpaw). bash ~/.local/share/anolisa/adapters/tokenless/<framework>/scripts/uninstall.sh

# 2. Remove the global package. npm uninstall -g anolisa-tokenless

# 3. Remove the adapter resources the package postinstall created. rm -rf ~/.local/share/anolisa/adapters/tokenless ```

The uninstaller stops short rather than half-finishing, and exits non-zero when it does: a framework registration it could not remove keeps the adapter resources and the receipt, and a global npm package it could not remove (no npm on PATH) keeps the package, that prefix's launcher links and the receipt. Fix the cause and re-run — the receipt is what makes the retry possible.

This is the order the receipt-driven uninstaller uses internally, and the order the Tokenless troubleshooting page prescribes for an npm installation. Step 3 also removes the resources a Method C npm install writes, so skip it when another Tokenless installation on this machine still needs them — and skip it whenever the postinstall reported that it kept a managed adapter tree, because that directory was never this npm install's to delete.

If the receipt is missing (for example after a manual cleanup), the uninstaller exits with an error rather than guessing; remove `<install-dir>/tokenless` (and `<install-dir>/rtk`, left by releases that shipped it separately) yourself, using the directory you actually installed into.

Intended uses

  • Use Install Tokenless when this documented workflow matches the task.

Implementation notes

  • Review the source instructions and adapt inputs before running the workflow.

Try it, then tell us how it went

A copied prompt does not tell us whether the task worked. Report your result after checking the output. We collect your tool and outcome, never your files or prompt.