---
url: https://clusto.app/docs/mobile-diagnostics.md
description: Capture and inspect persistent Clusto frontend diagnostics on mobile devices.
---

# Mobile Diagnostics

Clusto keeps a persistent frontend diagnostics log inside the app so mobile-only issues can be debugged without attaching a remote inspector.

## Where To Look

* Open the app and go to **Logs**.
* Use the **Frontend** tab for Vue/WebView/xterm/mobile lifecycle diagnostics.
* Use the **App** tab for Rust/Tauri backend logs (native app only; the web client shows a note instead).
* Use the **Daemon** tab for logs streamed from the connected `clustod` node.

## What The Frontend Log Captures

* App startup environment: user agent, touch capability, viewport metrics, keyboard inset.
* Viewport and virtual-keyboard adjustments from `window`, `visualViewport`, and focus events.
* Resume / reconnect handling: blur, focus, visibility changes, websocket probe decisions, and session recovery.
* Terminal lifecycle: attach, detach, dispose, focus ownership changes, PTY resize sends, and forced resize resyncs.
* IME / suggestion handling in the xterm helper textarea, including direct
  Backspace routing after the local mirror reaches its beginning.
* Session history timing and replay decisions.
* Unhandled browser errors and promise rejections.
* Existing `console.*` output from the frontend, persisted into the same log ring buffer.

## Toolbar Actions

* **Copy** copies the currently displayed (and filtered) log lines to the clipboard. Available on every tab.
* **Clear** is available on the **Frontend** tab, and on the **App** tab in the native app:
  * On the **Frontend** tab it wipes only the in-memory frontend diagnostics log.
  * On the **App** tab it deletes the `clusto-app.log.*` files on disk. The active file may keep filling until the next daily rollover or app restart.
* The **Daemon** tab has no Clear button - those logs live on the remote `clustod` node.

## Retention

* The frontend diagnostics log is stored in browser storage as a bounded ring buffer of the most recent 1500 entries. Fields that look like tokens, passwords or keys are redacted before they are stored.
* It typically survives normal app reloads/restarts on mobile because it is not held only in memory.

## Practical Debug Flow

1. Reproduce the mobile issue.
2. Open **Logs → Frontend**.
3. Search for one of:
   * `viewport`
   * `connection`
   * `terminal`
   * `session-history`
   * `terminal-ime`
   * `pty-input`
4. Correlate those timestamps with the **App** or **Daemon** tabs when needed.

## Pulling The Buffer From The CLI

When you can't (or don't want to) open the app to read logs - phone is locked, app is on a slow link, you want a saveable dump - fetch the same buffers from any machine that has the `clusto` CLI and the daemon's token:

```bash
clusto clients ls                                            # find app connection_id and node IDs
clusto logs frontend --client <connection-id> --lines 1500   # entire Vue diagnostics buffer
clusto logs app --client <connection-id> --lines 2000        # Rust-side app log
clusto logs daemon --lines 1000                              # daemon log of the connected node
```

See [Remote Log Fetch](/remote-log-fetch) for the full command reference, wire protocol, and limits.
