Pixel Pets for AI Coding Assistants: Plugin-Based Status Visualization

    A pixel pet can make an AI coding assistant’s progress easier to follow without requiring developers to watch a stream of logs. This article covers a three-state design, lifecycle event mapping, terminal rendering with half-block characters, configurable layouts, and plugin setup, with attention to completion signals, subtask filtering, and minimal permissions.

    1. Why Assistant Status Should Be Visible

    AI coding assistants often perform several operations in sequence: reading code, editing files, running tests, and looking up documentation. A single task can take several minutes, leaving developers to choose between watching the screen and switching to something else. Watching consumes attention; looking away makes it easy to miss when the task finishes.

    One straightforward approach is to represent the assistant’s state with a visible character. In one experiment, a developer placed a small pixel character holding a book beside the conversation window. Its behavior changed with the assistant’s status:

    • Idle: It quietly held the book and displayed “Ready when you are.”
    • Working: It looked down and turned pages, while a status line showed the name of the tool currently being called.
    • Done: It raised the book and smiled, then returned to idle after a few seconds.

    Feedback from the experiment suggested that the character’s changes were easier to notice than scrolling logs. A change in expression required little attention but could still be recognized quickly. This points to a practical use for status visualization in developer tools, particularly during long-running asynchronous tasks.

    2. State Machine Design: Three States and Abnormal Endings

    The important part of the pet is not its appearance but the accuracy of the state machine behind it. The design needs only three states:

    1. IDLE → User sends a message → WORKING
    2. WORKING → Normal completion → DONE → Wait a few seconds → IDLE
    3. WORKING → Error or interruption → IDLE

    Three rules keep these states meaningful.

    Make the completion signal reliable

    Raising the book and smiling means the current turn ended normally. If the user interrupts the turn or an error occurs, the character should return directly to idle rather than smile.

    The plugin must therefore distinguish normal completion from abnormal termination. The expression communicates task outcome; it is not merely decoration.

    Follow only the main conversation

    When the assistant delegates work to parallel subtasks, the pet should not change expression in response to those subtasks. Interleaved updates from several workers can make the character flicker and obscure the overall status.

    The principle is simple: bind one indicator to one source of state.

    Show the tool name while working

    In the WORKING state, replace the status text with the name of the current tool or capability. A quick glance should tell the developer whether the assistant is editing files, running commands, or looking up information.

    The time spent in DONE should be configurable. Eight seconds is an example, not a fixed requirement. Only a normal completion event from the main conversation should trigger DONE; subtask completion must not trigger it, and it must not override an abnormal termination.

    3. Terminal Rendering: Half-Block Characters and Adaptive Width

    A desktop client can render image assets directly in a sidebar. Terminals do not have a universal image-display mechanism, so the character needs a text-based representation.

    A common technique uses the upper half-block character, ▀. Each character cell represents two vertically stacked pixels:

    • The foreground color represents the upper pixel.
    • The background color represents the lower pixel.

    This packs two pixel rows into one terminal row. A rendering area 36 columns wide and 16 character rows high can therefore display a complete 36 × 32-pixel half-body portrait.

    The technique relies on terminal support for 24-bit truecolor. Terminals without truecolor support need a fallback to a 256-color palette, with reduced color fidelity. Compatibility is therefore strongest in modern terminals; older environments need a fallback.

    The following Python example illustrates the rendering logic. It omits error handling and frame buffering.

    1. # Illustrative code: rendering logic only
    2. def render_frame(pixels, width, height):
    3. # pixels is a height x width 2D list of RGB tuples; height must be even
    4. lines = []
    5. for y in range(0, height, 2):
    6. parts = []
    7. for x in range(width):
    8. top = pixels[y][x]
    9. bottom = pixels[y + 1][x]
    10. parts.append(
    11. f"\x1b[38;2;{top[0]};{top[1]};{top[2]}m"
    12. f"\x1b[48;2;{bottom[0]};{bottom[1]};{bottom[2]}m▀"
    13. )
    14. lines.append("".join(parts) + "\x1b[0m")
    15. return "\n".join(lines)

    For the sidebar layout, detect terminal width and render the pet conditionally. Once the terminal reaches a threshold—for example, 144 columns—the pet appears in a fixed column beside the conversation. Below that threshold, it hides automatically rather than squeezing the code-editing area.

    The width threshold should be configurable because editor layouts vary considerably.

    4. Plugin Installation and Configuration

    The pet does not change the assistant’s existing capabilities. It only subscribes to lifecycle events and renders in a separate area. It does not inject prompts or modify the assistant’s behavior, and users do not need to configure a persona.

    The steps below use a generic assistant CLI. Consult the official documentation for the actual commands.

    1. Check the assistant version. Confirm that it meets the plugin’s requirements. Version 2.4 or later is an example requirement; the plugin repository’s README is authoritative.

    2. Add the plugin source and enable it.

    1. # Placeholder commands: replace <assistant> and <plugin-repository>
    2. <assistant> plugin add <plugin-repository>
    3. <assistant> plugin enable pixel-pet
    1. Set the display options in the configuration file.
    1. # Example configuration; consult the plugin documentation for actual keys
    2. [pixel_pet]
    3. min_width = 144 # Minimum terminal width for displaying the pet
    4. done_hold_seconds = 8 # Time to remain in the DONE state
    5. show_tool_name = true # Whether to show the tool name while WORKING

    The plugin only needs access to lifecycle events. It does not need file-write or network permissions. If installation requests additional permissions, confirm why they are needed before granting them, following the principle of least privilege.

    5. Event Mapping and Troubleshooting

    The core of the plugin is the mapping between lifecycle events and visual states. The event names below are illustrative; use the events exposed by your assistant.

    Event When it occurs State change Handling requirements
    turn.started The user sends a message IDLE → WORKING Clear any tool name left over from the previous turn
    tool.called The assistant calls a tool Update the status line within WORKING Show only tools from the main conversation
    turn.completed The main conversation turn ends normally WORKING → DONE → IDLE Return to idle after the configured delay
    turn.error Execution fails WORKING → IDLE Do not play the smiling animation
    turn.interrupted The user interrupts execution WORKING → IDLE Do not play the smiling animation
    subagent.* A subtask emits an event No expression change Ignore these events

    When troubleshooting, check the following:

    • The pet does not appear: First check whether the terminal width meets min_width, then confirm that the plugin is enabled.
    • Colors look wrong or washed out: Verify truecolor support. Switch to 256-color mode if necessary.
    • Expressions flicker: Check whether subtask events are affecting the pet. Its state should follow only the main conversation.
    • The task has ended, but the pet still looks busy: Check whether handlers for error or interruption events are missing.