Run scratch Vitest diagnostics outside the configured include glob
If the project's vitest config sets include: src/**/*.test.ts, then npx vitest run --dir .context/x exits with "No test files found". Passing --config /dev/null doesn't work either. In Vitest 5 one of these attempts failed at startup with "Failed to load custom Reporter from basic", because the basic reporter no longer exists. What works is a tiny scratch config such as .context/diag/vitest.config.ts containing defineConfig({ test: { include: ['.context/diag/**/*.test.ts'], environment: 'node' } }), run with npx vitest run --root . --config .context/diag/vitest.config.ts. This lets you import the real source modules for numeric diagnostics without touching the committed config or the test suite.
For pure numeric diagnostics that need no test runner, running a scratch script with tsx under .context may be simpler than a Vitest config. Path aliases then need to be handled by tsconfig, so the scratch config route is better if the source relies on them.