Generated banner for Tao Token Efficient Execution
Generated logo for Tao Token Efficient Execution

Tao Token Efficient Execution

NVIDIAOfficialCreated by NVIDIA Corporation

  • Skill
  • Workflow
  • Agent tooling
  • Apache-2.0
  • Medium risk
  • Has scripts

From the author

Token-efficient execution kit for repeated TAO agentic workflows. Compiles a skill into stage cards once (with a strong model), then executes them forever in fresh, small headless sessions coordinated by a bash driver — measured 67-91% token reduction and 3-5x lower peak context vs one long conversation. Use when a TAO workflow will be run repeatedly, when token cost matters, when the target model has a small context window, or on trigger phrases like "token efficient", "reduce token cost", "card pack", "stage cards", "run this workflow on a small model", "compile this skill into cards".
— the description by NVIDIA Corporation

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

The TAO Token-Efficient Execution kit optimizes agentic workflows by replacing long, context-heavy conversations with a series of fresh, stateless headless sessions. By compiling a skill into discrete 'stage cards' using a strong model, the system enables smaller, more cost-effective models to execute complex tasks reliably. State is maintained on disk rather than in chat history, significantly reducing token consumption and context window pressure. The kit includes a bash-based driver for orchestration, harness adapters for tool interception, and a structured contract for state management.

What it does

  • Compiles complex agentic workflows into a series of discrete, stateless stage cards.
  • Executes workflows using fresh agent sessions to minimize context window usage.
  • Maintains persistent state on disk through a defined contract, avoiding reliance on chat history.
  • Uses a bash driver to manage stage routing, job waiting, and error handling.
  • Provides harness adapters to record executed commands and guard against known failure modes.
  • Enables the use of smaller, more efficient models for executing pre-compiled workflows.

When to use it

  • When a specific agentic workflow needs to be run repeatedly.
  • When reducing token costs and context window usage is a priority.
  • When the target model has a limited context window.
  • When you need to ensure deterministic execution of a multi-stage process.
  • When you want to avoid the performance degradation associated with long, single-session conversations.

Advantages

  • Significant reduction in token consumption (measured 67-91% reduction).
  • Lower peak context requirements (3-5x reduction).
  • Improved reliability by using pre-compiled, verified stage cards.
  • Stateless execution prevents model drift and context-related errors.
  • Clear separation between the one-time compilation cost and the efficient execution phase.

Usage examples

“Compile this skill into cards for token-efficient execution.”
The agent reads the skill and workspace, then generates a set of stage cards and a driver configuration to enable stateless, low-token execution.
“Run this workflow on a small model using the card pack.”
The bash driver initiates the workflow, executing one stage card per session and managing state via on-disk contracts.

Install

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/nvidia/tao-token-efficient-execution/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip tao-token-efficient-execution.zip -d .agents/skills

Documentation by NVIDIA Corporation

TAO Token-Efficient Execution

Run a staged TAO workflow as a series of fresh headless agent sessions — one stage card per session — instead of one long conversation. State lives on disk, never in chat history, so no session ever rereads the run's past.

Measured on real workflows (same tasks, same outcomes, billed tokens):

WorkflowOne long conversationCard executionPeak context
DEFT AOI loop9.6M2.5M (-74%)242k → 59k
AutoML (VCN classify)5.8M0.5M (-91%)198k → 42k
HuggingFace finetune1.7M0.5M (-67%)119k → 42k

The mechanism: an agent API is stateless, so a long conversation resends its entire history with every message — by mid-run that is ~100k+ tokens of skill text, spec edits, and training logs reread on every tool call, of which the current step needs ~3k. Cards make each step's 3k explicit and drop the rest.

The three layers

  1. Core (harness-agnostic) — stage cards (markdown, env-var contract), a bash driver (stage routing + job waiting), and on-disk state contracts (references/CONTRACTS.md).

  2. Harness adapters (adapters/) — guard + recorder implemented per harness: hooks for Claude Code, extensions for Pi. Same logic, ~150 lines each. Guards block known dead ends before tokens are burned; the recorder appends executed commands to commands.log so later sessions reuse instead of re-derive.

  3. Card packs (per application skill) — compiled cards living next to the skill they were authored from, e.g. skills/applications/tao-run-deft-aoi/cards/ and skills/applications/tao-run-automl/cards/. Each pack ships its own driver.sh and README.md (version pin, required env, how to run).

