Svelte DevTools plugin for Vite DevTools. Provides 15 specialized panels for debugging, profiling, and inspecting Svelte/SvelteKit applications — all integrated directly into the Vite DevTools UI.
Status: Early development (v0.0.1). APIs may change.
$state, $derived, and $effect dependencies as an interactive DAGload functions with waterfall visualization+server.ts) directly from DevToolsvite-devtools-svelte is a panel provider — it needs the @vitejs/devtools host plugin to render its UI. Install both:
npm install -D vite-devtools-svelte @vitejs/devtools
Register both plugins in your vite.config.ts. svelteDevtools() must come before sveltekit() so that its transforms run before the Svelte compiler.
// vite.config.ts
import { sveltekit } from '@sveltejs/kit/vite'
import { DevTools } from '@vitejs/devtools'
import { svelteDevtools } from 'vite-devtools-svelte'
import { defineConfig } from 'vite'
export default defineConfig({
plugins: [
svelteDevtools(), // must come before sveltekit()
DevTools(), // the @vitejs/devtools host — without it the panels have nowhere to render
sveltekit(),
],
})
Then start your dev server as usual:
npm run dev
Open your app in the browser. The Vite DevTools drawer appears at the bottom edge of the page — click the floating handle to open it, then switch to the Svelte tab to see the panels provided by this plugin.
[!NOTE] If you only register
svelteDevtools()withoutDevTools()from@vitejs/devtools, the dev server starts fine but no DevTools UI appears — there is no host for the panels to mount into. Seeexamples/sample-appfor a minimal working setup.
svelteDevtools({
// Enable component lifecycle tracking (default: true)
componentTracking: true,
})
The plugin uses a virtual module architecture instead of fragile regex transforms:
svelte/internal/client to track component lifecycle and reactive signals ($state, $derived, $effect)The plugin is development-only — it adds zero overhead to production builds.
The plugin exposes an MCP (Model Context Protocol) endpoint so AI agents such as Claude Code can read performance metrics and run measurement sessions autonomously. The intent: surface the same data the panels show, in a shape an agent can act on — and let the agent's own file-editing tools propose fixes.
On dev-server startup the plugin prints a copy-pasteable registration command:
svelte-devtools MCP ready — register with Claude Code:
claude mcp add --transport http svelte http://localhost:5173/__svelte-devtools/mcp --header x-svelte-devtools-token:<token>
The endpoint is gated by the same per-process random token used by the panel UI. The token rotates every dev-server start, so you'll re-register after a restart.
| Tool | Purpose |
|---|---|
list_performance_issues |
Cross-cuts render / reactive / load / fps and returns ranked issues with suggestedTool for drill-down. Entry point. |
get_component_hotspots |
Top components by total render time. |
get_reactive_graph_problems |
Classified reactive-graph issues (over-connected effects, orphan deriveds, isolated nodes). |
get_load_waterfall |
SvelteKit load timings grouped by route. |
get_fps_drops |
FPS samples below threshold. |
get_render_profile |
Render profile entries for a specific file. |
start_session, end_session, compare_sessions |
Bracket a measurement window so the agent can diff before/after a fix. persist:true writes the session to node_modules/.vite-devtools-svelte/sessions/. |
list_sessions, load_session, delete_session |
Session inspection / cleanup. The agent owns disposal — the plugin never auto-persists. |
Two Claude Code skills ship under node_modules/vite-devtools-svelte/skills/:
vite-devtools-svelte:perf-audit — captures a baseline session, calls list_performance_issues, and presents the top issues for the user to triage.vite-devtools-svelte:perf-fix — one issue per run: baseline → edit → after → compare_sessions, with verdict reported verbatim and an explicit revert path if the change regresses or has no effect.Skill names are namespaced with vite-devtools-svelte: so they don't collide with other skills in your .claude/skills/.
To install for a given project:
mkdir -p .claude/skills
cp -r node_modules/vite-devtools-svelte/skills/* .claude/skills/
The MCP server is read + measure only — it never edits files. Editing is left to the agent's own tools (Claude Code's Edit/Write), which keeps the permission boundary clean and lets git own rollback.
The DevTools backend exposes a small set of dev-only HTTP endpoints (/__svelte-devtools/rpc, /__svelte-devtools/asset) to drive the panel UI. Some of those endpoints can read files from disk or open them in your editor, so we treat them as authenticated even though the dev server is normally only reachable from localhost.
<meta> tag. The HTTP fallback RPC and the asset middleware require that token in the x-svelte-devtools-token header, plus a same-origin Origin/Referer. Cross-origin requests, requests with the wrong token, and requests without Content-Type: application/json are rejected with 403 / 415. Bodies above 1 MB are rejected with 413.inspect-file, open-in-editor, and open-reactive-in-editor resolve their input through fs.realpath() and refuse anything outside the project root, so a hostile RPC caller cannot read /etc/passwd or your ~/.ssh/ files even if they get past the token check. Symlinks inside the project are followed normally.send-api-request and the OG-preview RPC block 127.0.0.0/8 / 10.0.0.0/8 / 172.16.0.0/12 / 192.168.0.0/16 / 169.254.0.0/16 / IPv6 loopback / localhost / *.local / *.internal.svelte/internal/client wrapper are gated on config.command === 'serve' and never resolve during a production build, so none of this surface ships to end users.If you bind your dev server to 0.0.0.0 (e.g. vite --host), the same-origin check still blocks LAN browsers from invoking RPC, but anyone on the LAN can still see the panel UI itself. Treat that as you would any unauthenticated dev tool: don't run it on networks you don't trust.
This is a pnpm monorepo.
# Install dependencies
pnpm install
# Build everything
pnpm build
# Run the playground app with DevTools
pnpm dev
# Run tests
pnpm -C packages/vite-devtools-svelte test
# Watch mode
pnpm -C packages/vite-devtools-svelte test:watch
# Lint and format (oxlint / oxfmt)
pnpm lint
pnpm format
A Nix flake is provided so every contributor can pin the exact Node.js toolchain. With Nix installed:
nix develop # drop into a shell with Node 24 + corepack
If you use direnv, direnv allow in the repo root will
do this automatically. The shell uses corepack to materialize the pnpm version
declared by the packageManager field in package.json, so pnpm --version
matches across machines.
├── packages/vite-devtools-svelte/
│ ├── src/ # Plugin core (Vite plugin, runtime, analyzers)
│ ├── client/ # DevTools UI (Svelte 5 SPA)
│ └── dist/ # Build output
├── playground/ # Demo SvelteKit app for development
└── docs/images/ # Screenshots
Contributions are welcome! Please open an issue first to discuss what you'd like to change.