# Telemetry

When `debuff build` succeeds, the CLI tells debuff.jp that a project was built. We use it to find games made with debuff, so we can see what people make and later invite them to a showcase. That's all it's for.

## What's sent

One small request per build to `https://debuff.jp/api/telemetry`:

| Field | Example | What it is |
| --- | --- | --- |
| `id` | `1b9f…c3` | A random id made the first time you build, kept in your project's `.debuff/project.json` |
| `name` | `my-game` | The `name` in your `package.json` |
| `debuff` | `0.8.0` | The debuff CLI version |

That's the whole request. No code, file paths, URLs, machine details or anything about your players. Games don't send anything when people play them: telemetry only runs on your machine, when you build.

On our side we keep one record per project id: the name, the debuff version, when it was first and last built, and how many builds. We don't store IP addresses.

## Turning it off

Any of these:

```bash
npx debuff telemetry off
```

- Set `DEBUFF_TELEMETRY=0` in your environment.
- In CI it's off automatically.

`npx debuff telemetry` shows whether it's on and where the setting is saved. `npx debuff telemetry on` turns it back on.

The first build that sends anything prints a one-line notice saying so. The request gives up after about a second and a half and never fails a build.

## Automatic papercuts {#papercuts}

From 0.24, the CLI and the MCP server also report debuff's own friction to the public board at [papercuts.debuff.jp](https://papercuts.debuff.jp): a setup failure seen twice in a week (for example `cli build fails with browser_not_found`), or a command or tool call that ran far too long. Each report holds a fixed title, a fingerprint such as `cli:build:browser_not_found`, the minutes and the CLI or MCP version. It never holds error messages, paths, code or your project's name. Typos and network failures are never reported.

From 0.26.2, each report also holds the machine it happened on and what debuff checked, so a slow build can be told apart from a busy computer: the OS name, version and architecture, the CPU count, total and free memory and the Node version. For `browser_not_found` it says whether `DEBUFF_BROWSER` was set and, for Chrome, Edge and Chromium, whether each was missing or failed to start. No names, paths or hardware ids. The notice is shown again before the first report with these.

From 0.24.2, `debuff dev` also reports bugs inside debuff that the dev tools catch while the game runs: an error thrown in debuff's own code (including spryte, plonk and Myaku) that wasn't a deliberate rejection of something the game passed. The report holds the error's name and up to three debuff functions it came from, such as `TypeError at spryte.js:Canvas2D.flush`. It never holds the error message, line numbers or any frame from your game; the dev server checks that before sending. Like the others, it goes only once it's been seen in two page loads in a week. Before 0.24.2 the notice didn't mention these, so it's shown once more before any are sent.

Nothing goes until you've seen a notice: the first time debuff notices one, the CLI prints it, or the MCP server puts it in the tool result for the agent to pass on, and sends nothing that time. A crash is fingerprinted by the error's name and the debuff file and function it came from, never the path. Each fingerprint goes at most once a day, and one the board already has only adds a hit. Automatic reports wait for review before anyone else sees them. A record of what was seen and sent is in `papercuts.json`, next to the config file above.

Off with `npx debuff papercuts off`, `DEBUFF_PAPERCUTS=0` or `DEBUFF_TELEMETRY=0`. They're also skipped in CI.

## Questions

Ask on [Discord](https://discord.gg/jshbDHSpCY) or [open an issue](https://github.com/debuffjp/debuff/issues). The code is [`tooling/cli/src/telemetry.ts`](https://github.com/debuffjp/debuff/blob/main/tooling/cli/src/telemetry.ts) and the endpoint is [`src/telemetry.ts`](https://github.com/debuffjp/docs/blob/main/src/telemetry.ts) in the site's repo.