Skip to main content
For developers and operators troubleshooting Atomic, this guide explains how to enable debug logging, capture terminal UI snapshots, profile event-loop freezes, verify subsystem health, and collect bug-report diagnostics. To build extensions, custom providers, or SDK integrations, see Build with Atomic; to install Atomic, see Installation. For building Atomic from source or contributing to the repository, see DEV_SETUP.md and CONTRIBUTING.md.

Enable debug mode

Turn on debug mode in any of the following ways:
  • In /settings, enable Debug mode (saves the global debug setting).
  • On the command line, pass --debug for one run.
  • In your environment, set ATOMIC_DEBUG=1 (legacy PI_DEBUG=1; see Environment variables).
  • Over remote procedure call (RPC), send set_debug ({"type": "set_debug", "enabled": true}, which leaves saved settings unchanged).
Confirm that debug mode is active by checking for the debug badge in the footer.
Only the exact value "1" enables debug mode through the environment variable (Atomic ignores true and yes). If "debug": true is saved in ~/.atomic/agent/settings.json, setting ATOMIC_DEBUG=0 doesn’t turn debug mode off for that run; turn off Debug mode in /settings or edit settings.json instead.
When debug mode is active, Atomic appends one JSON line per event to ~/.atomic/agent/atomic-debug.log in the form {"at", "pid", "area", "event", "data"}. The following table describes each diagnostic area recorded in atomic-debug.log: Debug mode logs record IDs, names, counts, and status details—never prompts or conversation text, except what code printed to the terminal (engine-stderr and terminal-output, where console objects render three levels deep with the first 100 array items and first 2,000 string characters). Atomic replaces common credential formats (bearer tokens, JSON Web Tokens (JWTs), GitHub tokens, private key blocks, sk-... API keys, URL credentials, and key, token, secret, or password pairs) with [redacted] and truncates individual text fields at 2,000 characters. Review the log before sharing it because unusual secret formats can still pass through. The Intercom broker and other child processes started while debug mode is on inherit it, and subagents follow it right away. Already-running processes keep the setting they started with until restart. If the debug log can’t be written, Atomic shows one warning and continues (in the chat when the interactive TUI starts or is on screen, and otherwise on stderr as Atomic exits). Extensions and SDK programs can read debug state and append records with the debug output API.

Capture a UI and message snapshot (/debug)

Run /debug (an unlisted slash command) or press Shift+Ctrl+D anywhere in the TUI (regardless of which element has focus) to append a plain-text diagnostic snapshot to ~/.atomic/agent/atomic-debug.log. Each snapshot records the following items:
  • Timestamp, terminal dimensions (columns x rows), and total rendered line count.
  • Every rendered TUI line, JSON-escaped with ANSI codes and visible widths.
  • All messages in the session context as JSON Lines (JSONL), completely unredacted.
  • The most recent 200 records of log and warning output kept off the screen (terminal-output, engine-stderr, and mupdf-diagnostic), whether or not debug mode is on, each cut to 2,000 characters with common credential formats redacted.
/debug and Shift+Ctrl+D write all messages in the session context completely unredacted—including prompts, file contents, tool outputs, and any credentials in your conversation—into ~/.atomic/agent/atomic-debug.log. Atomic never trims or rotates this file. Delete atomic-debug.log before reproducing an issue, and review and redact it before sharing.

Find what freezes the UI

