Skip to content
PluginStats

@tanstack/ai-code-mode weekly downloads statistics

By tanstack (52 listings) · npm · AI SDKs

Secure TypeScript Code Mode for TanStack AI agents to execute sandboxed tool orchestration programs.

View on npm Fresh · Oct 17, 2026

@tanstack/ai-code-mode has 42,338 recorded weekly downloads on npm, an increase of 52.6% over the past 30 days.

It ranks #595 of 2,251 tracked npm listings by weekly downloads.

Over 90 days, weekly downloads changed by +16.6%.

PluginStats has 543 daily observations since Apr 23, 2025; the latest is from Oct 17, 2026.

Weekly downloads
42,338
Official API · Oct 17, 2026
7-day growth
-19.0%
-10K weekly downloads
30-day growth
+52.6%
+14.6K weekly downloads
90-day growth
+16.6%
+6K weekly downloads
Rank
#595
Among tracked npm listings

About @tanstack/ai-code-mode

@tanstack/ai-code-mode

Code Mode for TanStack AI — let LLMs write and execute TypeScript in secure sandboxes with typed tool access.

Overview

Code Mode gives your AI agent an execute_typescript tool. Instead of one tool call per action, the LLM writes a small TypeScript program that orchestrates multiple tool calls with loops, conditionals, Promise.all, and data transformations — all running in an isolated sandbox.

Installation

You also need an isolate driver:

Quick Start

The LLM will generate code like:

API Reference

createCodeMode(config)

Creates both the execute_typescript tool and its matching system prompt. This is the recommended entry point.

Config:

• driver — An IsolateDriver (Node, QuickJS, QuickJS Bun, or Cloudflare) • tools — Array of ServerTool or ToolDefinition instances. Exposed as external_* functions in the sandbox • timeout — Execution timeout in ms (default: 30000) • memoryLimit — Memory limit in MB (default: 128, supported by the Node, QuickJS, and QuickJS Bun drivers) • getSnippetBindings — Optional async function returning dynamic bindings

createCodeModeTool(config) / createCodeModeSystemPrompt(config)

Lower-level functions if you need only the tool or only the prompt. createCodeMode calls both internally.

Advanced

These utilities are used internally and exported for custom pipelines:

• stripTypeScript(code) — Strips TypeScript syntax using sucrase (edge-safe, no native binary). • toolsToBindings(tools, prefix?) — Converts tools to ToolBinding records for sandbox injection. • generateTypeStubs(bindings, options?) — Generates TypeScript type declarations from tool bindings.

Driver Selection Guide

| Driver | Best For | Native Deps | Browser | Memory Limit |

| @tanstack/ai-isolate-node | Server-side Node.js apps | Yes (isolated-vm) | No | Yes | | @tanstack/ai-isolate-quickjs | Browser, edge, or no-native-dep environments | No (WASM) | Yes | Yes | | @tanstack/ai-isolate-quickjs-bun | Bun servers (native QuickJS via bun:ffi) | No | No | Yes | | @tanstack/ai-isolate-cloudflare | Cloudflare Workers deployments | No | N/A | N/A |

Custom Events

Code Mode emits custom events during execution that you can observe via the TanStack AI event system:

| Event | Description |

| code_mode:execution_started | Emitted when code execution begins | | code_mode:console | Emitted for each console.log/error/warn/info call | | code_mode:external_call | Emitted before each external_* function call | | code_mode:external_result | Emitted after a successful external_* call | | code_mode:external_error | Emitted when an external_* call fails |

Models eval (development)

The benchmark lives in a separate workspace package so @tanstack/ai-code-mode does not depend on @tanstack/ai-isolate-node (avoids an Nx build cycle). See models-eval/package.json (@tanstack/ai-code-mode-models-eval).

1. packages/ai-code-mode/models-eval/pull-models.sh — pull recommended Ollama models 2. pnpm --filter @tanstack/ai-code-mode-models-eval eval:capture — run models and capture raw outputs/telemetry only (no judge LLM call) 3. pnpm --filter @tanstack/ai-code-mode-models-eval eval:judge — judge latest captured session from logs (no model rerun) 4. pnpm --filter @tanstack/ai-code-mode-models-eval eval — single-pass run+judge (legacy convenience mode) 5. pnpm --filter @tanstack/ai-code-mode-models-eval eval -- --ollama-only — only Ollama models from eval-config.ts 6. pnpm --filter @tanstack/ai-code-mode-models-eval eval -- --ollama-only --models qwen3-coder — one or more model ids (comma-separated)

Judge-phase flags:

• --judge-latest judge latest captured session • --rejudge re-run judging even if logs already contain judge fields

The default list omits some small Ollama models that rarely complete code-mode successfully (see comments in eval-config.ts). You can still benchmark them with --models granite4:3b etc. if pulled locally.

Model comparison metrics

The models eval now tracks seven decision-oriented metrics plus an overall rating:

• accuracy (1-10): numerical/factual correctness vs gold report • comprehensiveness (1-10): whether the response covers everything requested by the user query • typescriptQuality (1-10): quality/readability/type-safety of generated TypeScript • codeModeEfficiency (1-10): how efficiently the model uses code-mode/tooling to reach the answer • speedTier (1-5): relative wall-clock speed against peers in the same category (local or cloud) • tokenEfficiencyTier (1-5): relative token efficiency against peers in the same category • stabilityTier (1-5): success consistency over the latest 5 logged runs for that model • stars (1-3): weighted rollup score across all metrics

Raw run telemetry also includes compile/runtime failures, redundant schema checks, total tool calls, TTFT, token totals, stability sample size/rate, and per-model logs.

Methodology

Canonical output is written to packages/ai-code-mode/models-eval/results.json after each capture or judge run.

• Benchmark: single code-mode benchmark prompt over the in-memory customers / products / purchases dataset • Primary quality scores (judge): accuracy, comprehensiveness, typescriptQuality, codeModeEfficiency • Computed comparative scores: speedTier, tokenEfficiencyTier, stabilityTier • Stability definition: a run is "stable" if it has no top-level run error, produces a non-empty candidate report, and has at least one successful execute_typescript call • Star rollup weights: • accuracy: 25% • comprehensiveness: 15% • typescriptQuality: 15% • codeModeEfficiency (with compile/runtime failure penalty): 10% • speedTier: 10% • tokenEfficiencyTier: 10% • stabilityTier: 15%

Model comparison table

The table below is transcribed from canonical models-eval/results.json (session 2026-03-26T15:38:44.006Z).

| Provider | Model | Category | Stars | Accuracy | Comprehensiveness | TypeScript | Code-Mode | Speed Tier | Token Tier | Stability Tier |…

Description from the npm listing.

  • ai
  • ai-sdk
  • typescript
  • tanstack
  • code-mode
  • agents
  • llm
  • tool-calling
  • sandbox
  • isolate
  • code-execution
  • tanstack-intent

Where @tanstack/ai-code-mode sits in the listing

Each band is one page of 20. Weekly downloads on a log scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

All npm2,248 listings · 113 pages · page 30, #15 (overall #595)
All npm: every listing in weekly downloads order
PNG SVG
AI SDKs249 listings · 13 pages · page 2, #11 (overall #31)
AI SDKs: every listing in weekly downloads order
PNG SVG

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

@tanstack/ai-code-mode weekly downloads on npm, last 90 days: 42,338 weekly downloads as of Oct 17, 2026, +16.6% over 90 days.@tanstack/ai-code-modeWeekly downloads on npm · Last 90 days42,338downloads / week+16.6% over 90 days020K40K60K80K100KJul 19Aug 3Aug 18Sep 2Sep 17Oct 2Oct 17downloads / weekobservedarchived (Internet Archive)no observationsJul 21, 2026 – Oct 17, 2026 · 89 observations · Updated Oc…pluginstats.com
@tanstack/ai-code-mode weekly downloads on npm, last 90 days: 42,338 weekly downloads as of Oct 17, 2026, +16.6% over 90 days.
PNG SVG

7/30/90-day growth

@tanstack/ai-code-mode weekly downloads growth on npm: -19.0% over 7 days, +52.6% over 30 days, +16.6% over 90 days.@tanstack/ai-code-modeWeekly downloads growth on npm42,338downloads / week now7-day growth-9,953 weekly downloads-19.0%30-day growth+14,589 weekly downloads+52.6%90-day growth+6,020 weekly downloads+16.6%Growth vs. nearest observation to each baseline date · Updated Oct 17, 2026pluginstats.com
@tanstack/ai-code-mode weekly downloads growth on npm: -19.0% over 7 days, +52.6% over 30 days, +16.6% over 90 days.
PNG SVG

Ranking history

@tanstack/ai-code-mode npm ranking history: currently #595 (by weekly downloads).@tanstack/ai-code-modenpm ranking · by weekly downloads · Last 90 days#595current rank#200#300#400#500#600Jul 20Aug 4Aug 19Sep 3Sep 18Oct 3Oct 18rankOct 17, 2026 – Oct 18, 2026 · 2 observations · Updated Oct 17, 2026pluginstats.com
@tanstack/ai-code-mode npm ranking history: currently #595 (by weekly downloads).
PNG SVG

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Recent observations

Full history (543)
Recent weekly downloads observations for @tanstack/ai-code-mode
Date (UTC)Weekly downloadsChange vs. previous
42,338-3.8K
46,171+4.2K
42,015-10.5K
52,538-6.6K
59,0910
59,091+7.9K
51,195-1.1K
52,291-5.6K
57,923-6.4K
64,330-3.6K
67,912-5K
72,928-9.2K
82,110+1.5K
80,640—

Similar npm AI SDKs plugins

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/@tanstack/ai-code-mode. First seen Oct 16, 2026; last successful collection Oct 18, 2026. See the methodology.