# `pathcode`: Path-to-Color Segment Engine ```{py:currentmodule} irix.pathcode ``` Implements the `promptcode` console script and its backing `PathCoder`: a reusable engine that compresses an indexed directory tree (e.g. `_0_nucleus/_2_documents`) into a colored digit spine plus the leaf name, generalizing the `condense_ai_path` zsh function. Rendering is split from the model -- `segments` produces a plain list of `Segment` values, `render` projects them into `zsh` prompt escapes, truecolor `ansi` SGR, or `plain` text. ```{eval-rst} .. automodule:: irix.pathcode :members: ```