# Koshi 0.2.0 — Debug commands (/docs/v0.2/cli/debug)



`koshi debug` prints diagnostics. Both subcommands accept `--format table`
(default) or `--format json`.

## `debug dump-state` [#debug-dump-state]

```bash
koshi debug dump-state
koshi debug dump-state --format json
```

Prints every running session, with its tabs, panes, and clients. Every session
answers this command.

## `debug dump-layout` [#debug-dump-layout]

```bash
koshi debug dump-layout
koshi debug dump-layout --tab <NAME_OR_ID>
koshi debug dump-layout --format json
```

Prints, for each tab: its split tree, the solved rectangles, panes with no room,
stacks, and per-client focus.

Every client viewing one tab shares one set of sizes. The tab solves against the
smallest viewing terminal on each axis, minus the top tab bar row and the bottom
hint row. Two clients on one tab, one 80x24 and one 120x40, both print
`viewport 80x22`.

What is per client is the view: one client tiled and one with a pane fullscreen
give that tab two sets of rectangles. A tab no client is viewing prints its tree
and no rectangles.

## Command arguments are masked [#command-arguments-are-masked]

A pane's command arguments print as `***`; the program name stays visible.

```text
mysql ***
```

A pane running `mysql -pHUNTER2` prints as `mysql ***`. Use
`koshi inspect pane` when you need the command in full.

## Sessions older than this binary [#sessions-older-than-this-binary]

A session that started before you installed this koshi cannot report its
layout. `dump-layout` says so and names what to do: restart that session, or
run `dump-state`, which every session answers.
