debuganything

v1.1.0
io.github.shreyassaw5394/debuganything Checked 2 days ago Published 29 days ago

Observe any running process from your agent.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

readiness readiness

Report OS, arch, which providers (strace, py-spy, perf, lsof, tcpdump, gdb/lldb, docker...) are usable, what is missing and how to install it, and permission status (ptrace_scope, sudo, SIP). Always call this first.

attach attach

Resolve a target (pid, container, k8s pod, or a command to spawn under capture) and open a session. Returns session_id used by every other tool. Attaching to a pid, container or pod modifies nothing; kind: "command" spawns the given program.

ParameterTypeDescription
target *stringpid, container name/id, k8s pod (ns/name), or a command line (with kind=command)
kindstringDefaults to auto-detect: numeric → pid, ns/name → pod, else container. Spawning a command requires kind: "command".

detach detach

Stop any running captures for the session, finalize the report, keep artifacts under ~/.debuganything/sessions/<id>/.

ParameterTypeDescription
session_id *string

list_processes list_processes

ps-style list (pid, comm, cpu, mem, user, container) for picking a target. Optional substring filter.

ParameterTypeDescription
filterstringSubstring match on command / args / user
limitinteger

trace_syscalls trace_syscalls

Linux strace of the target for N seconds: top syscalls by total time and count, slowest individual calls, error counts (ENOENT/EAGAIN/ECONNREFUSED...), blocked waits. Raw log saved as artifact.

ParameterTypeDescription
session_id *string
categoriesarray
duration_sinteger

profile_cpu profile_cpu

CPU profile for N seconds: py-spy (Python), perf (native/Node on Linux), sample (macOS). Returns top frames (self/total), hottest stacks, flamegraph.svg artifact.

ParameterTypeDescription
session_id *string
consentboolean
duration_sinteger

dump_stacks dump_stacks

Instant snapshot of every thread's stack (py-spy dump / gdb / lldb / Node inspector). The key tool for hangs and deadlocks; flags threads waiting on the same lock. Node targets without --inspect need consent: true (SIGUSR1 opens the inspector until the process exits).

ParameterTypeDescription
session_id *string
consentbooleanNode targets without --inspect: required to send SIGUSR1, which leaves Node's inspector open on 127.0.0.1 until the process exits. Ask the user first.

inspect_sockets inspect_sockets

lsof/ss view of the target: listening ports, established connections grouped by remote, states (CLOSE_WAIT pileups, TIME_WAIT counts), fd count vs ulimit.

ParameterTypeDescription
session_id *string

inspect_files inspect_files

Open file descriptors by type, growth over a short window, largest open files, deleted-but-open files (disk full but nothing there).

ParameterTypeDescription
session_id *string
window_sintegerObserve fd growth over this many seconds (0 = single snapshot)

capture_traffic capture_traffic

tcpdump scoped to the target's ports for N seconds (max 30). Per-remote bytes/packets, retransmits, RSTs, DNS queries, TLS SNI. .pcap artifact. REQUIRES consent: true — ask the user first.

ParameterTypeDescription
session_id *string
consentbooleanRequired. Packet capture may contain secrets; ask the user first.
duration_sinteger
filterstringExtra BPF filter ANDed with the target's ports

snapshot_memory snapshot_memory

RSS/VSZ sampled over a window; Node: heap snapshot with top retainers by retained size; Python: py-spy dump (locals: true adds variable values). Node targets without --inspect need consent: true (SIGUSR1 opens the inspector until the process exits). Take two and diff_runs them to find what grows.

ParameterTypeDescription
session_id *string
consentbooleanNode targets without --inspect: required to send SIGUSR1, which leaves Node's inspector open on 127.0.0.1 until the process exits. Ask the user first.
heapbooleanTake a heap snapshot where supported (Node). Set false for metrics only.
localsbooleanPython: include local variable values in the stack dump (may contain user data or secrets). Off by default.
window_sintegerSample RSS over this many seconds

diff_runs diff_runs

Diff two prior runs of the same tool in this session (e.g. snapshot_memory#1 vs snapshot_memory#2, profile_cpu#1 vs #2): what grew, appeared, disappeared.

ParameterTypeDescription
a *stringrun id of the earlier result; '<session_id>:<run>' reads a baseline run from another session (e.g. a recorded healthy run)
b *stringrun id of the later result; '<session_id>:<run>' works here too
session_id *string

container_info container_info

docker inspect/stats/top/logs tail for the target container, host pid mapping, cgroup limits: throttled? OOM-killed before? restarts?

ParameterTypeDescription
session_id *string

report report

Markdown report of the whole session: findings, evidence excerpts, artifact paths. Optionally written to a .md file inside the current directory or the session directory.

ParameterTypeDescription
session_id *string
htmlbooleanAlso render a self-contained report.html (shareable: ranked findings, expandable evidence, embedded flamegraphs)
outstringOptional path to also write the markdown to

import_artifact import_artifact

Analyze raw tool output you captured yourself (e.g. `sudo strace …`, `sudo fs_usage …`, `perf script`, `py-spy dump`, `lsof -F`, `tcpdump -nn -tt -r`) and turn it into the same evidence and findings Debug Anything would produce. Use when Debug Anything could not run the tool (no root, macOS).

ParameterTypeDescription
path *stringPath to the raw output file you captured yourself (e.g. with sudo)
session_id *string
tool *stringWhat produced the file
duration_sintegerHow long the capture ran, when the file has no timestamps (profiles)