fastapi
FastAPI framework, high performance, easy to learn, fast to code, ready for production
- 105k
- Python
- MIT
- 5 d ago
Terminal-native thinking panels for Pi: three display modes and session-linked JSON/Markdown review trees.
Repo rustytensor/pi-thinking-steps, read from GitHub 10 h ago. rustytensor has not joined Take My Repo.
rustytensor/pi-thinking-steps is a public repo on GitHub by rustytensor. Terminal-native thinking panels for Pi: three display modes and session-linked JSON/Markdown review trees. It declares the MIT license on GitHub. It is written mainly in TypeScript, has 142 stars and last changed on 2026-11-16. Nobody has reviewed it on Take My Repo yet, which says nothing about its quality. Read from GitHub on 2026-11-23.
In the maintainer's words. Shown from GitHub; Take My Repo does not keep a copy.
Faithful, terminal-native thinking visualization for Pi.
Turn raw provider reasoning into a clean, structured TUI view without changing what it means.
Pi already exposes provider thinking, but raw reasoning streams are hard to scan in a real terminal. Pi Thinking Steps keeps the source text faithful while making it dramatically easier to follow:
The goal is simple: preserve meaning, improve readability, and stay native to Pi's TUI.
collapsed, summary, expandedin 12,000 tok/s · out 98 tok/s. The footer keeps last · in 12,000 tok/s · out 98 tok/s and does not clear it when the next reply starts. Alt+Shift+T switches the footer to the session average.| Mode | Best for | Behavior |
|---|---|---|
collapsed |
Live active thinking | Shows a width-aware compact preview of the highest-signal active step; it may wrap in narrow terminals |
summary |
Flow at a glance | Shows a chronological top-N set of salient summaries, preserving active, failure, success, and decision context when space is limited |
expanded |
Deep inspection | Shows the full step text in a cleaner, structured terminal layout |
collapsedUse it when you want the smallest possible thinking footprint while the model is still working.
summaryUse it when you want to understand the reasoning path quickly without reading the full transcript.
expandedUse it when you want the whole text, but formatted for a terminal instead of dumped as a raw stream.
| Action | Control |
| Toggle footer token rate: last reply or session average | Alt+Shift+T |
| Cycle thinking view | Alt+T |
| Toggle token rate: this reply or session average | Alt+Shift+T |
| Choose a mode interactively | /thinking-steps |
| Set session mode | /thinking-steps collapsed / summary / expanded |
| Save a project default | /thinking-steps project <mode> |
| Save a global default | /thinking-steps global <mode> |
| Clear a project default | /thinking-steps project clear |
| Clear a global default | /thinking-steps global clear |
| Export the session thinking tree | /thinking-steps export json / export markdown / export both (all branches by default) |
| Export only the current branch | /thinking-steps export both branch |
| Browse prompts, responses, and thinking | /thinking-steps review (current branch) / review all |
| Inspect or disable autosaving | /thinking-steps autosave status / autosave off |
| Enable autosaving with confirmation | /thinking-steps autosave on (JSON, current branch, keep 10, thinking only) |
Each model reply ends with one line in the message area, for example in 12,000 tok/s · out 98 tok/s. in is prompt tokens per second until the first generated token. out is generated tokens per second after that, including reasoning. Cached prompt tokens are not counted. A reply with no measured rate adds no line.
The footer keeps the last finished reply: last · in 12,000 tok/s · out 98 tok/s. It is not cleared when the next reply starts. While a reply is running, the footer shows now only after that reply has numbers. Alt+Shift+T switches the footer to the session average, session · in 8,400 tok/s · out 71 tok/s, which is all measured tokens divided by all measured time, not a mean of each reply. A new chat starts with a blank footer. The message-area lines stay in the session.
Mode restoration follows this order:
.pi/thinking-steps.json~/.pi/agent/state/thinking-steps.jsonsummaryUse plain /thinking-steps <mode> when the choice should stay local to the current session. Use project or global when you want future sessions to inherit that choice automatically.
┆ Thinking Steps · Summary
├─ ◫ Inspect the current renderer implementation.
├─ ↔ Compare how visibility toggling works.
└─ ✓ Verify the refresh path after mode changes.
┆ Thinking Steps · Expanded
├─ ◫ Inspect the current renderer implementation.
│ Inspect the current renderer implementation.
├─ ↔ Compare how visibility toggling works.
│ Compare how visibility toggling works.
└─ ✓ Verify the refresh path after mode changes.
Verify the refresh path after mode changes.
│ Thinking ✓ Verify the refresh path after mode changes. ·
Pi Thinking Steps is built to improve readability without changing meaning.
Every assistant message rendered by a compatible terminal session has a thinking panel in all three modes, including text-only and tool-only responses. Before thinking text arrives it says Waiting for thinking content; when a response finishes without any, it says No thinking content supplied. Provider-redacted blocks remain marked as hidden. These are availability indicators, not generated reasoning. The extension cannot force a provider to expose thinking or recover hidden content.
Run /thinking-steps export json, /thinking-steps export markdown, or /thinking-steps export both while the session is idle. Existing commands retain their all-branches default. Append branch for only the current leaf's ancestry, or all explicitly: /thinking-steps export both branch. Automatic saving is off unless separately enabled below. Exports require a persistent session; in-memory sessions receive a clear warning instead.
Each export creates a new private directory beside the session file (<session-file>.thinking-steps-<unique suffix>), with thinking-steps.json, thinking-steps.md, or both. Directories use owner-only permissions and files use mode 0600 on POSIX systems. Repeated exports create independent snapshots rather than overwriting files. Failed writes remove the incomplete export; errors are reported.
A durable thinking-steps.export custom entry attaches file references to the session without adding the export to model context or triggering another turn. The transcript displays local file links when this extension is loaded, including after restarting. File links remain local: moving/deleting a session or export does not move/repair those absolute paths. If the session changes while saving, files are kept and their paths reported, but they are not attached to a different session or branch.
Privacy and scope: all includes all recorded branches in the current session file, including abandoned branches; branch includes only the current leaf and its ancestors, preserving original IDs and structural links. Both retain original historical content before later context edits. They are archival snapshots, not reconstructions of the current model context. Separate forked session files are not followed. Treat exports as sensitive conversation data and review them before sharing.
JSON schema version 1 stores session/leaf IDs and a flat tree of entries linked by their original id and parentId. User text, assistant response text, available thinking blocks, and every derived step are included independently of the selected display mode. Provider signatures, redacted block payloads, image bytes, tool arguments/results, system prompts, and custom-entry payloads are excluded; structural entries retain only metadata to keep branch links intact. Markdown provides a linked tree plus prompt, response, thinking-block, and detailed-step sections. Deep trees cap visual indentation but retain exact parent links. Text is fenced to prevent Markdown/HTML injection, and terminal controls are shown as escapes in Markdown; JSON preserves the supplied text.
The schema's scope is current-branch or all-recorded-branches; content is conversation or thinking-only. Earlier version-1 exports without content contain conversation text. Manual exports include conversation text; automatic exports can omit it.
Run /thinking-steps review for the current branch or /thinking-steps review all for every recorded branch. Select a prompt, then a response, to inspect the original text, provider-supplied thinking blocks, and derived steps. Alternate responses are associated through their actual ancestry, not adjacent transcript positions. The viewer is read-only and captures a snapshot when opened; it neither edits the session nor sends content to a model or service.
Use arrow keys, Page Up/Down, and Home/End to scroll. Escape returns to the response list, then the prompt list, then Pi. Press v for verbatim source, s for derived steps, or a for the complete review. Terminal control characters are displayed as escapes; missing and provider-hidden thinking are clearly marked. The browser requires the interactive TUI. Other modes can use manual exports.
/thinking-steps verbatim [branch|all]
/thinking-steps search [branch|all] [literal text]
/thinking-steps compare
verbatim opens the review browser directly on provider-supplied thinking rather than derived steps. It preserves recorded whitespace, blank lines, punctuation, and Markdown markers without summarizing or formatting them. Unsafe terminal characters (including tabs, carriage returns, escape sequences, and bidi overrides) appear as visible Unicode escapes; extremely narrow terminals also escape glyphs too wide to fit. Soft wrapping is presentation only. Use JSON exports for the underlying recorded strings. This does not add a fourth live display mode or reveal hidden/redacted reasoning.
search defaults to the current branch; all includes abandoned branches recorded in this session file. Omit the text to get an input dialog. Search is literal, Unicode-aware, and case-insensitive—not a regular expression or a shell command, so quotes are literal too. The first 200 occurrences are listed with entry ID, source field/block, line, and context. Select one to jump to its source line; Escape returns to results. Narrow the query when results are capped. Only prompt text, response text, and available source thinking are searched, not derived summaries, signatures, tool payloads, or redacted content. To search for the word all itself, use search branch all.
compare offers responses on different recorded branches under the same prompt. Sequential assistant continuations on one branch are not treated as alternatives. It displays response text and verbatim thinking in two columns, stacking them below 60 terminal columns. No semantic diff is invented, and separate fork files are not followed.
All three tools are read-only TUI snapshots: they do not call a model, modify the session, change its branch, or enable autosaving.
/thinking-steps exports
The manager lists this session's recorded export attachments across all branches. Status is available, partial, missing, or unsafe (not eligible for deletion, with a diagnostic). Missing links may have expired through retention, been deleted, or been moved; the manager does not guess which or scan the filesystem for unlinked snapshots. Inspect paths without changing anything, or select one snapshot for permanent deletion from an idle session and confirm its exact files.
Deletion accepts only recognized snapshot directories beside this session file, validates automatic ownership markers, rejects unexpected files and symbolic links, and rechecks the selection after confirmation. It removes known regular files and their empty directory, never recursively deletes a directory, and never changes session history, other snapshots, or autosave settings. Existing links then show as missing; there is no undo. File changes or I/O failures stop deletion with an actionable diagnostic, including any files already removed. Avoid external modification of snapshot directories while managing them; local filesystem checks are not a security boundary against a hostile process with the same account's permissions.
/thinking-steps diagnostics
Reports the extension version captured at module load, the public running-Pi version and locations, display/mode settings, this session's patch lifecycle status, shared patch reference count, and current-branch thinking availability. The latest recorded assistant response is distinguished from a still-running response that may not yet have been persisted. It includes no prompt, response, or thinking text and changes nothing. Local paths and provider/model identifiers are included, so review the report before sharing it. Updating files on disk does not prove that already-loaded code changed; restart or reload before comparing versions. Availability counts cannot establish what hidden reasoning a provider might have withheld.
Autosaving starts off. Enable it from an idle, persistent TUI session and accept the storage/retention confirmation:
/thinking-steps autosave on
/thinking-steps autosave on both branch 10 thinking
/thinking-steps autosave on json all 5 conversation
/thinking-steps autosave status
/thinking-steps autosave off
The optional positional arguments are format (json, markdown, both), scope (branch, all), number of snapshots to keep (1–50), and content (thinking, conversation). Defaults are json branch 10 thinking. Thinking-only snapshots omit user prompt and assistant response text, but thinking itself can quote sensitive conversation content; this is not secret detection or anonymization. The same signature, redacted-payload, image, tool, system-prompt, and custom-payload exclusions apply to every export. Nothing is uploaded.
Settings are saved as non-model custom entries for this session ID, apply across its branches, and survive reopening. New and separately forked sessions start off. Each completed TUI agent run saves available recorded content; aborted/error responses are skipped. This is an agent_end snapshot, not a guarantee that Pi will not retry or continue afterward. Autosaving does not run in RPC, JSON, or print mode and does not trigger another turn.
Automatic snapshots live beside the session file in <session-file>.thinking-steps-auto-<unique suffix> directories with an ownership marker. After a successful save and attachment, retention keeps the selected number of owned automatic snapshots. Manual exports and other sessions are never pruned. Unknown files, symbolic links, malformed markers, or I/O failures stop cleanup and produce a warning rather than deleting unrecognized data. A failed cleanup can temporarily exceed the retention limit. Old session attachment links are marked as subject to retention and can point to already-pruned files. Disabling autosaving preserves existing snapshots. File permissions remain owner-only on POSIX; this is local storage, not encryption.
The parser uses deterministic rules to keep step boundaries believable and stable. Examples:
The renderer normalizes markdown-like content for terminal display:
# markers*...* / _..._This extension is designed for a real terminal, not a browser UI. That means:
Pi currently exposes only a minimal public hook for built-in thinking rendering: setHiddenThinkingLabel.
To deliver a full three-mode thinking view, Pi Thinking Steps patches Pi's internal AssistantMessageComponent at runtime and replaces the default visible thinking rendering path with a custom renderer.
That patch layer is:
internal-patch.tsThis extension intentionally depends on Pi's current internal TUI implementation.
The patch is validated against the unbundled Pi 0.99.2 development host and the bundled Pi 1.0.0 CLI.
AssistantMessageComponent is imported from the host's public @earendil-works/pi-coding-agent API, so the patch targets the class that Pi actually renders. A deep import of dist/modes/interactive/components/assistant-message.js can return a separate, unused class in bundled Pi installations. Terminal sessions supply their active ctx.ui.theme rather than using a separate theme instance.
The remaining internal module dependencies are:
dist/modes/interactive/components/markdown-transform.js for native assistant-text transformsdist/modes/interactive/theme/theme.js only for direct patch callers that do not supply a UI themeThese internal helpers are resolved from the running Pi host via its public getPackageDir() API, rather than from a separate extension-local Pi installation. The patch preserves native response padding, assistant-text Markdown transforms, streaming state, terminal message markers, and truncation/error notices. It is installed only in terminal (tui) sessions; RPC, JSON, and print sessions retain their native rendering.
That means:
package-lock.json matternpm test is part of the maintenance contract, not an optional extrasession_start, the current session stays on Pi's native thinking renderer and live mode switching is disabled for that degraded sessionsession_shutdown, failed final cleanup is retained for retry on a later matching same-scope shutdown, this package does not register a generic extension-unload hook, and missed shutdowns are not recovered by unrelated cwd shutdownssession_start/message ownership pathPi packages are host-provided peer dependencies, with exact 0.99.2 development pins in package.json. Compatibility-sensitive upgrades must update package-lock.json in the same change. Node.js 22.19.0 or later is required by the current Pi packages.
With Pi installed, add the published extension:
pi install npm:pi-thinking-steps
Restart Pi, then use Alt+T to cycle views or /thinking-steps to choose one. After a response finishes, run /thinking-steps export both to save a session-linked review. Exports include all recorded branches and may contain sensitive conversation data; see Manual session exports.
Find the package on npm and release notes on GitHub.
From the repository root, using Pi 0.99.2 or 1.0.0:
pi -e ./index.ts
If the npm package is already configured, test the checkout in isolation to avoid loading both copies:
pi --no-extensions -e ./index.ts
This disables other automatically loaded and built-in extensions for that invocation; it does not change your saved settings. Editing the checkout does not update an installed npm copy.
The package entry point is already configured in package.json:
"pi": {
"extensions": ["./index.ts"]
}
Install dependencies:
npm install
Run the full validation suite:
npm test
Typecheck only:
npm run build
Additional validation gates (run sequentially):
node --import tsx test/repository.test.ts
npm run test:package
npm run test:host
PI_TEST_HOST_PACKAGE=/absolute/path/to/pi-coding-agent npm run test:host
test:package packs into a temporary directory, extracts the actual tarball, installs its declared development dependencies, and runs npm test without repository-only files. It requires npm registry access and tar; it never publishes. Repository lockfile integrity is checked separately; ignored agent instructions and archived workflow prompts are not prerequisites for packaged tests.
test:host uses the selected host's real extension loader, selecting its bundle when present. It checks public-renderer identity, deep-copy isolation, mode switching, Alt+T, missing/streaming states, padding, review/search/comparison, managed export deletion, diagnostics, autosaving, and cleanup. The CI workflow serially exercises Node 22.19.0/24 with Pi 0.99.2/1.0.0, without changing the development pins. CI jobs run these gates after npm test; a local pass does not imply the remote workflow has run.
The package ships:
README.mdCHANGELOG.mdLICENSEtsconfig.jsontest/assets/scripts/That keeps the GitHub README, packaged validation surface, and published package presentation aligned.
index.ts — extension entry point, commands, shortcut, lifecycle hooksinternal-patch.ts — Pi runtime patching and cleanupparse.ts — thinking-step splitting, summaries, role inference, mode parsingpersistence.ts — project/global mode preference storagerender.ts — collapsed, summary, and expanded terminal renderingexport.ts — scoped snapshots, JSON/Markdown serialization, private export filesreview.ts — read-only prompt/response/thinking browser and safe verbatim viewerinspection.ts — literal recorded-text search and alternate-branch comparisonarchives.ts — session-linked export inspection and confirmed selective deletiondiagnostics.ts — loaded versions, patch state, and recorded availability reportsautosave.ts — session opt-in settings, automatic snapshots, conservative retentionstate.ts — shared mode, active-thinking state, patch lifecycle statetypes.ts — shared contractstest/thinking-steps.test.ts — unit and integration coveragetest/export.test.ts — manual export, attachment, privacy, and always-visible panel coveragetest/summarizer-challenger.test.ts — focused summarizer-regression coveragetest/review-autosave.test.ts — branch scope, browser, consent, privacy, and retention regressionstest/inspection.test.ts — verbatim fidelity, search/comparison, safe deletion, and diagnosticstest/repository.test.ts — repository-only lockfile integrity.github/workflows/ci.yml — compatibility and extracted-package gatesReadable over flashy
Faithful over clever
Terminal-native over web-like
Small surface area
Strict validation
For the canonical package version, see package.json. For release points, use the repository tags.
This project is released under the MIT License.
rustytensor/pi-thinking-steps is a public repo on GitHub by rustytensor. Terminal-native thinking panels for Pi: three display modes and session-linked JSON/Markdown review trees.
It declares the MIT license on GitHub.
Its maker has not tagged a system, so it is unknown here. Its README says what it needs.
Open "Take it" on its page: Take My Repo writes an install plan for your machine and hands it to your AI agent (Claude Code, Codex or Cursor), which asks you before each step. Take My Repo has not tested it on any machine.
Its last change on GitHub was on 2026-11-16. Take My Repo does not judge from that whether it is maintained.
Nobody has reviewed it on Take My Repo yet, which says nothing about its quality.
FastAPI framework, high performance, easy to learn, fast to code, ready for production
Find the ghost tokens. Fix them. Survive compaction. Avoid context quality decay.
📑 PageIndex: Document Index for Vectorless, Reasoning-based RAG

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Reverse engineer anything with agents, from app behavior down to native binaries.
This page is also available as structured data, with the same sources and dates.
/api/v1/resources/gh/rustytensor/pi-thinking-stepsTake My Repo has not tested this on your machine. Requirements come from the project's own documentation.