qa-guide
Shows Claude's questions in a side pane with context, option details, an AI explanation and answer history; also explains questions Claude asks in plain text.
What it does
- Draws a band above the prompt, a pane, toasts
- Adds /qa-guide
- Watches AskUserQuestion calls
- Hooks prompt.submit, session.start, turn.complete
Good points
- No network calls
- Starts no processes
- Written in TypeScript
- Handles errors
Code to start from
Two kinds: a starter modscode writes from the design above, and the lines of the mod's own code that draw it.
Starter (register.tsx)
import type { Register } from 'claude-code'
// Drawn like qa-guide by aieo-product (pane, band, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/aieo-product-qa-guide/
// Written by modscode from that reading, not copied from the mod: use it as you like.
// Each value below stands for one the mod works out at run time; put in your own.
export const register: Register = on => {
// the band above the prompt; what else goes there is drawn under it
on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
const { Box, Text, Button } = $.ui.resolve(e)
const truncateCells = '…'
return (
<Box flexDirection="column">
<Box flexDirection="row" gap={1}>
<Text color="yellow" bold>
⏳
</Text>
<Text wrap="truncate-end">
<Text color="yellow">
Claude is waiting for your decision
{": "}
</Text>
<Text dimColor>
{truncateCells}
</Text>
</Text>
<Text dimColor>
Explaining in the question guide…
</Text>
<Text dimColor wrap="truncate-end">
or type ?? + Enter
</Text>
<Button plain label="×" />
</Box>
{await next(e)}
</Box>
)
})
// the pane: open it with $.ui.open({ id: 'my-pane', title: "Question guide" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Box, Text, Button, Markdown } = $.ui.resolve(e)
const count = '…'
const selectedCursor = '…'
const total = '…'
const sessionCost = '…'
const lead = '…'
const answers = '…'
const usageLine = '…'
const explanation = '…'
const index = '…'
const header = '…'
const question = '…'
const question2 = '…'
const question3 = '…'
const answers2 = '…'
const question4 = '…'
const question5 = '…'
const question6 = '…'
const answers3 = '…'
const question7 = '…'
const question8 = '…'
const question9 = '…'
const answers4 = '…'
return (
<Box flexDirection="column">
<Box flexDirection="row" gap={1}>
<Text backgroundColor="yellow" color="black" bold>
{" Awaiting answer "}
</Text>
<Text bold>
{`Questions from Claude (${count})`}
</Text>
</Box>
<Box flexDirection="column">
<Box flexDirection="row" gap={1}>
<Text dimColor>
{`${selectedCursor}1/${count}`}
</Text>
<Button hotkey="p" plain label="◀ Previous" />
<Button hotkey="n" plain label="Next ▶" />
<Button hotkey="l" plain label="Latest" />
</Box>
<Box flexDirection="row" gap={1}>
<Button hotkey="a" plain label="AI explanation: ON" />
<Button hotkey="h" plain label="Hide history" />
<Button role="dismiss" plain label="Close" />
</Box>
<Text dimColor>
{`AI tokens this session: ${total}`}
{sessionCost}
</Text>
</Box>
<Box flexDirection="column" marginTop={1}>
<Text color="blue" bold>
▍Your recent instructions
</Text>
<Box flexDirection="column">
<Text dimColor wrap="truncate-end" />
<Text dimColor wrap="truncate-end" />
<Text dimColor wrap="truncate-end" />
</Box>
<Box flexDirection="column">
<Text dimColor wrap="truncate-end" />
<Text dimColor wrap="truncate-end" />
<Text dimColor wrap="truncate-end" />
</Box>
<Box flexDirection="column">
<Text dimColor wrap="truncate-end" />
<Text dimColor wrap="truncate-end" />
<Text dimColor wrap="truncate-end" />
</Box>
</Box>
<Box flexDirection="column" marginTop={1}>
<Text color="blue" bold>
▍Claude's preceding explanation
</Text>
<Markdown text={`${lead}`} dimColor />
</Box>
<Box flexDirection="column" marginTop={1}>
<Text color="green" bold>
Freeform answer
</Text>
<Text color="green">
{answers}
</Text>
</Box>
<Box flexDirection="column" marginTop={1} borderStyle="round" borderColor="magenta" paddingX={1}>
<Box flexDirection="row" gap={1}>
<Text color="magenta" bold>
✦ AI explanation (instructions, context, effects, recommendation)
</Text>
<Text dimColor>
compact context
</Text>
</Box>
<Text dimColor>
{usageLine}
</Text>
<Text dimColor>
Generating… (you can keep answering)
</Text>
<Markdown text={`${explanation}`} />
<Text color="red">
{`Could not generate an explanation: ${explanation}`}
</Text>
<Text dimColor>
OFF (enable for the next question with [a])
</Text>
</Box>
<Button hotkey="f" plain label="Full context" />
<Box flexDirection="column" marginTop={1}>
<Text dimColor>
────────
</Text>
<Text bold>
Past questions and answers
</Text>
<Box flexDirection="column" marginTop={1}>
<Button plain label={`${index}1/${count} ▶ Selected`} />
<Box flexDirection="column">
<Text>
{`[${header}] `}
{question}
</Text>
<Text color="yellow">
{" → "}
{" Awaiting answer "}
</Text>
</Box>
<Box flexDirection="column">
<Text>
{`[${header}] `}
{question2}
</Text>
<Text color="yellow">
{" → "}
{" Awaiting answer "}
</Text>
</Box>
<Box flexDirection="column">
<Text>
{`[${header}] `}
{question3}
</Text>
<Text color="yellow">
{" → "}
{" Awaiting answer "}
</Text>
</Box>
<Text color="green">
{" → Freeform: "}
{answers2}
</Text>
</Box>
<Box flexDirection="column" marginTop={1}>
<Button plain label={`${index}1/${count} ▶ Selected`} />
<Box flexDirection="column">
<Text>
{`[${header}] `}
{question4}
</Text>
<Text color="yellow">
{" → "}
{" Awaiting answer "}
</Text>
</Box>
<Box flexDirection="column">
<Text>
{`[${header}] `}
{question5}
</Text>
<Text color="yellow">
{" → "}
{" Awaiting answer "}
</Text>
</Box>
<Box flexDirection="column">
<Text>
{`[${header}] `}
{question6}
</Text>
<Text color="yellow">
{" → "}
{" Awaiting answer "}
</Text>
</Box>
<Text color="green">
{" → Freeform: "}
{answers3}
</Text>
</Box>
<Box flexDirection="column" marginTop={1}>
<Button plain label={`${index}1/${count} ▶ Selected`} />
<Box flexDirection="column">
<Text>
{`[${header}] `}
{question7}
</Text>
<Text color="yellow">
{" → "}
{" Awaiting answer "}
</Text>
</Box>
<Box flexDirection="column">
<Text>
{`[${header}] `}
{question8}
</Text>
<Text color="yellow">
{" → "}
{" Awaiting answer "}
</Text>
</Box>
<Box flexDirection="column">
<Text>
{`[${header}] `}
{question9}
</Text>
<Text color="yellow">
{" → "}
{" Awaiting answer "}
</Text>
</Box>
<Text color="green">
{" → Freeform: "}
{answers4}
</Text>
</Box>
</Box>
</Box>
)
})
on('session.start', async ($, e, next) => {
await $.ui.toast(`Question guide: use /qa-guide to view context and option details`)
return next(e)
})
}
The mod's own code
Shown under the mod's licence (MIT); its text is below. Keep the notice if you copy these lines.
plugins/qa-guide/hooks/register.tsx lines 999–1038 · Band
on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
if (options.chatQuestions === 'off' || e.props.hasSurvey || e.props.isWorking) return next(e)
const pending = await read($, waiting)
if (!pending) return next(e)
const { Box, Text, Button } = $.ui.resolve(e)
const lang = pending.lang
const width = Math.max(20, e.props.bodyColumns)
const cells = (text: string) => [...text].reduce((n, char) => n + cellWidth(char), 0)
// Icon, label, button or status, ×, the gaps between them and a margin for the engine's own controls.
const fixed = 2 + cells(t(lang, 'waitingLabel')) + 2 +
(pending.entryId ? cells(t(lang, 'waitingPending')) : cells(t(lang, 'explainWaiting')) + 4) + 1 + 4 + 6
// The ?? hint is the first thing to go in a narrow row, so it never wraps.
const hint = !pending.entryId && width - fixed - cells(t(lang, 'waitingHint')) - 1 >= 16
const room = Math.max(10, width - fixed - (hint ? cells(t(lang, 'waitingHint')) + 1 : 0))
return (
<Box flexDirection="row" gap={1}>
<Text color="yellow" bold>⏳</Text>
<Text wrap="truncate-end">
<Text color="yellow">{t(lang, 'waitingLabel')}: </Text>
<Text dimColor>{truncateCells(oneLine(pending.question), room)}</Text>
</Text>
{pending.entryId
? <Text dimColor>{t(lang, 'waitingPending')}</Text>
: <Button key="explain-waiting" hotkey="e" variant="primary" label={t(lang, 'explainWaiting')}
onPress={() => explainWaiting($, pending, compactContexts, runIds, settled)} />}
{hint && <Text dimColor wrap="truncate-end">{t(lang, 'waitingHint')}</Text>}
<Button key="dismiss-waiting" plain label="×" onPress={async () => {
let removed: QaWaiting | null = null
await update($, waiting, w => {
removed = null
if (!w || w.id !== pending.id) return w
removed = w
return null
})
const old = removed as QaWaiting | null
if (old?.entryId) await settleChat($, old.entryId, { status: 'cancelled', answers: {} }, settled)
}} />
</Box>
)
})plugins/qa-guide/hooks/register.tsx lines 1040–1199 · Pane
on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
const { Box, Text, Button, Markdown } = $.ui.resolve(e)
// State survives reloads; normalize entries saved before prompts/language existed.
const list = (await read($, entries)).map(x => ({
...x,
lang: x.lang ?? 'ja',
explainMode: x.explainMode ?? 'full',
userPrompts: Array.isArray(x.userPrompts) ? x.userPrompts : [],
}))
const aiOn = await read($, isAiOn)
const history = await read($, showHistory)
const total = await read($, usageTotal)
const cost = await read($, costTotal)
const showCost = options.showCost !== 'off'
const width = Math.max(20, e.props.bodyColumns)
const selectedCursor = clampCursor(await read($, cursor), list.length)
const openDialog = [...list].reverse().find(isOpenDialog)
const current = openDialog ?? list[list.length - 1 - selectedCursor]
const lang = current?.lang ?? await resolveLang($, options.language)
const sessionCost = showCost && cost.hasPricedUsage
? costSuffix(lang, cost.usd, cost.hasUnpricedUsage || total > cost.tokens) : ''
const navigate = async (select: (value: number) => number) => {
await update($, cursor, value => clampCursor(select(clampCursor(value, list.length)), list.length))
try {
const selected = list[list.length - 1 - clampCursor(await read($, cursor), list.length)]
if (selected && selected.lang !== lang) {
await $.ui.open({ id: PANE, title: t(selected.lang, 'title') }).catch(() => undefined)
}
// History buttons can sit below the selected question's full content.
await $.ui.scroll({ in: PANE, to: 'start' })
} catch {
// The pane may have closed while changing the selection.
}
}
const rule = <Text dimColor>{t(lang, 'rule').repeat(Math.min(width, 60))}</Text>
const toolbar = (
<Box flexDirection="column">
{current && (
<Box flexDirection="row" gap={1}>
<Text dimColor>{t(lang, 'counter', { number: selectedCursor + 1, count: list.length })}</Text>
{selectedCursor < list.length - 1 && (
<Button
key="prev"
hotkey="p"
plain
label={t(lang, 'previous')}
onPress={() => navigate(value => value + 1)}
/>
)}
{selectedCursor > 0 && (
<Button
key="next"
hotkey="n"
plain
label={t(lang, 'next')}
onPress={() => navigate(value => value - 1)}
/>
)}
{selectedCursor > 0 && (
<Button key="latest" hotkey="l" plain label={t(lang, 'latest')} onPress={() => navigate(() => 0)} />
)}
</Box>
)}
<Box flexDirection="row" gap={1}>
<Button
key="ai"
hotkey="a"
plain
label={t(lang, 'aiToggle', { state: t(lang, aiOn ? 'on' : 'off') })}
onPress={() => update($, isAiOn, v => !v)}
/>
<Button
key="hist"
hotkey="h"
plain
label={t(lang, history ? 'hideHistory' : 'history', { count: list.length })}
onPress={() => update($, showHistory, v => !v)}
/>
<Button key="close" role="dismiss" plain label={t(lang, 'close')} onPress={() => $.ui.close({ id: PANE })} />
</Box>
<Text dimColor>{t(lang, 'sessionUsage', { total: totalTokens(lang, total) })}{sessionCost}</Text>
</Box>
)
if (!current) {
return (
<Box flexDirection="column">
<Text dimColor>{t(lang, 'empty')}</Text>
{toolbar}
</Box>
)
}
const statusBadge =
current.status === 'open' ? (
<Text backgroundColor="yellow" color="black" bold>{t(lang, 'awaiting')}</Text>
) : current.status === 'answered' ? (
<Text backgroundColor="green" color="black" bold>{t(lang, 'answered')}</Text>
) : (
<Text backgroundColor="gray" color="black" bold>{t(lang, 'cancelled')}</Text>
)
const modeTag = t(lang, current.explainMode === 'compact' ? 'compactContext' : 'fullContext')
const usageLine = current.usage && current.usageModel ? t(lang, 'usageLine', {
input: groupedTokens(current.usage.input_tokens),
read: groupedTokens(current.usage.cache_read_input_tokens),
write: groupedTokens(current.usage.cache_creation_input_tokens),
output: groupedTokens(current.usage.output_tokens),
model: t(lang, current.usageModel === 'session' ? 'sessionModel' : 'haikuModel'),
}) + (showCost ? costSuffix(lang, current.costUsd, current.costIncomplete) : '') : undefined
const deepButton = <Button key="deep" hotkey="f" plain label={t(lang, 'deep')} onPress={() => explain($, current.id, 'full', compactContexts, runIds)} />
if (openDialog) {
const columns = Math.max(1, Math.floor(e.props.bodyColumns))
const bodyRows = Math.max(0, Math.floor(e.props.scroll?.bodyRows ?? e.viewport?.rows ?? 24))
let remaining = Math.max(0, bodyRows - 1) // one header row
const latestPrompt = current.userPrompts[current.userPrompts.length - 1]
const instructionLines = latestPrompt ? promptLines(latestPrompt, columns) : []
const contextRows = (instructionLines.length ? 1 + instructionLines.length : 0) + (current.lead ? 2 : 0)
const aiText = current.explainState === 'pending'
? t(lang, 'generating')
: current.explainState === 'done'
? current.explanation
: current.explainState === 'error'
? t(lang, 'explainError', { explanation: current.explanation })
: t(lang, 'compactOff')
// Each Text costs one row. Reserve the newest instruction and a lead
// tail, then let completed AI guidance use up to 65% of the visible rows.
// Short OFF/pending/error messages leave their spare rows for the lead.
const aiBudget = Math.min(remaining, Math.max(1, Math.floor(bodyRows * 0.65)),
Math.max(1, remaining - contextRows))
const rawAiLines = compactAiLines(aiText, columns, lang)
const aiContent = clampedLines(rawAiLines.filter(line => !line.spacer), aiBudget, columns)
remaining -= aiContent.length
const requestLines = remaining >= 2 ? instructionLines.slice(0, remaining - 1) : []
if (requestLines.length) remaining -= 1 + requestLines.length
const leadLines = current.lead && remaining >= 2
? wrappedLines(current.lead, columns).slice(-(remaining - 1))
: []
if (leadLines.length) remaining -= 1 + leadLines.length
// Allocate text first across the whole tree. Only unused rows can become
// spacers, and AI spacers also stay inside its 65% limit.
const aiLines = clampedLines(rawAiLines, Math.min(aiBudget, aiContent.length + remaining), columns)
remaining -= aiLines.length - aiContent.length
const requestSpacer = requestLines.length > 0 && remaining > 0
if (requestSpacer) remaining -= 1
const leadSpacer = leadLines.length > 0 && remaining > 0
if (leadSpacer) remaining -= 1
const showDeep = current.explainState === 'done' && remaining > 0
if (showDeep) remaining -= 1
const showUsage = !!usageLine && aiLines.length > 0 && remaining > 0
const showModeTag = !!aiLines[0] &&
(current.explainState === 'done' ||
[...`${aiLines[0].text} ${modeTag}`].reduce((cells, char) => cells + cellWidth(char), 0) <= columns)
const inlineModeTag = truncateCells(modeTag, columns)
const tagCells = [...inlineModeTag].reduce((cells, char) => cells + cellWidth(char), 0)
const firstAiColumns = Math.max(0, columns - tagCells - 1)Licence text (MIT)
MIT License Copyright (c) 2026 aieo-product Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
What its code calls
env varsdrives Claudetool calls
The design, read from code
Drawn from the mod's source at the commit read, not from a run: a list is drawn three times, a condition takes its first branch that draws in the desktop app, and a value only the run time knows is shown as a made-up sample (dotted underline) or left out. Colours and type are this site's.
What its code shows
Read from the source at commit 260d25cae05d on 2026-10-06. The first group decides whether a mod is listed; the rest is for you to weigh. A later commit is not read until the next crawl.
| Decides the listing: code you can check | |
|---|---|
| Entry read | Every module hooks/hooks.json names was read.plugins/qa-guide/hooks/register.tsx |
| Parses | Every file parses as TypeScript or JavaScript.2 files parsed |
| All its code is in the mod | Every import is a file of the mod or the engine's own module; no packages, no require.all its code is in the mod |
| Readable | No minified lines, no eval or new Function, no import of a computed path, no encoded blobs.no minified code, no eval, no encoded blobs |
| Calls in the open | Network and programs are reached as $.http.fetch and $.process.run in place, never passed around.every call outside goes through $ in the open |
| For you to weigh before installing | |
| Where it draws | The terminal, the desktop app, both, or nothing (hooks only: a guard or a prompt rewriter), as its code says. Shown, never a reason to leave a mod out.draws in the terminal and the desktop app, the same in both |
| Install line | Whether its repository's own .claude-plugin/marketplace.json lists it, so it installs from that marketplace with the lines on its page.listed in its repository's .claude-plugin/marketplace.json: installs from there |
| Programs on Windows | Whether every program it starts through $.process exists on Windows (tail, date, open, osascript, /usr/… do not).runs no program a Windows PC lacks |
| Network | Whether every fetch names its https host in the code.no network |
| Programs | Whether every program it starts is named in the code and is not a shell, an interpreter or a network tool.starts no programs |
| Reads and sends | Whether it both reads files or environment variables and reaches the network.reaches no network |
| Keys in the source | Whether the source holds what looks like an API key or a private key.no keys in the source |
| Licence | An open licence (MIT, Apache-2.0, BSD, ISC, Unlicense, 0BSD, CC0) with its text lets modscode show its code; otherwise the code is linked.MIT |
This is a reading of the code text, not a security review: it does not run the mod, and it cannot see what a program the mod starts does. The check before installing is yours. How mods are chosen
Install it
Check it yourself before you install it. Mods run unsandboxed, with your permissions, and modscode does not vouch for what this code does. Read the code below (or run claude plugin validate . in its folder), weigh what it reaches, and install the commit you read.
Its repository is its marketplace. Add that marketplace (in the terminal with these commands, or in the desktop app's plugin settings) and install the mod from it:
/plugin marketplace add aieo-product/claude_qamods/plugin install qa-guide@claude-qamodsThis installs the marketplace's latest commit, which may not be the one read here (260d25cae05d). Compare them before you install.
Ask Claude about it
With the modscode connector added, Claude can read this design, what its code reaches and its code, and build on them. Ask it like this:
Read the modscode design "aieo-product-qa-guide" with its code and make me a pane like itSearch them from Claude: the MCP connector
Similar designs
-
Ask Claude…HandoffHandoffHandoff… the rest of the step is in the handoff████████░░░░░░░░ /clear in 4spress 1 to clear now, or send a prompt to stay
-
Ask Claude…Skins0 Your promptadd rate limiting to the hub api0 Tool rows: finished, running, failedYour prompt Spinner0 Folded group of reads and searches●main · note 3 · note 3 · note 30 Edit diff cardDesktop only; the terminal keeps Claude Code's diff.0 Shell output cardDesktop only.0 Code block cardDesktop only; the terminal keeps Claude Code's markdown.0 TableAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentCopyAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentCopyAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentCopy0 SpinnerAccent SpinnerSpinnerSpinner… 2h 10m0 Band above the prompt: normal, then nudging to compact█████░░░ 42% build█████░░░ 42% build█████░░░ 42% buildContext is 42% full0 Compact now0 Band above a questionTable BashBashBash0 Turn footer (terminal)3 build in 2h 10m · Grep · +3 −3
-
Ask Claude…Glossary BrowserGlossary openContextsContextsContexts▲ prevWrite1/Glossary▼ nextContexts
-
Ask Claude…envbuildbuildbuild+ .env.localsrc/app.ts is not in .gitignoreWriteNo .env files in the project root yet.K = paste the value, Enter saves saveNew key: NAME, Enter to continuegenerate randomcancelMissing compared with Write:KKK
-
What it does
- Draws a pane, a band above the prompt
- Watches Bash calls and can refuse them
- Hooks classic.CwdChanged, classic.SessionStart, classic.SubagentStart, classic.UserPromptSubmit and 5 more
- Keeps its own state between turns
-
Ask Claude…────────Clear doneClaude⋯└─ buildCancelCancelCancel└─ buildCancelCancelCancel└─ buildCancelCancelCancel