OnlineFreeTools.org
  • Home
  • Image editing tools
    • Add Text Watermark to Photo — Local Browser Tool
    • Extract Colors from Image — Palette & Click Pick
    • Flip Image — Mirror Horizontally or Vertically
    • Add Border to Image — Color & Width Online
    • Image Compressor — Resize, Quality & Target Size Local
    • Crop & Resize Image — Local Aspect Presets
    • Photo EXIF Viewer & Remover — GPS, Camera & Local Strip
    • Image Format Converter — PNG JPEG WebP AVIF BMP GIF ICO SVG
    • Convert Image to Grayscale — Black & White Online
    • Merge Images — Combine Photos into One Collage
    • Image Optimizer — WebP, AVIF & MozJPEG Local
    • Overlay Images — Put a Logo on a Photo
    • Image to Base64 Converter — Encode & Decode Locally
    • Images to GIF — Make an Animated GIF Locally
    • Images to PDF — Combine Photos into One File
    • Images to PowerPoint — Photos to PPTX Slides
    • Images to Word — Build a DOCX from Photos
    • PDF Page to Image Sizes — Multi-Size Export Pack
    • PDF to JPG — Convert Pages to Images in Your Browser
  • Design tools
    • Generate Brand Color Scale — 50–950 Palette & CSS Tokens
    • Brand Style Guide — Generate a Modular Draft You Can Edit
    • Smart Website Color Scheme — Semantic CSS Tokens
    • WCAG Contrast Checker — AA/AAA Ratio Online
  • PDF tools
    • Compress PDF — Shrink File Size in Your Browser
    • Crop PDF — Trim Page Margins in Your Browser
    • Merge PDF — Combine Files in Your Browser
    • Organize PDF — Reorder or Remove Pages in Your Browser
    • Add Page Numbers to PDF — In Your Browser
    • PDF to Markdown — Extract Text for Notes in Your Browser
    • PDF Watermark — Stamp Text on Every Page in Your Browser
    • Protect PDF — Password-Encrypt in Your Browser
    • Rotate PDF — Fix Page Orientation in Your Browser
    • Split PDF — Extract Pages Locally
    • Unlock PDF — Remove Password You Already Know
  • Developer
    • Add WWW to DNS — A/CNAME, Apex Rules & Provider Guides
    • Archive Extractor Online — Open Compressed Files in Your Browser
    • Base64 Encode & Decode — Convert Text in Your Browser
    • Core Web Vitals Checker
    • CSV ↔ JSON Converter — Types, Delimiters & Local
    • Domain Lookup — Check DNS Records & Registration Online
    • File Hash Checker — Verify Digests in Your Browser
    • Hreflang Generator
    • HTML Entity Encoder & Decoder — Escape, Unescape & Local
    • IndexNow — Bing URL Submit, Key Check & Status Codes
    • What Is My IP Address — See Your Public IP (IPv4 or IPv6)
    • JSON Schema Validator — Draft-07 Paths & Local
    • JWT Decoder — Read Header & Payload Locally (No Verify)
    • Magnet Link Decoder — Parse Info Hash and Trackers Locally
    • Markdown ↔ HTML
    • Google SERP Preview
    • Meta Tag Generator
    • On-Page SEO Checker
    • Open Graph Preview
    • Random Password Generator — Create Passwords Locally
    • Robots.txt Generator
    • JSON-LD Schema Generator
    • XML Sitemap Generator
    • Compare Two Texts Online — Text Diff Checker
    • Time Zone Converter — Compare One Moment Worldwide
    • Unix Timestamp Converter — Epoch ↔ Readable Time
    • Unzip File Online — Extract ZIP Files in Your Browser
    • UTM Builder
    • UUID & ULID Generator — Create IDs in Your Browser
    • Check HTTP Response Headers
    • YAML ↔ JSON Converter — Types, Multi-doc & Local
  • Calculators
    • Acceleration Calculator — Change in Velocity
    • Age Calculator — Chronological Age from Birthdate
    • Aspect Ratio Calculator — How to Calculate and Scale Ratios
    • BMI Calculator — How to Calculate Body Mass Index
    • BMR & TDEE Calculator — How to Calculate Daily Calories
    • Body Fat Calculator — How to Estimate Body Fat Percentage
    • Break-Even Calculator — How to Calculate Break-Even Point
    • CAGR Calculator — How to Calculate Compound Annual Growth Rate
    • Circle Calculator — Area and Circumference
    • Compound Interest Calculator — How to Calculate Future Value
    • Concrete Calculator — How to Estimate Concrete Volume
    • Confidence Interval Calculator — How to Calculate a CI
    • Contribution Margin Calculator — Price Minus Variable Cost
    • Date Difference Calculator — Days and Weeks
    • Debt Payoff Calculator — Months to Clear a Balance
    • Density Calculator — Mass over Volume
    • Discount Calculator — How to Calculate Sale Price
    • EMI Calculator — How to Calculate Loan Payments
    • Exponent Calculator — How to Calculate Powers
    • GPA Calculator — How to Calculate Weighted GPA
    • Gradient Calculator — Multivariable ∇f (Partial Derivatives)
    • Gross Margin Calculator — How to Calculate Gross Margin
    • Heart Rate Zone Calculator
    • Ideal Weight Calculator — How to Estimate Ideal Body Weight
    • Inflation Calculator — Future Purchasing Power
    • IRR Calculator — Internal Rate of Return
    • Logarithm Calculator — How to Calculate Logs
    • Macro Calculator — Calories to Protein Carb Fat Grams
    • How to Calculate Marginal Revenue — MR Calculator (ΔTR / ΔQ)
    • Markup Calculator — How to Calculate Markup Percentage
    • Mean Calculator — Average of a Number List
    • Median and Mode Calculator
    • How to Calculate NPV — Net Present Value Calculator
    • Ohm’s Law Calculator — Resistance and Power
    • One-Rep Max Calculator (Epley)
    • P-Value Calculator — How to Calculate a P-Value
    • Pace Calculator — min/km and Speed
    • Paint Calculator — How to Estimate Paint Needed
    • Payback Period Calculator — Years to Recover Investment
    • Percentage Change Calculator — From Old Value to New
    • Permutation and Combination Calculator
    • Present Value Calculator — PV and FV Modes
    • Profit Margin Calculator — Net or Operating Margin
    • Pythagorean Theorem Calculator — How to Find a Missing Side
    • Quadratic Equation Solver — Roots and Discriminant
    • ROI Calculator — How to Calculate Return on Investment
    • Rule of 72 Calculator — Years to Double
    • Salary to Hourly Calculator — How to Convert Pay Rates
    • Sample Size Calculator — How to Estimate Required n
    • Scientific Notation Calculator — How to Convert Scientific Notation
    • Significant Figures Calculator — How to Count and Round Sig Figs
    • Slope Calculator — How to Calculate Slope Between Two Points
    • Standard Deviation Calculator — How to Calculate SD and Variance
    • Tile Calculator — How to Estimate Tile Quantity
    • Tip Calculator — Tip Amount and Split
    • Triangle Area Calculator
    • VAT / GST Calculator — Add or Extract Tax
    • Velocity Calculator — Distance over Time
    • Volume Calculator — Box and Sphere
    • Z-Score Calculator — How to Calculate a Standard Score
    • Measuring Magnetic Fields — Field strength calculator
    • Square Feet to Square Meters — Area Converter for Homes & Renovation
    • Unit Converter — Length / Mass / Temperature / Area / Volume / Speed
  • where2use
  • Tool types
  • Dev Logs

