changing it

changing it

The loop is a file, and the file is the extension point. But the package is not where your own changes belong: a mod is your file, outside it, handling the same events the built-in interface runs on — and an update cannot reach it.

the life of a self-edit

~/.micro-cc/ your additions, untouched SELF_HEAL_ model machine claude_loop_.py the file it is running between turns the model edits its own file ↻ it restarts in place same pid · same conversation now it can do something new ✗ the new code will not boot ↻ the release is put back at most three tries ↻ it restarts in place same pid · same conversation + retry on error

Edit any .py file in the package, by hand or by asking the model in plain words. A two-second poll compares a manifest of file modification times and sizes, and a change marks a reload as pending.

The restart only fires when the app is idle: no turn in flight, no /gui session owning the conversation, no live subagent. Otherwise the poll keeps retrying until the first tick where every gate is clear. Then micro·cc stashes your unsent prompt, flushes messages.jsonl and re-executes in place with os.execv. The process id stays the same and the conversation is rebuilt from disk.

Every launch goes through a small supervisor. If the edited tree fails to boot, it reinstalls the published release over it and retries, at most three consecutive times. A boot that succeeds clears the count, and a crash after a good boot never triggers a reinstall.

$ /reload      re-execs this install: applies your edit now
$ /update      installs a new version: replaces core edits, keeps your mods

source: src/micro_cc/utils/self_reload_.py · src/micro_cc/self_heal_.py

mods: your own handlers

Editing the package is the strong way to change micro·cc and the fragile one: the next /update overwrites the file. So the things you are most likely to want have a second home, outside the package, where the installer never looks.

A mod is one folder: ~/.micro-cc/mods/<name>/mod.py. It exposes a single function, register(on), and uses it to attach handlers to the very event bus the built-in interface runs on — not a hook list bolted beside it. Helper files sit next to it and import relatively, so a mod can be a package rather than a file. Prefix the folder with an underscore and it stops loading, which is a cheaper off switch than deleting it.

Every handler is called as fn(api, e, nxt), where nxt(e) runs the rest of the chain and ends at the built-in behaviour. That one argument is what sets a handler's strength: return nxt(e) to pass through untouched, call it with a changed copy of e to transform the event, decorate whatever comes back, or never call it at all and replace the built-in outright.

def register(on):
    @on("command", name="standup", hint="summarize today's commits")
    def standup(api, e, nxt):
        api.send_prompt(f"Summarize `git log --since=midnight`. Focus: {e['arg']}")

    @on("key", key="ctrl+g")
    def go(api, e, nxt):
        api.send_prompt("/standup")
        return True
render
one named piece of the screen — the banner, the header, the line above the input, the status and hint bars, the working line, the question, the subagent and background-process rows — or a single message row, filtered by its type or by the tool it came from
glyphs
the glyph and label for each message type
command
a slash command, with the text typed after it. A mod's command that shares a built-in's name wraps it: nxt(e) is the built-in
key
a key binding, told whether it consumed the keypress. ctrl+c, escape and enter cannot be bound

Handlers are given api and nothing else — notify, get_input, set_input, send_prompt, refresh, usage, project_dir, model() — never the app's internals, and that surface carries a version, so a mod written against a different one is disabled rather than left to half-work. A mod that will not import, or has no register(on), is skipped and reported; it never stops the harness booting. A synchronous handler that takes long enough to be felt is disabled on the spot, and one that outlasts half a second is interrupted by a watchdog.

Saving any file under mods/ restarts the app into the change at the next idle moment, exactly as editing the package does, and the conversation is kept. Four things sit outside a mod and outside that poll: statusline.sh, theme.json, models.json and skills/.

source: src/micro_cc/mods_.py · src/micro_cc/tui_native/ui_api_.py

skills

Skills are packaged instructions the model loads when a task calls for them: a workflow with its own reference files, not a single prompt. /new-skill writes one and /skills lists what is installed. They load from ~/.micro-cc/skills/<name>/SKILL.md (every project) or {project_dir}/skills/<name>/SKILL.md (this project only). Bundled with the package:

customizing-micro-cc
Read before changing micro-cc itself (look of the TUI, slash commands, keys, glyphs, status line, models, or harness source)
design
Create visual design artifacts, in two modes
docx
Comprehensive document creation, editing, and analysis with support for tracked changes, comments, formatting preservation, and text extraction
github
Research public GitHub repositories
graph-orchestration
Reference for the /graph subagent-orchestration mechanism
hairline-create
Use when someone asks for a new Hairline figure, or runs /hairline-create with an idea
painted-video
Use when the user wants a painted/brushstroke-style animation synced to music: a real music video (not a typographic lyric video), or any WebGL2 canvas animation keyed to…
pptx
Use this skill any time a .pptx presentation is being created from scratch
xlsx
Comprehensive spreadsheet creation, editing, and analysis with support for formulas, formatting, data analysis, and visualization

source: src/micro_cc/skills/

MCP servers

/new-mcp registers an external MCP server and /mcp lists what you have. Their tools join the same list as the built-ins, so the model does not care where a tool came from.

source: src/micro_cc/tools/mcp_client_.py

built 2026-10-13 from microcc@fe764bf · v0.2.109 · llms.txt