# Focus mode and session size

> Record only the apps and hosts you're working on, mute noisy hosts or whole domains, and choose how many requests and how many days of traffic Cloak Proxy keeps.

Source: https://docs.subcloak.com/cloak-proxy/capture/focus-and-retention/

Added in Cloak Proxy 0.5.4.

Left running for days, a proxy that records everything gets heavy. Cloak Proxy gives you three ways to keep it light:
focus on the few apps and hosts you're working on, mute the noise you never want, and cap how much traffic the session
keeps. All three last across launches.

## Focus mode

(added in Cloak Proxy 0.5.4)

Focus mode records only the apps and hosts you pick. Everything else still goes through Cloak Proxy, untouched: it isn't
decrypted, no rules apply to it, and it isn't listed. Apps and sites outside the focus keep working; they just don't
fill the session.

*[Screenshot: The main window focused on Safari and *.example.com, with the Focus banner over the list]*

### Focus on some apps or hosts

- **From the sidebar:** right-click an app, a device or a host and choose **Focus on _name_**.
- **From the traffic list:** select one or more requests, right-click, and choose **Focus on These** › their apps, their
  hosts, or **Apps and Hosts**.
- **From the toolbar:** click **Focus**, tick the apps and hosts you want (type a host or `*.example.com` to add one that
  hasn't sent anything yet), then click **Focus**.

*[Screenshot: The Focus picker: apps and hosts with checkboxes, and a field to add a host]*

While focusing, a banner over the list says what's in focus and how many requests weren't recorded:
**Focused on ShopApp, \*.example.com · 1,204 not recorded**. **Stop Focusing** records everything again; **Edit…**
changes the focus. The toolbar's **Focus** button is highlighted while focus is on.

To add to the focus, right-click another app or host and choose **Add _name_ to Focus**; **Remove _name_ from Focus**
takes one out. **Focus Only on _name_** replaces the focus.

| | |
|---|---|
| Apps | Matched by name, ignoring case, as muting matches them. A device's address focuses on every app on it. |
| Hosts | `api.example.com`, or `*.example.com` for the domain and every subdomain. |
| Apps and hosts together | A request is recorded when its app **or** its host is in focus. |
| Remembered | Focus stays on when Cloak Proxy quits and opens again, until you stop it. After **Stop Focusing**, the toolbar's Focus picker still has the last list ticked, so turning it on again takes two clicks. |
| Connections open when focus starts | Decrypted connections outside the focus close gracefully and reconnect untouched, as when recording pauses. When focus stops, connections passed through only because of it reconnect and are decrypted as usual. |

> **Tip:**
> Focus is a lighter way to do what the [Allow List](https://docs.subcloak.com/cloak-proxy/tools/allow-list/) does for whole apps and hosts:
> traffic outside it isn't even decrypted. Keep the Allow List for rules on paths, methods or bodies.

## Mute a host or a domain

(added in Cloak Proxy 0.5.4)

Muting works for hosts as it does for apps: their requests go through Cloak Proxy and your tools but aren't listed.
Right-click a host in the sidebar, or a request, and choose **Mute** › **Mute _host_** or **Mute \*._domain_** (the
domain and every subdomain).

Muted apps and hosts are listed together in **Settings › General › Muted apps and hosts**, with **Unmute** for each.

> **Tip:**
> For a noisy host you never need (telemetry, ads, update checks), **Bypass** is lighter still: it skips Cloak Proxy
> entirely, so it costs no CPU at all. Choose **Mute › Bypass \*._domain_ Instead**, or **Move to Bypass** in Settings.
> Bypass applies when the macOS proxy is next turned on (see [Network settings](https://docs.subcloak.com/cloak-proxy/capture/network-settings/)).

## How much traffic is kept

(added in Cloak Proxy 0.5.4)

**Settings › General › Capture** has two limits:

| Setting | Choices | Default |
|---|---|---|
| **Keep the last** | 50,000 / 100,000 / 250,000 / 500,000 requests | 100,000 |
| **Keep requests for** | 1 day / 3 days / 7 days / Never | 7 days |

*[Screenshot: Settings › General: Keep the last 100,000 requests, Keep requests for 7 days, and the muted apps and hosts]*

Past either limit, the oldest requests are removed a batch at a time in the background, with their bodies' files on
disk. Requests you **highlighted**, **commented** or added to **[Findings](https://docs.subcloak.com/cloak-proxy/security/findings/)** are always
kept. The status bar then says **Trimmed 12,000 old requests**; click it to open the setting, or the **×** to dismiss it.
Requests from a file you open (a HAR, a saved session) count their age from when you opened it, so last month's capture
isn't trimmed the moment it loads.

Each request takes about 8 KB of memory, so 100,000 requests use about 1 GB (bodies beyond 64 MB live on disk). The
defaults suit a laptop: at a steady two requests a second, 100,000 requests is about 14 hours of traffic, and the week
limit means Friday's requests are still there on Monday. Raise the limit for long captures on a machine with memory to
spare, or use focus mode so only the traffic you care about counts.

> **Note:**
> Upgrading from 0.5.3 or earlier, the new defaults apply: a saved session larger than 100,000 requests is trimmed to it
> once it has loaded, and the status bar says how many went. Choose 500,000 in Settings to keep what earlier versions
> kept. However the settings are set, Cloak Proxy never holds more than 600,000 requests.

## Automate it

| | cloakctl | MCP tool |
|---|---|---|
| Focus | `cloakctl focus set --app ShopApp --host '*.example.com'`, `cloakctl focus add\|remove …`, `cloakctl focus off`, `cloakctl focus on` | `set_focus` |
| Mute a host | `cloakctl mute host ads.example.com [--domain]`, `cloakctl unmute host …` | `mute_host` |
| Mute an app | `cloakctl mute app Slack`, `cloakctl unmute app Slack` | `mute_app` |
| Retention | `cloakctl retention [--requests 250000] [--days 3]` | `set_retention` |

`cloakctl status` and the `proxy_status` tool include the focus and the limits.

## Related

- [Recording and sessions](https://docs.subcloak.com/cloak-proxy/capture/recording-and-sessions-basics/): pause, mute apps, clear, keep sessions
- [Allow List](https://docs.subcloak.com/cloak-proxy/tools/allow-list/)
- [Network settings](https://docs.subcloak.com/cloak-proxy/capture/network-settings/): Bypass