Navigation

Home

Single-tool Agent token use grows mainly from multi-phase workflows and context accumulation, not from reading all 128 tools; mitigated by `tool-token-efficiency` Skill without dropping quality gates. | Dev Logs

Back to Logs

Date: 2026-08-28 13:36 Summary: Single-tool Agent token use grows mainly from multi-phase workflows and context accumulation, not from reading all 128 tools; mitigated by tool-token-efficiency Skill without dropping quality gates.

[question] 单个工具的生成,使用token量越来越大,分析一下原因,以及影响因素,另外还要分析是否由于项目工具越来越多导致。后续:单独一个 skill 做 token 优化约束,但绝对不要降低生成工具的质量。

[try to solve]

Executive summary

Token consumption for one new tool has risen faster than tool count alone explains. The dominant drivers are more workflow phases (0b → intent review → master i18n → phase 2 → ten locales → phase 4 → ship), thicker rules and deliverables, and multi-turn conversation history—not the need to load all 128 existing tools into Agent context.

Tool count (128 as of 2026-08-28) matters indirectly: full-site build:site / lint:seo take longer and produce noisier terminal output; merged artifacts (src/site/i18n/en.ts ~599 KB, tool-catalog.json ~76 KB) become dangerous if an Agent reads them by mistake. Slug-level isolation (tool-catalog.d/{slug}.json, i18n/tools/{slug}/) keeps the normal read path flat as the catalog grows.

