Loki Prompt Optimization Skill
Automatically repeats prompts so non-reasoning LLMs like Haiku get several times more accurate on structured tasks, with zero latency cost.
Claims to apply a technique from an arXiv paper (prompt repetition improves non-reasoning-model accuracy), citing specific improvement figures (+46%/+36%/+62%) that weren't independently reproduced or verified in this review.
What does this skill do, and when should you use it?
One of four skills bundled in the Loki Mode repository, located at agent-skills/prompt-optimization/SKILL.md. Based on the paper "Prompt Repetition Improves Non-Reasoning LLMs" (arXiv 2512.14982v1), it automatically duplicates prompts twice (or three times) when a Haiku agent runs structured tasks such as tests, linting, parsing, or list operations. The repetition happens in the parallelizable prefill stage, reportedly improving accuracy 4-5x with no latency penalty. It activates automatically and explicitly does not apply to reasoning models like Opus or Sonnet.
When it detects a Haiku agent executing a structured task — unit test execution, linting and formatting, parsing and extraction, or list find/filter/count — it automatically repeats the prompt 2 times (configurable to 3 via LOKI_PROMPT_REPETITION_COUNT for position-critical tasks). The repeated prompt enables bidirectional attention in the prefill stage to raise accuracy. It also records accuracy-improvement and cost-benefit metrics under .loki/metrics/prompt-optimization/.
- Inside the Loki Mode pipeline, making Haiku subagents reliably run unit tests — self-reported accuracy rises from 65% to 95%.
- When a Haiku agent parses structured data (JSON/YAML extraction), reducing missed fields: reported accuracy from 58% to 94%.
- Running lint and formatting tasks so the agent catches all violations (72% → 98%).
- Finding, filtering, or counting items in long lists with a lower chance of omissions or miscounts.
- For position-critical tasks, raising repetition to 3x to counter non-reasoning models' insensitivity to prompt position.
What are this skill's strengths and limitations?
- Zero latency impact: repetition occurs in prefill, not generation.
- Fully automatic — agents need no extra instructions and users need no setup to benefit.
- Backed by published research (arXiv 2512.14982v1) with per-task quantitative gains.
- Tunable per workload (repetition count) and can be switched off via env var.
- Only helps non-reasoning models (Haiku); no benefit and no effect for reasoning models like Opus/Sonnet.
- Improvement figures are self-reported by the repo; no independent reproduction is provided.
- Bound to the Loki Mode environment (dedicated env vars and .loki metrics directory); adapting it elsewhere requires work.
- The repo's license field is NOASSERTION (the README states BUSL-1.1 for the overall project) — check terms before commercial use.
How do you install this skill?
The skill ships with the Loki Mode repository. Installing Loki Mode includes it: run bun install -g loki-mode (npm, Homebrew, and Docker also work — see the repo's installation docs). For standalone use, mirror the agent-skills/prompt-optimization/ folder structure into your Agent Skills directory; SKILL.md does not document standalone installation steps for other Agent Skills clients.
How do you use this skill?
It activates automatically for Haiku agents — no manual invocation needed. Control via environment variables: LOKI_PROMPT_REPETITION=true/false toggles it; LOKI_PROMPT_REPETITION_COUNT=2 (default) or =3 sets repetition count. Metrics land in .loki/metrics/prompt-optimization/ as accuracy-improvement. and cost-benefit.. Full documentation is referenced at references/prompt-repetition.md.
How does this skill compare with similar options?
The source names no direct competitor for this skill; it is an internal quality mechanism of Loki Mode and operates at a different level from general prompt-engineering techniques (e.g., few-shot examples), so no head-to-head comparison is warranted.