Skip to content

Inspector

The Inspector is a new app. It does not change a built-in tool: it runs in its own tab and reads the session transcripts from disk. It follows the steps in Write a new app. Its source is in examples/inspector in the hub repository.

For the open session, the Inspector shows:

  • The title, the branch, the model, and the counts of turns, tool calls and failed calls.
  • A chart of the context size after each turn. A line marks each compaction.
  • Each turn: the prompt, the tool calls that followed it, the tokens and the time. The reply of the turn shows as markdown. A long prompt or reply shows only its start; Show the full prompt and Show the full reply open all of it.
  • A card with the tools that the session used, with a count and the failed calls for each: the skills, the built-in tools (such as Bash or Artifact) and the MCP tools, grouped by MCP server. The card shows only when the session used one. Close it with Esc or ✕, and open it again from its chip.

Click a tool call to see its input and its result in a panel at the right. Errors only shows only the turns and the tool calls that failed:

Newest first puts the last turn at the top. The chart does not change with either option.

Key Action
j, k The next or the previous turn
g, G The first or the last turn
o Open a different session
r Read the transcript again
t Change between light and dark
? Show the help

The Inspector follows the hub theme in light and dark mode:

With How
Kanban Kanban publishes session.changed when you open a session. The Inspector subscribes to it and opens the same session
Any tool The manifest declares the action session.inspect. A tool calls hub.invoke('session.inspect', { session }) to open a session in the Inspector
Cost The Cost button calls hub.invoke('session.cost', { session }). It shows only when hub.can('session.cost') is true
The hub bindTheme and onThemes for the theme, onActive to reload when the tab comes on screen, openExternal for links

See step 4 of Write a new app for the code.

The page uses these routes. Each reads the transcript from <CLAUDE_CONFIG_DIR>/projects:

Route Returns
GET /api/sessions/:id The session overview: the turns, the tool calls and the token use. It sends an ETag, so a reload of a session that did not change gets 304
GET /api/sessions/:id/tools/:toolId The input and the result of one tool call
GET /api/sessions/:id/turns/:n/reply, /prompt The full reply or the full prompt of one turn

?encoded= with the project folder name finds the file faster. Without it, the server looks in each project folder.

In a clone of the hub, install the app:

Terminal window
npm install --prefix examples/inspector

Add it to the apps list in ~/.claude-hub/config.json, after the built-in tools:

{
"apps": [
{ "id": "kanban" },
{ "id": "marketplace" },
{ "id": "cost" },
{ "id": "memory" },
{ "id": "inspector", "path": "C:/dev/claude-code-hub/examples/inspector" }
]
}

Restart the hub. The Inspector is the fifth tab, Alt+5.

To run it alone, run npm start in examples/inspector and open http://localhost:3545.