Three-State Visualization Plugin for AI Coding Assistants: Building a Companion Pet
This article walks through building a three-state companion pet plugin for AI coding assistants. It covers why a "does-nothing" tool can be more useful than it sounds, the state machine that maps idle, working, and just-finished poses to session lifecycle events, and the rendering approach that turns one asset into two presentations: pixel art for GUI clients and half-block characters for pure terminals. It also explains plugin integration, avatar replacement, and three transferable design lessons about perceptibility, low learning cost, and text-based visualization. Readers will come away with a concrete pattern for making long-running AI workflows legible at a glance.
1. Where This Came From: Building Something That “Does Nothing”
Now that using AI to write code has become part of the daily routine, I’ve built several small tools with it, all starting from a “gets the work done” mindset: generating documentation, tidying up code, batch-processing tasks. But once the feature was finished and the code was published, almost nothing happened.
The one time a stranger copied my code and kept building on it was a plugin I made for the command-line interface of an inference tool—one that swapped the background image. By “copied the code” I mean someone saved a copy of the repository’s code as their own and continued modifying it on that copy. That plugin did no real work; it just changed the interface background to a different image. Yet it drew a fair amount of attention in the repository, and someone even copied it. It was the first time a stranger had copied my code, and it felt quite different.
Looking back and comparing the two, maybe the issue isn’t “whether it’s useful” but “whether it can be understood at a glance and costs zero to learn.” Tools that get work done require the audience to first grasp what problem they solve before deciding whether to use them; a background-swapping plugin is clear from a single screenshot. So this time I took a different approach: instead of building something that gets work done, build something that “keeps company”—and build it for the most widely used AI coding assistant.
1. First, Define the Problem to Solve
This kind of coding assistant receives instructions inside a terminal or a desktop app, then calls tools—reading files, retrieving content, running commands—to advance step by step until it produces a full response. While it works, the interface usually shows only a scrolling log, so it’s hard to tell how far along it is: is it retrieving, running tests, or has it already written the changes? A companion character that stays present throughout can “translate” this process into an action you understand at a glance.
I set four design constraints:
- No interference: it doesn’t generate code, modify the conversation, or change tool behavior.
- Zero configuration: install and go, with no need to train a persona or repeatedly tune prompts.
- Visible state: at minimum, distinguish “idle,” “working,” and “just finished.”
- Replaceable appearance: no lock-in—anyone can swap in their own character.
2. The State Model: Three Poses for Three Meanings
The pet is a chibi character holding a book, sitting beside the conversation. I mapped her poses one-to-one with the conversation lifecycle, keeping only three states:
| State | Pose | Extra info | Meaning |
|---|---|---|---|
| Idle | Holding the book | “Waiting for you to speak” below | Session is ready, waiting for input |
| Working | Looking down, reading the book | Shows the tool the assistant is currently using | This round is running |
| Just finished | Holding the book up, smiling | None | This round ended normally |
The design logic behind these three states:
- Idle must be “quiet but present”: the few words “Waiting for you to speak” act like the conversation’s standby indicator. The pet never appears inside the response text, never interrupts reading, and just sits to the side.
- Working must “explain what’s happening”: looking down and reading the book means “busy,” and the tool name below answers “busy with what.” If it’s calling a file-reading tool, for example, that means it’s inspecting the project’s contents. No need to stare at the log—a glance out of the corner of your eye tells you what this step is doing.
- Finished must be “clear without being wordy”: when the response ends, she lifts the book and smiles. After 8 seconds she automatically returns to idle, rather than holding the “finished” state indefinitely.
The most critical part here is how “finished” is judged:
- When a round is interrupted by the user, or when an error occurs during execution, she won’t smile—she goes straight back to idle;
- When the assistant spawns sub-agents to run tasks in parallel, she doesn’t change expression either—she only tracks the main conversation.
So only when you see her holding the book up and smiling can you be sure the round truly finished. The three states thus form a simple state machine: exceptions and cancellations all return to idle, and parallel tasks don’t trigger the finished state.
The core logic of the state machine can be expressed as event-driven pseudocode:
from enum import Enum, autoclass State(Enum):IDLE = auto() # Idle: holding the bookWORKING = auto() # Working: looking down, readingDONE = auto() # Just finished: holding the book up, smilingdef next_state(current: State, event: str, scope: str = "main") -> State:"""Derive the next state from conversation events; scope distinguishes main chat from sub-tasks."""# Ignore all sub-task events; only track the main conversationif scope != "main":return currentif event == "turn_started":return State.WORKING # A new round beginsif event == "tool_invoked":return State.WORKING # A tool is being called; update the text belowif event in ("turn_finished", "user_interrupted", "tool_error"):# Only a normal finish makes her smile; interruptions and errors go straight to idlereturn State.DONE if event == "turn_finished" else State.IDLEreturn current # Unknown events don't change the state
Two notes:
- Unknown events always keep the current state. Event naming varies enormously across tools, so ignoring unknown events prevents the state from jumping around.
- The state is derived purely from events. The transition between idle and finished is driven by an 8-second timer, without adding any extra state.
3. The Rendering Approach: One Asset, Two Presentations
This character has to appear in two environments, and the two render completely differently.
1. Two environments, two rendering paths
- GUI clients: the character is shown as full-body pixel art. With few visual elements and clear color blocks, it’s well suited to being displayed persistently.
- Pure character terminals: a half-body portrait is assembled from “half-block characters,” in a 36-column × 16-row frame.
Half-block characters refer to special glyphs like “▀” (upper half), “▄” (lower half), and “█” (full block). Each occupies a single character cell but fills only the upper or lower half. By splitting a character cell vertically into two pixel rows—top and bottom—you can draw one pixel row using half of a character’s height, doubling the vertical resolution.
The core logic is under ten lines, as the following sample code shows:
# The pixel matrix uses 0/1; `height` rows, `width` columns eachdef render(sprite, width, height) -> str:lookup = {(0, 0): " ", (0, 1): "▀", (1, 0): "▄", (1, 1): "█"}lines = []# Take two rows at a time and merge them into one character linefor y in range(0, height - 1, 2):top, bottom = sprite[y], sprite[y + 1]lines.append("".join(lookup[(top[x], bottom[x])] for x in range(width)))return "\n".join(lines)
The pseudocode only handles “compositing” and doesn’t deal with color. In an actual implementation, you can use terminal color escape sequences to color the upper and lower halves separately, preserving details like the character’s eyes and clothing.
2. Frame size and proportion
Working out 36 columns and 16 rows:
- Horizontally 36 characters, vertically 16 rows, each carrying two pixels, so the character actually occupies about 36 × 32 pixels;
- A common monospace font has a character width-to-height ratio of roughly 1:2, so the display height of 16 character rows exactly equals the vertical height of 32 pixels;
- The character’s final on-screen aspect ratio is about 36:32—close to square—so there’s no vertical stretching or compression.
In practice, font metrics differ across terminals, so keeping a little top and bottom padding as a buffer is worthwhile.
3. Adaptation and performance
- Width adaptation: when the terminal window is at least 144 columns wide, the character automatically appears on the side. Given the 36-column frame, the remaining space is enough to read the conversation. When the window is narrow, it doesn’t force an insertion, avoiding squeezing the response into just a few characters per line.
- Redraw on demand: it only re-renders when the state or tool name changes. This is crucial, because the drawing loop itself has overhead. The vast majority of the time the conversation is idle, with the pet quietly holding her book and adding no extra burden.
4. Integration: Install and Go, Swap the Appearance
The pet is distributed as a plugin, and installation differs between the two environments. The flow below uses neutral placeholders; when actually using it, follow the names and parameters in your tool’s documentation.
Pure character terminal sessions: run the plugin install command in the session input area, with parameters specifying the plugin ID and the plugin source. After installation, enter the enable command (in the example below, /niang), and the pet appears beside the conversation.
/plugin install <plugin-id> --marketplace <plugin-source>
GUI clients: some clients don’t support the command above in their input area, so it takes two manual steps:
- Click the “+” next to the input box, choose Plugins, then choose Add marketplace and fill in the plugin source address;
- Choose Add plugin to add the plugin.
Usage and replacement:
- Once enabled, she holds the three poses—no need to “raise” her or tune a persona. The assistant’s existing capabilities are entirely unaffected.
- The plugin code is open source and free to use, and the repository includes instructions for replacing the avatar and customizing it.
- If you’d rather not tinker yourself, you can hand the repository address straight to the assistant and let it do the work. This plugin’s core logic was originally written by an AI coding assistant; I only handled the avatar design and the final acceptance—and this step is handed to it as well.
5. Design Retrospective: Three Transferable Lessons
Looking back at this project, what’s most worth borrowing isn’t the pet itself, but three general practices.
1. Perceptibility is a feature too
Whether code compiles, whether tests pass, whether a task is done—these questions have long had standard answers. Where AI coding assistants really eat up time is in the long-running middle of execution. Making “what it’s doing and how far along it is” visible is itself a fundamental capability, yet one that’s often overlooked.
2. A small tool’s value lies in the “last mile”
From wide-ranging practice, whether a tool actually gets used often depends not on how powerful its features are, but on whether it’s intuitive enough and costs zero to learn. A small tool that takes half an hour of reading the docs to understand and one that makes sense from a single screenshot are on entirely different scales when it comes to how effectively they spread.
3. Visualization doesn’t have to rely on a GUI
Sixteen rows of characters plus a few special glyphs deliver a complete state display. In terminal-only settings—server operations, CI pipelines, cloud resource monitoring—this kind of “character-level visualization” has broad applicability. If a team wants to productize this capability and have terminals scattered everywhere load the same asset, it can store asset files centrally in object storage and use a log service to track adoption. None of these ideas depend on a particular vendor’s proprietary interface.
Conclusion
The pet doesn’t help us write a single line of code, but it turns the abstract “currently executing” into a visible act of reading and smiling. For people who build tools, this may serve as a reminder: beyond figuring out “how to do it,” it’s worth also thinking about “after it’s done, will others want to take a look.”
