<!-- zibby-template-version: 4 -->
# /zibby-memory-remote-use-hosted — switch this project's memory remote to Zibby-managed S3

You are helping the user point their `.zibby/memory/.dolt/` at Zibby's hosted S3 backend, instead of running their own S3 bucket / GCS / DoltHub repo.

Canonical docs: **https://docs.zibby.app/tests/memory**

## What this does

```
Bash(zibby memory remote use --hosted)
```

Allocates a tenant-scoped prefix on Zibby-managed S3 for this project (keyed on the projectId in `.zibby.config.mjs`) and writes that as the local Dolt remote. After this, every `zibby test` run auto-pulls before and auto-pushes after — same as a BYO remote, just without the bucket plumbing.

## Prerequisite: signed in

Hosted remote is **signed-in users only**. Verify:

```
Bash(zibby status)
```

If not signed in, run `zibby login` first. The CLI uses the saved session to derive the tenant prefix; it won't fall back to anonymous.

## When to use hosted vs BYO

| | Hosted (`--hosted`) | BYO (`zibby memory remote add aws://...`) |
|---|---|---|
| Setup time | Zero — `--hosted` and you're done | Provision an S3 bucket, IAM, optional KMS |
| Who can read | Everyone with project access on Zibby | Whoever you grant in IAM |
| Where data lives | Zibby-managed AWS account | Your account |
| Compliance / data-residency | Limited regions | Wherever you want |
| Cost | Included in plan | Your S3 bill |

If the user has any data-residency requirement or a regulated workload, prefer BYO. Otherwise hosted is the path of least resistance.

## Switching from BYO to hosted

`zibby memory remote use --hosted` overwrites the existing remote. If they had a BYO remote and might want to keep its history, run `zibby memory push` against the old remote first so nothing's lost — then switch.

## After switching

1. `zibby memory pull` — seed `.zibby/memory/.dolt/` from the hosted prefix (no-op the very first time per project)
2. `/zibby-memory-stats` — confirm
3. Commit `.zibby.config.mjs` if you set `memorySync.remote: 'hosted'` so teammates auto-wire on next `zibby init`

## Reverting

```
Bash(zibby memory remote remove)
```

Drops the remote — memory becomes local-only again. The data on Zibby's S3 isn't deleted (it's still tenant-scoped), but nothing pushes or pulls until a new remote is configured.

## Related

- `/zibby-memory-pull` — manual pull (auto on test start)
- `/zibby-memory-stats` — verify what's in the local DB
- `zibby memory remote info` — show current remote config
- `zibby memory remote add <url>` — BYO remote (S3/GCS/DoltHub/file:///)
