From vs-token-safer
Routing rules for code search in C/C++, C#/.NET, JS/TS, and Python projects via vs-token-safer — use the vs-search MCP tools (clangd/Roslyn/tsserver/pyright language-server index) or the `vts` CLI instead of Bash grep. Use whenever searching for a symbol, definition, function, variable, type, or finding references/usages in a C/C++, C#/.NET (incl. Unreal, Visual Studio), JavaScript/TypeScript, or Python codebase.
How this skill is triggered — by the user, by Claude, or both
Slash command
/vs-token-safer:vs-searchThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Code search runs through an OFFICIAL language server's index (clangd for C++, a Roslyn-based LSP for
Code search runs through an OFFICIAL language server's index (clangd for C++, a Roslyn-based LSP for
C#) and the result is token-capped to a compact file:line list — no source bodies. No IDE needs to
be open; the engine is spawned headlessly. Karpathy-style rules: do the listed thing, do not improvise.
vs-search)search_symbol (args: q, projectPath, backend, maxResults). Never grep/rg for this.find_references (args: symbol NAME, or path+line+character — 0-based — includeDeclaration). Semantic, not a text match. direction=callers/callees + depth → a multi-hop call hierarchy (transitive callers = blast radius before an edit / callees) via LSP callHierarchy, instead of flat references.goto_definition (args: path, line, character — 0-based). The kind arg picks WHICH: definition (default) · type_definition (the type of an expression) · implementation (concrete impls of an interface/abstract/virtual — "who implements this?") · declaration. For every usage (not the definition) use find_references instead.hover (args: path, line, character).document_symbols (args: path; scope="directory" → a signatures-only skeleton of every code file under a dir, to grasp a module's shape without reading each file).read_symbol (args: symbol, optional path/line, signatureOnly). The read-side twin of the edit tools — name a symbol, get just its body. Prefer over the built-in Read when you only need one declaration.diagnostics (args: path, or scope="directory" to scan the project). Token-capped file:line:col severity: message, sorted error→hint with a count summary — read this instead of the raw build/compiler output.rename (args: path, line, character, newName, apply). Semantic (every reference), not a sed. Preview by default; apply=true writes the edits.replace_symbol_body (args: symbol, body, optional path/line, apply).insert_symbol (args: symbol, text, position = after default / before, apply).safe_delete (args: symbol, force, apply). Refuses while it's still referenced unless force=true.apply=true writes. Use the built-in Edit for a sub-declaration tweak (a few lines inside a body); use these when the unit is the whole declaration.apply=true write auto-runs p4 edit on a read-only file first (symbol edits write via the server, so a built-in Edit/Write p4 hook never sees them). Read-only-gated, so a git repo never calls p4; disable with VTS_P4_EDIT=0.search_text (args: q, projectPath). Token-capped; the sanctioned grep replacement.find_files (args: q, projectPath). Replaces find -name.vts_admin with an op: config/setup (settings), savings/savings_reset (token ledger), warmup (pre-build the index), discover (find searches that bypassed vts), gen_compile_db (UE clangd DB), git/p4 (read-only VCS, output compacted). Put the op's args in params, e.g. vts_admin {op:"git", params:{argv:["status"]}}. (CLI keeps the bare subcommands: vts setup, vts git, …).log/.jsonl, or a Logs/ dir) → NOT a vs-search tool. The language-server index covers
source, not logs — use gamedev-log (/gamedev-log-analyzer:logs). vts-search results aimed at a log
carry a one-line pointer there.Delegate a whole "where is X / what calls Y / find file W" lookup to the code-locator subagent —
it runs the searches in its own context and returns just the file:line table, so the matches never
land in yours.
CLI equivalent (no MCP needed): vts symbol --q <name> --projectPath <root>,
vts references --path <file> --line N --character N, vts definition --path <file> --line N --character N [--kind implementation],
vts hover …, vts symbols --path <file>, vts diagnostics --path <file>, vts text --q <pattern>, vts files --q <glob>.
compile_commands.json
(or a .uproject) → clangd; a .sln/.csproj → roslyn; a tsconfig/jsconfig/package.json
→ typescript (tsserver); a pyproject.toml/*.py → pyright. Override with
backend=clangd|roslyn|typescript|pyright or env VTS_BACKEND when a root carries more than one.projectPath or env VTS_PROJECT_PATH (default: cwd).compile_commands.json. Unreal: generate via UBT
-mode=GenerateClangDatabase; CMake: -DCMAKE_EXPORT_COMPILE_COMMANDS=ON. Without it, clangd
indexes nothing useful — tell the user to generate it.csharp-ls dotnet tool; point VTS_ROSLYN_CMD/VTS_ROSLYN_ARGS at
Microsoft.CodeAnalysis.LanguageServer for the exact Visual Studio engine. Currently best-effort.node. Override via VTS_TS_CMD/VTS_PY_CMD.Symbol/reference lists are capped at maxResults (default 60). A trailing … N more means the set
was truncated — raise maxResults or narrow the query. For refactors/renames that must touch every
call site, raise the cap (or narrow with a more specific symbol) before acting; don't act on a
partial set and claim it's complete.
file:line — far less raw source reaches the model than grep-and-paste.search_symbol quality depends on compile_commands.json being current.
Verify the result; regenerate the compile DB if a known symbol is missing.If a vs-search tool errors (engine missing/failed to spawn): clangd not installed → install LLVM
clangd; roslyn not installed → dotnet tool install --global csharp-ls; typescript/pyright not found →
re-run the session so the bundled deps reinstall (or set VTS_TS_CMD/VTS_PY_CMD). Until the engine works,
code-grep is blocked by the hook — the user can set VTS_ENFORCE=0 to allow grep as a fallback. Do
not loop on blocked grep; surface the fix and move on.
npx claudepluginhub jsungmin/vs-token-safer --plugin vs-token-saferProvides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.