Cards shrink the model's job; they don't remove it. The driver owns routing and waiting (deterministic), helper scripts own state commits (deterministic), and the model executes one pre-planned stage: run verbatim commands, read a gate table, decide pass/fail from real output, fill in the one dynamic value. If a stage ever becomes 100% deterministic, graduate it out of the card into the driver or a helper script.

Quick start — run a shipped card pack

# plugin installs export TAO_SKILL_BANK_PATH automatically; standalone users set it first:
export TAO_SKILL_BANK_PATH=/path/to/tao-skill-bank

# one-time: scaffold ~/.tao-kit/kit.env and check harness prerequisites
bash "$TAO_SKILL_BANK_PATH/skills/core/tao-token-efficient-execution/scripts/install.sh"

# edit ~/.tao-kit/kit.env: set WS (and VENV for the AutoML pack) and MODEL;
# export your provider's API key in your shell — never put it in kit.env.
# then launch a pack driver detached (leave stderr attached: config errors print immediately):
nohup bash "$TAO_SKILL_BANK_PATH/skills/applications/tao-run-automl/cards/driver.sh" > /dev/null &

# monitor
tail -f ~/.tao-kit/automl/driver.log

The driver waits while jobs run (activity-based, not process-based), fires one fresh session per stage, halts on committed errors (no auto-retry — an operator decides), and exits 0 only after verified completion. DEFT prepares its inference handoff and passes the completion audit; AutoML requires its DONE marker with no trailing failure. Round-cap exhaustion exits nonzero.

Starting a pack driver is side-effecting work: complete the tao-launch-workflow gate (platform, credentials, image, datasets, launch review) before launching it, exactly as for in-conversation execution. Pi guards are not an OS sandbox: use an isolated trusted worker, not a workstation containing unrelated credentials (see adapters/pi/README.md).

Quick start — author a pack for another workflow

One authoring session with a strong model compiles the skill into cards (measured: ~10 minutes, one-time cost; every later run executes them):

  1. Read references/authoring_prompt.md (the round-0 contract) and references/authoring_prompt_v2.md (rules distilled from measured small-model failures: one command per step, mechanical state gates, exact artifact paths, explicit termination, bounded self-repair).

  2. Fill in run parameters — everything concrete for the target machine. Whatever you leave out, execution sessions will burn tokens rediscovering.

  3. The authoring session reads the skill + inspects the workspace + writes cards into skills/applications/<skill>/cards/. It must NOT run the workflow.

  4. Copy a shipped pack's driver.sh and edit its three config points: the stage→card routing table, the working() predicate, and the paths block. (templates/driver.template.sh is the harness-portable skeleton.)

references/CARD_AUTHORING.md reconstructs a real authoring session play by play.

Model floor (measured, execute-side)

Authoring always needs a strong model. Execution was measured across sizes:

Model classCard executionNotes
Frontier (e.g. Claude)flawlessreference bar: 0 guard fires, clean labels
~400B MoEnear-flawlesscorrect results; a few guard saves
~35B MoEworkflow-dependentAutoML clean end-to-end; DEFT completed but with sloppy stage labels
~30B dense w/o tool disciplinebelow floorfabricated results, loops; guards catch but cannot fix

Raw-skill execution (no cards) did not complete honestly on ANY of the small models measured — aborts, protocol violations, or falsely declared success. Cards are what make small-model execution possible, not a minor optimization.

Report, don't patch: when an execution model fails a card, report it and stop (the driver's no-auto-retry halt enforces this). Never edit cards or state to cover a model's mistakes; only genuine card-authoring defects get fixed, explicitly.

Files

PathWhat
references/CONTRACTS.mdprogress log, STAGE_DONE, commands.log, env contract
references/authoring_prompt.md / _v2.mdcard compilation prompts
references/CARD_AUTHORING.mda real authoring session, annotated
templates/driver.template.shdriver skeleton (three config points)
templates/kit.env.templateper-host config (~/.tao-kit/kit.env)
adapters/pi/, adapters/claude-code/guard + recorder per harness
scripts/install.shprerequisite check + kit.env scaffold
scripts/analyze_usage.pyper-session token accounting from session JSONL
scripts/smoke_test.shno-GPU adapter test (guard, recorder, accounting)

