---
status: open
parent: "[[063-pi-ui-customization-spec-task]]"
blocked-by: []
tags:
  - ticket/task/afk
---

# Implement compact Pi status extension

## Question

Promote the accepted compact status prototype into the dotfiles-managed Pi extension tree with credential-safe Codex quota handling.

## What to build

Create a flake-managed Pi extension that replaces the throwaway `compact-status-prototype.ts` behavior with the permanent compact status surface.
The extension should hide Pi's built-in footer by default, render the cwd/branch and model/thinking row above the editor, render the unlabeled `▃` context bar, render the unlabeled `▔` consumed-weekly-Codex quota bar, and provide `/codex-quota` for a manual non-secret quota refresh notification.

The extension should read Pi's local `openai-codex` OAuth credential only for the access token and account id needed by the ChatGPT/Codex usage endpoints.
It should cache only normalized non-secret quota percentages in memory and degrade to an unknown/error state without crashing when credentials, network, or response shape are unavailable.

## Acceptance criteria

- [ ] The extension lives under the dotfiles Pi module's managed extension source tree, not only under `~/.pi/agent/extensions`.
- [ ] The built-in footer is hidden by default.
- [ ] The status widget shows cwd/branch on the left and model/thinking on the right.
- [ ] The context bar uses `▃`, fills from `ctx.getContextUsage().percent`, and uses success/warning/error thresholds 70% and 90%.
- [ ] The Codex quota bar uses `▔`, fills by consumed weekly quota, uses border blue below 50%, warning at 50%, and error at 80%.
- [ ] `/codex-quota` forces a refresh and displays only normalized non-secret details.
- [ ] Missing or expired credentials, network errors, and unrecognized quota responses do not break extension loading.
- [ ] No default config file is generated.

## Implementation Notes

Use `[[063-pi-ui-customization-spec-task]]` as the source of truth for row shape, colors, quota endpoints, and out-of-scope behavior.
The throwaway prototype at `~/.pi/agent/extensions/compact-status-prototype.ts` is useful reference code, but the finished implementation should be promoted into the repo-managed Pi extension source.
