# Privacy and uninstall

Rebates starts from a narrow default data scope: the account/device data needed
to authenticate, serve, and credit a sponsored footer.

## What leaves your machine

Onboarding starts with the same device-code login flow as the main SellTraces
CLI:

```text
POST /api/cli/device/start
GET /api/cli/device/poll?deviceCode=...
POST /api/rebate/claim
```

After login, ad fetches use the saved bearer token plus the local device id:

```text
GET /api/ad?d=<device-id>
POST /api/ad/contextual
```

The device id is a random UUID generated locally on first run and stored at
`~/.rebate/device`. It is claimed to your signed-in account so impressions can
credit your dashboard wallet. Sponsor clicks open first-party `/go/...` URLs
that resolve through the Gravity click proxy and then redirect to the
advertiser.

## Ad relevance and optional sharing

The default sponsored-footer flow does not require trace uploads. Ad relevance is
selected server-side from a small set of developer-tool topics, account/device
state, and ad event history. Any additional data sharing for ad relevance must
be presented as an explicit opt-in before that data is used.

Contextual matching (redacted prompt text improving sponsor relevance) is that
opt-in. Onboarding recommends it but requires an explicit yes, and consent is
recorded together with the disclosure version you were shown. If the disclosure
wording ever changes, recorded consent expires and the CLI stops sending
context until you run `rebate context on` again. Silent installs
(`rebate onboard --yes`) never enable contextual ads unless `--contextual` is
passed explicitly, and `REBATE_CONTEXTUAL_ADS` only overrides the saved choice
while it is present in the environment.

Sponsor attribution is a second, independent opt-in and is off by default. If
you enable it with `rebate sponsor attribution enable`, Rebate may run Gravity's
terminal pixel and send Gravity visitor, session, click, and ad identifiers;
terminal, device, session, and related technical metadata collected by the
pixel; and a one-way SHA-256 hash of your normalized, verified account email.
Your raw email is never sent to Gravity. The hash is pseudonymous and matchable,
not anonymous; it could be guessed by testing candidate email addresses, and a
party that already knows an address can compute the same hash and match it.
These signals support sponsor
selection, measurement, fraud prevention, and delivery audits; they do not
guarantee higher sponsor rates, earnings, or payouts. Revoke consent at any time
with `rebate sponsor attribution disable` without changing contextual prompt
consent.

<Note>
Trace collection is a different product with a different CLI. [SellTraces](/overview) handles agent transcripts only after explicit, per-source opt-in, and its docs describe that flow separately.
</Note>

## What changes on your machine

| Path | Change |
| --- | --- |
| `~/.claude/settings.json` | Rebate-owned `hooks.SessionStart`, `hooks.UserPromptSubmit`, `hooks.Stop`, `statusLine`, `spinnerVerbs`, and `env.FORCE_HYPERLINK` entries |
| `~/.claude/settings.json.rebate-backup` | Byte-exact backup of the original, taken before the first write |
| `~/.claude/commands/ad.md` | The `/ad` slash command |
| `~/.codex/hooks.json` | Rebate-owned `hooks.UserPromptSubmit` command for Codex prompt refresh |
| `~/.codex/hooks.json.rebate-backup` | Byte-exact backup of the original Codex hooks file, taken before the first write |
| detected `codex` launcher path | Rebate-owned launcher shim for interactive Codex footer rendering, with restore metadata under `~/.rebate/codex-launcher.json` |
| `~/.rebate/` | Device id, credentials, latest sponsor snapshot, private 30-minute activity-session state, optional Gravity pixel state, Codex launcher restore metadata, visible-impression stamps, and update config/stamps |

If your Claude settings or Codex hooks file cannot be parsed, the CLI refuses to touch it rather than clobber it.

## Failure behavior

Sponsor rendering must never break your coding tool. Claude Code sponsor fetches
run from `UserPromptSubmit`, and rendering happens through `statusLine`. Codex
launch and prompt refreshes update Rebate's sponsor snapshot, and the launcher
draws the current sponsor in the footer row. If a fetch times out, errors, or
returns no fill, Rebate emits no placeholder sponsor and never invents earnings
claims.

## Uninstall

```bash
rebate off
```

This removes Rebate-owned Claude Code settings, restores previous values for keys Rebate touched, restores Rebate-owned Codex hooks and launcher changes, preserves unrelated edits made after install, deletes backups, and removes the `/ad` command. Your device id and any earnings on it remain valid if you later turn Rebates back on.

To also remove local credentials, device id, ad cache, local attribution and
pixel state, and Rebate-owned update state while preserving the installed
binary, run:

```bash
rebate off --purge
```