Mitigation shipped: .cursor/skills/tool-token-efficiency/SKILL.md—session splits, read allowlists, short lint handling—while all coverage and i18n quality gates remain mandatory (tool-coverage-pass, localization rules).


Token spend model (five layers)

Layer Typical size (repo, Aug 2026) Scales with tool count? Notes
A · Fixed per turn always_applied rules ~8 KB + user/system prompt Slow (rule edits) seo-google-policy, project-core, dev-logs every turn
B · Glob-triggered rules Tool rules + Skills 52 KB (13k tokens est.) Yes (rules grow) tool-i18n-localization (25 KB), tool-creation (13 KB), coverage + token Skills
C · Single-tool deliverables brief ~40 KB; i18n shards ~49 KB/tool median; Page ~600 lines Per slug, not catalog size Isolated truth sources
D · Conversation history 15–30+ turns × (reads + command output + replies) With workflow phases Largest hidden multiplier
E · Accidental full-site reads merged i18n ~6 MB (10 langs); catalog ~76 KB Linear Only when Agent mis-reads; catastrophic for tokens

Why single-tool tokens keep rising

1. Workflow phase multiplication (~40% of growth)

Early path: brief → Page + en → bulk locales → merge.

Current mandatory path (tool-coverage-pass + localization):

0b (pre-list coverage) + coverage:gate
  → 0i (user intent review)
  → master locale + phase=2
  → per-locale rewrite (10 langs, batches ≤3) + phase=4
  → build:site + lint:seo + lint:tool-isolation

Each phase often maps to separate chat turns. Rules (layer B) re-inject every turn; history (layer D) accumulates reads, edits, and gate output. Example: measuring-magnetic-fields brief alone split across three dev-log sessions before implementation.

2. Rules and compliance thickness (~25%)

Artifact Lines / bytes
tool-i18n-localization.mdc 298 lines / ~25 KB
tool-creation.mdc 166 lines / ~13 KB
tool-coverage-pass/SKILL.md 90 lines
tool-token-efficiency/SKILL.md 179 lines

Recent hard requirements all expand Agent-facing text: intent review (0i), How how_item_1…n, auto loadSample, IG ≥3, FAQ ≥3, description ≥120 chars with steps + example, ten-locale search-oriented rewrite (not translate), ≥3 review rounds. Quality improves; token floor rises.

3. Per-tool content volume (~20%)

Measured references (Aug 2026):

  • ~50 i18n keys per locale (jwt-decoder en shard)
  • ~49 KB median i18n shard total per tool (10 langs); max shard ~142 KB
  • Typical *Page.ts: 500–800 lines
  • work-tasks/{slug}/: ~40 KB when briefs are complete

Ten locales × multi-pass copy (steps 2 and 4) multiply generation and re-read cost even when isolation is correct.

4. Agent exploration patterns (~15%)

Common high-cost patterns observed in tool work:

  • Reading full reference pages (e.g. imageCompressPage.ts ~800 lines) instead of slices
  • Reading merged src/site/i18n/{lang}.ts (~600 KB/lang) instead of slug shards
  • Reading full tool-catalog.json for related instead of grep + 2–3 candidate shards
  • Re-ingesting full build:site / lint:seo stdout (128-tool scan) into context

5. Tool catalog size (~10%, mostly indirect)

