Skip to main content

Module inspector

Module inspector 

Source
Expand description

The session’s own facts: its header and the sections an inspector draws from it.

Each is held by the core from the same event the matching SessionUpdate is built from, so this hands over what the core has rather than deriving anything: a view reads the session instead of folding the update stream a second time.

Re-exports§

use forge_primitives::git_diff::PrRefresh; 🔒
use forge_primitives::runtime::AvailableModel; 🔒
use forge_primitives::CurrentModel; 🔒
use forge_primitives::EffortLevel; 🔒
use forge_primitives::MonitorRecord; 🔒
use forge_primitives::PermissionMode; 🔒
use forge_primitives::SessionId; 🔒
use forge_primitives::SessionSlot; 🔒
use crate::surface::ViewSurface; 🔒

Structs§

ContextUsage
How full the session’s context window is, from the bridge’s last answer. Both halves are Option because the upstream probe reports them independently.
McpServers
The MCP servers a session’s bridge last reported, and the failure standing beside them when the read did not complete.
ProcessEntry
One descendant process the scanner found alive. Field shape is driven by what a view’s process row builder needs (PID + cmdline + memory for the metadata line) + the cmdline-matching needed for wire-tracked overlay (process_cmdline_matches_tool_input).
ProcessSnapshot
Snapshot of claude’s descendant processes at one point in time. Always succeeds - failures (sysinfo errors, process gone) collapse to an empty processes vec.
SessionHeader
What a session header states about the session.
WorkSnapshot
A seat’s last scan of its working tree, and when it was taken.

Functions§

basename_exe
Strip the executable’s directory from a cmdline headline so the row reads cargo nextest run, not /opt/homebrew/bin/cargo nextest run. Only the FIRST token (the executable) is basenamed; args are kept verbatim (they carry the distinguishing detail). A first token with no / (e.g. a postgres: walwriter process title) is unchanged.
extract_inner_command
Unwrap a shell-wrapper cmdline to the user command inside it. Recognizes the shape claude wraps Bash tool calls in (captured via ps -axww): /bin/zsh -c source <snapshot> ... && eval '<CMD>' < /dev/null && pwd -P >| /tmp/claude-<hash>-cwd. The inner command is single-quoted between eval ' and ' < /dev/null. Returns None when cmdline is not a recognized wrapper (non-shell processes pass through unchanged at the call site).
measurement_of 🔒
The measurement a refresh’s own answer represents: its state, the instant it was established, and git’s words when it could not run.