Glitchless for Three.js
One npm package records how your Three.js game runs on your players' machines: every stutter with its cause, every error with what led to it, and where players quit. Your coding agent reads it over MCP, drives the running game over WebMCP, and checks its fix with playtest bots.
What it records in a Three.js game
-
Frame times that mean something
The budget comes from the display's refresh rate, 60, 120 or 144 Hz. Every 5 seconds the frames are summarised into a mergeable sketch, so p95 and p99 cover every player.
-
Stutters, with a cause
Each hitch is tied to a long script, a shader compile, a GC pause or an asset load, and to what the frame uploaded to the GPU: new textures, geometry buffers and shader programs.
-
What the renderer did
Draw calls, triangles, geometries, textures and shader programs from
renderer.info, per level and version, so a heavy scene or a leak shows next to the frame time. -
Errors
Uncaught errors and WebGL context loss, with the gameplay events before each one. With source maps, a minified build's errors show the original file and line.
-
Bug reports from playtesters
F8 or a button opens a small form. The note, a screenshot, the level and the last events go to your dashboard.
-
Levels, deaths and quits
The level funnel, deaths and rage quits. In full mode, death places and positions feed heatmaps and replays.
Set it up.
Paste one prompt into your coding agent. It installs the package, adds two calls next to your renderer, connects to your Glitchless account and checks that your first sessions arrive.
- Paste
Open Claude Code, Codex, Cursor or any other coding agent in your game's folder, and paste the prompt below.
- Approve
Your agent shows you a code. Approve it in your browser to connect your agent to your Glitchless account; signing up is free.
- Play
Load the game in a browser: sessions show on your dashboard. Press the backtick key in the game for live frame times.
Paste this into your coding agent
Add Glitchless (glitchless.gg) to this Three.js game, so you and I can understand how it runs and plays for the people playing it: stutters and what causes them, crashes and errors, and where players get stuck or quit. 1. Get the Glitchless agent kit, outside this project so it never gets committed: git clone --depth 1 https://github.com/glitchless-gg/glitchless ~/.glitchless If that folder already exists, run git -C ~/.glitchless pull instead. 2. Add the Glitchless MCP server to your own MCP settings, in whatever way your tool adds them: command npx, arguments -y glitchless-mcp, environment variable GLITCHLESS_URL=https://api.glitchless.gg. Also add webmcp, since this game runs in a browser: command npx, arguments -y @jason.today/webmcp@latest --mcp. It lets you drive the running game: measure frame times, inspect the scene and reproduce a problem. Then run npx -y glitchless-mcp login in a terminal, show me the link and the code it prints, and wait while I approve it (I'll make a free Glitchless account there if I don't have one). If your tool needs a restart to load new MCP servers, tell me. 3. Make this game in Glitchless with the glitchless_create_game tool, and keep the client token it returns. It's public and can only send data, so it's fine inside the game. Never put a key that starts with gl_sk_ or gl_ws_ in the game, in a file that gets committed, or in your reply. 4. Read ~/.glitchless/plugin/glitchless/skills/instrument/SKILL.md and follow it for this game. It's a Three.js game (React Three Fiber too), so the skill sends you to references/threejs.md: install glitchless from npm, call Glitchless.init once and instrumentThree with the renderer, scene and camera. Use the intake URL https://api.glitchless.gg and that client token. Keep the default anonymous privacy mode, and ask me before turning on install or full mode, because either needs a line in the game's privacy policy. 5. Run the game for a minute, then check that its sessions arrive with the glitchless_list_games tool. My own play counts as a player's: ask me whether to mark it as the team's with the glitchless_mark_known tool. 6. Tell me what you changed, file by file. Then ask me what I want to know about my players, and give the game its own dashboard by following ~/.glitchless/plugin/glitchless/skills/dashboard/SKILL.md.
What your agent adds: one npm package and two calls
// npm install glitchless
import * as THREE from 'three';
import { Glitchless, instrumentThree } from 'glitchless';
const glitchless = Glitchless.init({
service: 'my-game',
version: '1.0.0',
intake: 'https://api.glitchless.gg',
clientToken: 'gl_pub_...',
});
instrumentThree(glitchless, { renderer, scene, camera, THREE });
// React Three Fiber: the same call, with gl, scene and camera from useThree()
Built for working with a coding agent
Glitchless's MCP server gives Claude Code, Codex, Cursor or any other agent the findings, frame times, errors and bug reports from your players.
WebMCP tools let the agent drive the game itself: measure frame times, inspect the scene, take a screenshot and reproduce a problem in the running game.
glitchless-playtest plays fixed-seed runs in Chrome with your game's autoplay bot and compares them with a saved baseline, so the agent can prove a fix before it ships.
Tested
- Zoomies, a Three.js platformer with four planted bugs: the run in the homepage film is its, before and after an agent's fix.
- About 30 ns of work a frame, and one small gzipped request every 15 seconds.
Not yet
- Death places and positions are only sent in full mode, or with
positions: true. - Session replay is a timeline and positions, not video.
Fixing a problem in Three.js
- Three.js performance optimization: measure first, then fix
Draw calls, leaks, first-use shader hitches, shadows, pixel ratio and garbage in Three.js and React Three Fiber, measured with renderer.info and fixed with code.
- Three.js game analytics and observability tools
renderer.info, stats.js, three-perf, Spector.js and DevTools on your machine; PostHog, GameAnalytics, Sentry, Datadog and Glitchless for players. What each is best for, what it misses, and what it costs.
- What analytics to add to a Three.js game
Sessions, levels, your own events, purchases, retention and frame times in a Three.js or React Three Fiber game, sent without costing frames and kept anonymous, with code.
Questions
Does it work with React Three Fiber?
Yes. Call instrumentThree once with the renderer, scene and camera that useThree() gives you (gl, scene, camera); everything else is the same.
Is it free?
The SDK and the server are open source under the MIT licence. Glitchless Cloud is free for 5,000 play sessions a month, or you can run the server yourself with Docker. See pricing.
Why not Sentry or PostHog?
Keep them if you use them: Sentry's browser SDK reports errors and PostHog does product analytics, but neither times a web game's frames or names a stutter's cause. See Glitchless vs Sentry and Glitchless vs PostHog.
What does it send about players?
Nothing that identifies them by default: no player ID, no device fingerprint. PRIVACY.md lists every field in each mode.
Ship it glitchless.
Paste one prompt into Claude Code, Codex or Cursor. It adds Glitchless to your game and builds a dashboard for it.