Metric Value Agent context impact
Tools in catalog 128 None if only slug shards are read
tool-catalog.json ~76 KB Only if read whole
Merged i18n (10 langs) ~6 MB Only if merged files are read
build:site Full prerender 128×10 langs Wall-clock + verbose stdout; not required read
lint:seo Scans all merged i18n + all FAQ pairs Warnings from other slugs pollute context if pasted back

Conclusion on tool count: The repo is not designed to load 128 tools into one Agent prompt. Growth in tool count linearly inflates CI/build/lint and mistake surface (merged files), but should not linearly inflate tokens if agents follow slug isolation. Violations of isolation dominate the “128 tools → huge context” perception.


Factor weighting (estimated)

Multi-turn workflow + history accumulation     ████████████████████  ~40%
Rules/Skills thickness + per-turn re-inject    ███████████████       ~25%
Ten-locale deep copy (non-machine-translate)   ████████████          ~20%
Single-tool Page / IG complexity               ████████              ~15%
Catalog size (build/lint/mis-reads)            ████                  ~10%

Quality-preserving mitigations (implemented)

Added .cursor/skills/tool-token-efficiency/SKILL.md as companion to tool-coverage-pass.

Conflict order: Google SEO / localization rules → tool-coverage-pass → token Skill.

What it optimizes (HOW):

Technique Token saved Quality impact
Session split A/B/C/D (brief / master / locales / ship) Cuts history carry-over None—state in work-tasks/{slug}/
Read only slug shards + briefs Avoids 600 KB merged i18n None
Reference Page ≤150 lines by type Avoids 800-line reads None
Filter lint to active slug lines Less stdout in context None—full lint still runs
npm run verify:tool -- --slug= One ship gate sequence None—all gates preserved

What it explicitly forbids skipping:

  • 0b, 0i, phase 2, phase 4, coverage:gate --phase=all
  • Ten-locale search-oriented rewrite; ≥3 rounds
  • IG, FAQ, how_items, loadSample, build:site, lint:seo, tool isolation

Registered in AGENTS.md, tool-creation.mdc, tool-coverage-pass/SKILL.md, .github/copilot-instructions.md.


Recommendations not yet implemented

These would reduce wall-clock or mistake risk further; optional follow-ups:

  1. True incremental build:site for ship session D — build-site.mjs currently enforces full prerender (--full); incremental flags exist in prerender-tool-pages.mjs but are ignored at site build. Token Skill accepts full build for quality; incremental build would help local dev time, not Agent reads.
  2. Slug-scoped lint wrapper — run SEO checks only for {slug} during intermediate turns; keep full lint:seo at ship (would need script work).
  3. Rule progressive disclosure — short “agent summary” front-matter in long .mdc files; full text on demand (rules architecture change).

Answers to the original questions

Question Answer
Why are tokens growing for one tool? Mainly more phases and turns, thicker rules, deeper ten-locale copy, and history accumulation—not model pricing alone.
Key influencing factors? Workflow gates, rule/Skill size, per-tool i18n+Page volume, exploration habits, accidental full-site reads, build/lint output feedback.
Is it because there are more tools? Partially and indirectly (~10%): longer build/lint, larger merged artifacts if mis-read, bigger README/catalog for related picking. Not because agents must load 128 tool sources each time—if isolation and the token Skill are followed.

Related artifacts

  • Analysis mitigation Skill: .cursor/skills/tool-token-efficiency/SKILL.md
  • Coverage workflow (unchanged): .cursor/skills/tool-coverage-pass/SKILL.md
  • Skill delivery note: dev-logs/2026-08/2026-08-28-13-15-tool-token-efficiency-skill.md

[actions]

  • Added .cursor/skills/tool-token-efficiency/SKILL.md
  • Updated AGENTS.md, .cursor/rules/tool-creation.mdc, .cursor/skills/tool-coverage-pass/SKILL.md, .github/copilot-instructions.md
  • This consolidated analysis log (companion to 2026-08-28-13-15)
OnlineFreeTools.org · Learning project · Iterating
About·Privacy·Terms·Contact·GitHub