Enable debug mode
Turn on debug mode in any of the following ways:- In
/settings, enable Debug mode (saves the globaldebugsetting). - On the command line, pass
--debugfor one run. - In your environment, set
ATOMIC_DEBUG=1(legacyPI_DEBUG=1; see Environment variables). - Over remote procedure call (RPC), send
set_debug({"type": "set_debug", "enabled": true}, which leaves saved settings unchanged).
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.~/.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, andmupdf-diagnostic), whether or not debug mode is on, each cut to 2,000 characters with common credential formats redacted.
Find what freezes the UI
If the interactive UI stalls and keystrokes or streamed output appear late, setATOMIC_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:
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 (legacyPI_* 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:
LOG_FILE_PATH: the destination file or directory for raw terminal output, such as/tmp/tui-ansi.log.
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-processto 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_PATHat a locally built.nodebinary (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(legacyPI_TIMING=1) to print startup timings andatomic --sessionresume timings to stderr (Inspecting snapshots). - Set
ATOMIC_STARTUP_TRACE=<path>(legacyPI_STARTUP_TRACE, for example/tmp/atomic-startup.jsonl) to append JSONL startup milestones with wall-clock timestamps. The file also records every stepATOMIC_TIMINGprints, such as resume steps, from both the TUI and its background session process.
- 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.
Next steps
Explore related configuration and diagnostic references:- Environment variables: complete list of diagnostic and performance environment variables.
- Settings: configure persistent debug settings in
settings.json. - Configure your terminal: resolve terminal input, clipboard, and rendering issues.