Files

adapters/pi/README.md

Pi adapter (guard + recorder + NVIDIA provider)

TypeScript extensions for the Pi coding agent. Pack drivers load them with -e; requires Pi 0.85.1+ (credential-safe bash spawn hooks).

FileRole
guard.tsBlocks known dead ends BEFORE tokens burn: per-session tool-call budget (PI_KIT_TURN_BUDGET), near-duplicate-command loop breaker, no-fabricated-results check (a train "ok" commit requires Execution status: PASS in the real log), destructive-command safety net, and credential-access guards across bash/read/edit/write. Bash subprocesses receive only allowlisted non-secret environment variables, never provider keys or shell startup hooks. The tool-call budget includes file tools and aborts the turn on exhaustion.
recorder.tsAppends every substantive executed command to $RD/commands.log (guard-blocked calls excluded). Run dir comes from PI_KIT_RD, falling back to the newest PI_KIT_RUN_PREFIX* dir under $PI_KIT_WS/results. Extend the match list via PI_KIT_RECORD_PATTERNS — comma-separated regexes, so a pattern cannot itself contain a comma (e.g. {1,3} quantifiers are unrepresentable; use an unbounded form instead). Invalid fragments are logged and skipped, never fatal.
nvidia-provider.tsOptional nim/ provider for the NVIDIA Inference API: thinking disabled via chat-template kwargs with the :off model suffix, temperature pinned to 0 for tool-calling reliability. Export NVIDIA_INFERENCE_API_KEY. Not needed for anthropic/ models.

Security boundary

These guards are defense in depth, not an OS sandbox. Arbitrary shell programs and access to the Docker daemon can access host files indirectly. Run packs only on an isolated, trusted worker without unrelated credentials, with datasets staged and images authenticated/pulled during approved preflight. Do not run untrusted cards on a personal workstation. Credential-file guards resolve symlinks for read/edit/write; shell deny patterns catch common direct access but do not prove arbitrary shell programs safe.

Provider keys remain available to Pi itself; only its bash subprocess environment is filtered. New packs needing authenticated subprocesses require an explicitly designed credential channel, not a blanket environment passthrough.

Offline regression tests

Install @earendil-works/[email protected] into a disposable npm prefix, then run PI_TEST_RUNTIME=/that/prefix node --test scripts/tests/token_efficient_guard.test.mjs from the bank root with a clean environment. Driver tests run with python -m unittest discover -s scripts/tests -p test_token_efficient_execution.py. Mining tests run with python -m unittest discover -s skills/applications/tao-run-deft-aoi/tests -p test_card_mining.py and need pandas, pyarrow, and PyYAML. These tests use fixtures only; the separate smoke_test.sh calls a real model API.

Workflow-specific guards

guard.ts also carries three guards discovered on the DEFT AOI reference hardware (a cuDNN/sm_75 embedding crash, a disk-headroom check before training, a container CLI quirk). They are harmless elsewhere — each matches a specific command signature — and they double as the pattern to copy: one guard per quirk your first run discovers, with a reason that says why it is blocked and what to do instead.

Env contract

Set by pack drivers; set them yourself only when running sessions by hand: PI_KIT_TURN_BUDGET, PI_KIT_RD, PI_KIT_WS, PI_KIT_RUN_PREFIX, PI_KIT_RECORD_PATTERNS. For hand-run sessions the guard also honors bare RD/ITER and the recorder honors bare WS; the recorder deliberately trusts only PI_KIT_RD for the run dir (a bare-RD fallback could misfile records into a previous run's commands.log).

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Declares allowed tools, Needs an API key, Needs Python, Needs Node.js

The author says: Requires bash, jq, Python 3.10+, and a headless agent harness with tool interception (see adapters/ for supported versions). The shipped card packs additionally need docker and the prerequisites of their application skill.

Security

What our scanner noticed· Medium risk

  • Large base64-encoded blobs
  • References to credential files
  • Scripts that your agent may run

This skill includes scripts that your agent may run. Read them before you use it.

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Created by
NVIDIA Corporation
Publisher
NVIDIA (Official)
Source
NVIDIA/skills · skills/tao-token-efficient-execution · commit fce3cca
Licence
Apache License 2.0 (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE-APACHE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by NVIDIA Corporation or NVIDIA.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download tao-token-efficient-execution.zip