src.models and use Python’s standard dataclasses module. Frozen dataclasses (frozen=True) are immutable after construction.
Subsystem
A frozen dataclass describing a logical subsystem within the Claude Code source tree that Claw Code mirrors.Fields
Human-readable subsystem name (e.g.
"query_engine", "tools").Relative path to the subsystem within the source tree.
Number of source files in this subsystem.
Free-text notes about porting status or design decisions.
PortingModule
A frozen dataclass representing a single command or tool that has been mirrored from the Claude Code TypeScript source into the Python port.Fields
Module name as it appears in Claude Code (e.g.
"BashTool", "compact").Short description of what this module does.
Path or identifier in the upstream source that this module mirrors (e.g.
"src/tools/BashTool.ts").Current porting status. Common values:
"planned", "mirrored", "complete".PortingModule is the element type of PORTED_COMMANDS and PORTED_TOOLS, and is returned by functions such as get_tool, get_command, find_tools, and find_commands.
PortingBacklog
A mutable dataclass grouping a set ofPortingModule entries under a named backlog. Used to render the command and tool surfaces in QueryEnginePort.render_summary.
Fields
Display title for this backlog (e.g.
"Command surface", "Tool surface").The list of modules in this backlog.
Methods
summary_lines
PermissionDenial
A frozen dataclass recorded when a tool is blocked by aToolPermissionContext. Appears in TurnResult.permission_denials.
See ToolPermissionContext for the full permission gating reference.
Fields
The name of the tool that was blocked.
Human-readable explanation for why the tool was blocked.
UsageSummary
A frozen dataclass that tracks cumulative token usage across turns.QueryEnginePort maintains one instance and replaces it after each turn via add_turn.
Token counts are approximated using word counts (
str.split()), not a tokeniser. Treat the values as order-of-magnitude estimates rather than precise token counts.Fields
Cumulative word count of all prompts submitted to the engine.
Cumulative word count of all outputs produced by the engine.
Methods
add_turn
UsageSummary instance with the word counts of prompt and output added to the current totals. The original instance is not mutated.
The prompt submitted for this turn.
The output produced for this turn.