setup

A setup command for configuring the vs-token-safer plugin, including its project path, search backend, and result limit.

In plain words
What is it for?
Use it to choose or confirm a project, configure support for C/C++ or C#/.NET code, and set the maximum number of results returned.
Why use it?
It puts the plugin's settings in one configuration file so its command-line tool and server can use them when they start.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/jsungmin/vs-token-safer/setup
Clone the repo
git clone --depth 1 https://github.com/JSungMin/vs-token-safer
Per session 33 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,410 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00033 $0.01410
Opus 5 $0.00016 $0.00705
Sonnet 5 $0.00007 $0.00282
Haiku 4.5 $0.00003 $0.00141

Measured yesterday against content hash c7592f1a0327, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

setup scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/setup.md · 63 lines

How it starts

The opening of the file, as written. The whole thing — 63 lines — stays where its author put it; the contents beside it link to each section on GitHub.

vs-token-safer — setup

Configure the plugin by writing its config file (~/.vs-token-safer/config.json), which the CLI and MCP server read at startup. Use the vts_admin MCP tool (server: vs-search) with an op + params — the admin/meta ops (setup, config, …) are folded behind it, e.g. vts_admin { "op": "setup", "params": { "projectPath": "<root>" } }. Do NOT edit the user's OS environment.

Steps:

  1. Show current settings: call vts_admin { "op": "config" }.
  2. Detect/confirm the backend. Backend auto-detects from the project root:
    • C/C++ → needs compile_commands.json in (or under) the root → clangd. Unreal: generate via UBT -mode=GenerateClangDatabase (add -Compiler=VisualCpp if the targets build with clang-cl, else clang-toolchain validation fails); CMake: -DCMAKE_EXPORT_COMPILE_COMMANDS=ON. Use clangd ≥ 22 — the VS-bundled clangd 19.1.x deadlocks indexing Unreal TUs; if vts prints a clangd-version advisory, point VTS_CLANGD_CMD at a current clangd (https://github.com/clangd/clangd/releases).
    • C#/.NET → a .sln/.csprojroslyn (default engine csharp-ls; install with dotnet tool install --global csharp-ls, or point VTS_ROSLYN_CMD at MS C# LSP).
    • JS/TS → a tsconfig/jsconfig/package.json or *.ts/jstypescript (bundled typescript-language-server, auto-installed). Python → pyproject.toml/*.pypyright (bundled, auto-installed). Nothing to install for these two.
  3. Gather values (ask one at a time, or an AskUserQuestion for the common ones):
    • projectPath — default project root (where the compile DB / .sln / package.json lives).
    • backendclangd | roslyn | typescript | pyright (omit to auto-detect).
    • maxResults — cap on returned file:line locations (default 60).
    • prewarmBackendsauto (warm the dominant backend) | all (warm every language present, each in proportion to its file count) | a comma list. Omit it: vts_admin { op: "setup" } runs a language census of the root and picks auto for a single-language repo or all for a multi-language one automatically.
  4. Apply: call vts_admin { "op": "setup", "params": { … } } with only the keys to change, e.g. vts_admin { "op": "setup", "params": { "projectPath": "<root>", "backend": "clangd" } }. It reports the detected language mix (e.g. clangd(820), typescript(40)) and the prewarmBackends it chose.
  5. Unmet C++ prerequisites → present clickable choices, don't ask in prose. When the clangd backend is missing compile_commands.json and/or a clangd ≥ 22 binary, the user should click, not type. Use the AskUserQuestion tool — one question per missing prerequisite, each with concrete options:
    • compile_commands.json missing → question "Generate the C++ compile database now?" options:
      • Dry-run first (Recommended) → call vts_admin { op: "setup", params: { genCompileDb: true } } (prints the exact UBT GenerateClangDatabase command, runs nothing) — show it, then re-ask to apply.
      • Run it now (apply)vts_admin { op: "setup", params: { genCompileDb: "apply" } } (heavy: indexes engine headers, minutes, needs clangd ≥ 22). DB parks out-of-tree (~/.vs-token-safer/db/<project>), git/p4 never see it.
      • Skip — I'll generate it myself → leave as-is (text fallback stays active).
    • clangd ≥ 22 not on PATH → question "clangd binary?" options:
      • Point vts at an installed clangd → ask for the path, then vts_admin { op: "setup", params: { clangdCmd: "<path>" } } (writes VTS_CLANGD_CMD).
      • I'll install it → link https://github.com/clangd/clangd/releases (VS-bundled 19.1.x deadlocks on UE).
      • Skip for now → text fallback stays active. Only fall back to a free-text question if AskUserQuestion is unavailable. Always dry-run the DB before apply.
  6. Tell the user to run /reload-plugins (or restart) — settings are read at startup.

Read the full file on GitHub · 63 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 63 lines · 33 tokens per session scan A c7592f1a0327

Subscribe to this mod's changes

setup is a command published in the GitHub repository JSungMin/vs-token-safer (11 stars, last pushed 4d ago), licensed MIT. It adds 33 tokens to every session and 1,410 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.