CSS Classes for Message Types

June 11, 2026 · View on GitHub

See application_model.md for the system overview.

This document provides a comprehensive reference for CSS class combinations used in Claude Code Log HTML output, their CSS rule support status, and pairing behavior.

Generated from analysis of: 29 session HTML files (3,244 message elements) Last updated: 2025-12-07


Quick Reference

Support Status Legend

StatusMeaning
✅ FullHas dedicated CSS selectors for this combination
⚠️ PartialInherits from parent selectors only
❌ NoneNo CSS rules found

Base Message Types

TypeDescriptionCSS Support
assistantAssistant response✅ Full
bash-inputBash command input✅ Full
bash-outputBash command output✅ Full
imageUser-attached image✅ Full
session-headerSession header divider✅ Full
systemSystem message (user-initiated)✅ Full
system-away-summaryAway-summary recap✅ Full
system-errorSystem error (assistant-generated)✅ Full
system-infoSystem info message✅ Full
system-warningSystem warning (assistant-generated)✅ Full
thinkingExtended thinking content✅ Full
tool_resultTool result (success)✅ Full
tool_useTool use message✅ Full
userBasic user message✅ Full
unknownUnknown message type❌ None

Modifier Classes

ModifierApplied ToDescription
compacteduserCompacted conversation summary
command-outputuserSlash command output content
errortool_resultTool execution error
memorytool_use, tool_resultAuto-memory interaction: Read/Write/Edit on a ~/.claude/projects/<slug>/memory/ path (#192). Drives the 🧠 title, the memory filter toggle, and the timeline memory lane.
pair_firstVariousFirst message in a pair
pair_lastVariousLast message in a pair
pair_middleVariousMiddle message (never used so far)
sidechainVariousSub-agent (Task) message. The sidechain block under its spawning tool_result is framed by a single tool-green group line + 2em indent — the line continues the spawning card's border color (same pairing principle as the workflow phase/agent group lines).
slash-commanduserExpanded slash command prompt
steeringuserUser steering via queue operation
system-infosystemSystem info level
system-hooksystemHook execution summary
system-away-summarysystemAway-summary recap (left-aligned, narrative)
workflow_phasetool_useSpliced dynamic-workflow phase card (#174). The tool_use base keeps it under the "Tool Use" filter toggle; the modifier drives the depth-driven indent + dark-green card/group border, the 🧩 title, and a dedicated timeline lane.
workflow_agenttool_useSpliced dynamic-workflow agent card (#174). Same pattern as workflow_phase (grey card/group border, 🤖 title, own timeline lane). Its .children container indents the agent's grafted side-channel transcript one level further.

Pairing Behavior

Message pairing creates visual groupings for related messages. The pair_first and pair_last classes control styling of paired messages.

Pairing Rules by Type

Base TypeCan Be pair_firstCan Be pair_last
assistantNoYes
bash-inputYesNo
bash-outputNoYes
systemYesYes
thinkingYesNo
tool_resultNoYes
tool_useYesNo
userNoYes

Common Pairing Patterns

First MessageLast MessageLinked By
tool_usetool_resulttool_use_id
bash-inputbash-outputSequential
thinkingassistantSequential
user (slash-command)user (command-output)Sequential
system (system-info)system (system-info)Paired info

All Class Combinations by Support Level

✅ Full Support (25 combinations)

These combinations have dedicated CSS selectors:

CombinationDescriptionOccurrences
assistantAssistant response419
assistant Assistant (paired with thinking)104
assistant sidechainSub-assistant response73
bash-inputBash command input5
bash-outputBash command output5
imageImage content(rare)
session-headerSession header divider29
systemSystem message (user-initiated)20
system system-hookHook summary message(rare)
system-errorSystem error (assistant-generated)(rare)
system-infoSystem info message118
system-warningSystem warning (assistant-generated)(rare)
thinkingThinking content199
thinking pair_firstThinking (first in pair)104
thinking sidechainSub-assistant thinking(rare)
tool_resultTool result (success)863
tool_result errorTool result (error)83
tool_result sidechainSub-assistant tool result83
tool_useTool use message946
tool_use sidechainSub-assistant tool use84
userBasic user message88
user command-outputSlash command output19
user compactedCompacted user conversation(rare)
user slash-commandSlash command invocation20
user steeringOut-of-band steering input(rare)

⚠️ Partial Support (7 combinations)

These combinations inherit from parent selectors but have no dedicated rules:

CombinationDescriptionInherits From
assistant pair_lastAssistant (last in pair).assistant, .
tool_result error sidechainSub-assistant tool error.tool_result, .error, .sidechain
unknown sidechainUnknown sidechain type.sidechain
user compacted sidechainCompacted sidechain user.user, .compacted, .sidechain
user sidechainSub-assistant user prompt (deprecated).user, .sidechain
user slash-command sidechainSidechain slash command.user, .slash-command, .sidechain
user command-output pair_lastCommand output in pair.user, .command-output

❌ No Support (1 combination)

CombinationDescriptionNote
unknownUnknown message typeFallback type - should rarely appear

Fold-Bar Support

The fold-bar component uses data-border-color attribute to style borders based on message types. Below shows which combinations have dedicated fold-bar styling.

Has Fold-Bar Styling (27 combinations)

  • assistant
  • assistant sidechain
  • bash-input
  • bash-output
  • image
  • image sidechain
  • session-header
  • system
  • system-away-summary
  • system-error
  • system-info
  • system-warning
  • thinking
  • thinking sidechain
  • tool_result
  • tool_result error
  • tool_result error sidechain
  • tool_result sidechain
  • tool_use
  • tool_use sidechain
  • unknown
  • unknown sidechain
  • user
  • user command-output
  • user compacted
  • user compacted sidechain
  • user sidechain
  • user slash-command
  • user slash-command sidechain

Missing Fold-Bar Styling (5 combinations)

These combinations appear in HTML but lack dedicated fold-bar border colors:

  • assistant (uses base assistant color)
  • assistant pair_last (uses base assistant color)
  • system system-hook (uses base system color)
  • thinking pair_first (uses base thinking color)
  • user steering (uses base user color)

Detailed Breakdown by Base Type

assistant (596 occurrences, 3 variations)

  • 419× assistant (standalone)
  • 104× assistant pair_last
  • 73× assistant sidechain

bash-input (5 occurrences, 1 variation)

  • bash-input pair_first

bash-output (5 occurrences, 1 variation)

  • bash-output pair_last

system (138 occurrences, 3 variations)

  • 59× system pair_first system-info
  • 59× system pair_last system-info
  • 20× system pair_first

thinking (303 occurrences, 2 variations)

  • 199× thinking (standalone)
  • 104× thinking pair_first

tool_result (1,030 occurrences, 4 variations)

  • 863× tool_result pair_last
  • 83× tool_result error pair_last
  • 83× tool_result pair_last sidechain
  • tool_result error pair_last sidechain

tool_use (1,030 occurrences, 2 variations)

  • 946× tool_use pair_first
  • 84× tool_use pair_first sidechain

user (128 occurrences, 4 variations)

  • 88× user (standalone)
  • 20× user pair_first slash-command
  • 19× user command-output pair_last
  • user pair_last slash-command (unpaired)

Key Observations

  1. Pairing Consistency: Tools (tool_use + tool_result) and bash commands (bash-input + bash-output) always appear as pairs, with pair_first on the input/use side and pair_last on the output/result side.

  2. Thinking-Assistant Pattern: thinking messages that are paired are always pair_first, paired with an assistant message that is pair_last.

  3. Sidechains: The sidechain modifier appears on:

    • assistant messages (73 occurrences)
    • tool_use and tool_result pairs (84 and 84 occurrences respectively)
  4. Error Handling: The error modifier only appears on tool_result messages (84 total error results).

  5. System Messages: Have 3 variations:

    • System info pairs (118 total, always paired)
    • Generic system pairs (20, pair_first)
  6. Slash Commands: User messages with slash-command and command-output pair together:

    • user slash-command (20 occurrences, pair_first)
    • user command-output (19 occurrences, pair_last)
  7. Rare Cases:

    • tool_result with both error and sidechain (1 occurrence)
    • bash-input/bash-output pairs (5 pairs total)

Structural Classes (Not Semantic)

In addition to the semantic classes above, messages include structural classes:

  • Session IDs: session-{uuid} - identifies which session a message belongs to
  • Ancestry Markers: d-{number} - indicates descendant depth in the message tree

These are excluded from semantic analysis but appear in all HTML output.


CSS Selector Statistics

  • Total CSS selectors in templates: 495
  • Message-related selectors: 78
  • Fold-bar combinations: 28
  • Full support combinations: 25
  • Partial support combinations: 7
  • No support combinations: 1

References