If the interactive UI stalls and keystrokes or streamed output appear late, set ATOMIC_EVENT_LOOP_BLOCK_MS to the shortest stall duration in milliseconds you want to capture, reproduce the stall, and quit cleanly:
ATOMIC_EVENT_LOOP_BLOCK_MS must be a positive whole number (1 or greater); Atomic ignores "0", negative numbers, decimals, and non-numeric values and starts no monitor. Interactive sessions log both the terminal UI process (role: "host") and the background session worker (role: "engine") to ~/.atomic/agent/event-loop-blocks.jsonl. Single-process runs write only role: "host". Override the path with ATOMIC_EVENT_LOOP_BLOCK_LOG (relative paths resolve from the startup working directory). If the file can’t be written at startup, Atomic prints one warning and skips monitoring. The following table describes each record type in event-loop-blocks.jsonl: Quit Atomic cleanly, close the terminal or console window, or sign out of Windows so the final shutdown delay summary flushes to disk. Block records contain function names and source paths—never prompts or message text. Atomic never trims event-loop-blocks.jsonl, so delete it before reproducing a fresh issue. The monitor checks the event loop every 20 ms, tracks delay histograms at 10 ms resolution, and samples CPU stacks every 2 ms using a sampling profiler instead of debugger pauses. A debugger; statement doesn’t pause Atomic while monitoring is active, and an attached debugger keeps control of its own breakpoints. Because CPU sampling adds some overhead, pass ATOMIC_EVENT_LOOP_BLOCK_STACKS=0 (must be exact "0"; "false" leaves stacks enabled) when measuring raw latency:
In delay-only mode, start records report stacks: "disabled" and block records have zero samples, while Atomic still records every stall duration and delay summary.

Capture terminal rendering diagnostics

Use three environment variables to capture raw terminal output and main-screen redraw logs (legacy PI_* aliases work when the ATOMIC_* variable is unset; see TUI debug logging and Environment variables). The following table lists each terminal rendering diagnostic variable: Run the following command to record the raw ANSI output stream to a file:
Replace the following:
  • LOG_FILE_PATH: the destination file or directory for raw terminal output, such as /tmp/tui-ansi.log.
Terminal output logs contain everything painted to your screen, including prompts, code, and tool outputs. Review and redact captured terminal logs before sharing them.

Check subsystem health and native modules

Before collecting full traces, verify the health of individual subsystems. The following table lists built-in health checks and what each one verifies: For process-spawning or native-module errors, use the following workarounds:
  • Fallback process spawning: Set ATOMIC_HOST_SPAWN=child-process to launch helper processes (Git snapshots, rg, fd, worktree setup, and standalone shell commands) through standard Node child spawning instead of Atomic’s native spawner (Environment variables).
  • Native add-on load failure: Check Package manager troubleshooting, or point NAPI_RS_NATIVE_LIBRARY_PATH at a locally built .node binary (which bypasses Atomic’s exact release version check).

Collect document conversion diagnostics

Diagnostics from document conversion (.pdf, .doc, .docx, .ppt, .pptx, .xls, .xlsx, .rtf, and .epub) appear in tool error results when conversion fails. Interactive sessions keep them—and anything else the background session worker writes to stderr—out of the chat: they go to the debug log while debug mode is on. Other modes write them to stderr or console output, and RPC clients receive them separately from JSON responses. Long or noisy diagnostics might truncate. When reporting a document conversion issue, copy the conversion error along with the mupdf-diagnostic and engine-stderr records from atomic-debug.log.

Profile startup timing and file a bug report

Use the following environment variables to profile slow startup or session resume (see Environment variables):
  • Set ATOMIC_TIMING=1 (legacy PI_TIMING=1) to print startup timings and atomic --session resume timings to stderr (Inspecting snapshots).
  • Set ATOMIC_STARTUP_TRACE=<path> (legacy PI_STARTUP_TRACE, for example /tmp/atomic-startup.jsonl) to append JSONL startup milestones with wall-clock timestamps. The file also records every step ATOMIC_TIMING prints, such as resume steps, from both the TUI and its background session process.
Inside Atomic, run /skill:feedback <summary> to draft a bug report automatically. It investigates the failure, scrubs private details from the Markdown draft, and lets you review it before posting to GitHub through your authenticated gh CLI (see Bundled skills).
When filing a bug or startup issue manually, include the following details:
  • Your OS and version.
  • Your terminal emulator (and tmux or Herdr version if applicable).
  • Your installation method (npm or package manager, self-contained release archive, or standalone binary).
  • Output of atomic --version.
  • Relevant redacted diagnostic logs.
If you installed from a self-contained release archive, keep the archive’s complete directory structure intact so Atomic can locate its bundled assets and native module. For dependency versions and official release downloads, see Installation.

Next steps

Explore related configuration and diagnostic references: