The prompt optimizer rewrites a vague or hedged prompt into a specific, scoped, actionable one — before you send it to the agent. Trigger it with Cmd+Shift+Enter (macOS) / Ctrl+Shift+Enter (Linux), or click the ✨ sparkle button in the input toolbar.
On error or unchanged text, the original is restored silently. Typical overhead: 2–5 seconds.
Optimization helps most when the original is:
Optimization is unnecessary when the prompt is already:
The optimizer knows this — it returns the original unchanged when there's nothing worth adding.
The optimizer's system prompt encodes six rules (earlier wins on conflict):
min(3 × original length, 250 words)Before:
fix the zoom bug in the dashboard
After:
Fix the zoom bug in the dashboard chat input. Scope: - `website/src/hooks/useZoom.ts` — cleanup CSS custom properties on unmount - `website/src/components/ChatInput.tsx` — cache the `effectiveVh()` result per render Constraints: - Preserve existing zoom-in and zoom-out gestures - Do not change the public API of `useZoom` - Run `npm run build` and `npm run test` before completing If you find related issues while fixing this, list them but do not fix them in this change.
Same intent, but the agent now knows the files, the constraints, and where to stop.
The optimizer receives:
<original_prompt> tagsContext makes the optimizer smarter when you're mid-conversation: it picks up file names, error messages, and prior scope from the recent history. In a fresh session, it works from the prompt alone.
The optimizer runs on a dedicated _optimizer session with the kirocrew-lite agent — a small, tools-disabled agent tuned for single-shot rewrites.
_bg session (which handles title generation and folder categorization)asyncio.wait_for wraps the entire operation (session claim + stream + release)On timeout or error, the original text is silently restored. The optimizer never fails loudly.
Output is passed through redact_credentials() and redact_exfiltration_urls() before it reaches your textarea. If the optimizer ever surfaces a credential pattern from context, it's redacted.
Prompt optimizer