Dev & Engineering prompt-engineeringprompt-repetitionstructured-tasksunit-testingparsinglintinghaiku-agentsaccuracy

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.

FollowSkills review · FSRS-1.0
Recommended
60/ 100 5-point scale 3.0 / 5
This review was completed under FSRS 1.0. Dimension scores are not converted; it is queued for re-review under FSRS 2.0.
1 2 3 4 5 6
1Utility11 / 20 · 2.8/5
2Reliability10 / 20 · 2.5/5
3Safety22 / 25 · 4.4/5
4Evidence5 / 15 · 1.7/5

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.

5Usability7 / 10 · 3.5/5
6Maintenance5 / 10 · 2.5/5
Evidence confidence:Low Reviewed Jul 17, 2026
Review evidence [1]
See the full review method →

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/.

  1. Inside the Loki Mode pipeline, making Haiku subagents reliably run unit tests — self-reported accuracy rises from 65% to 95%.
  2. When a Haiku agent parses structured data (JSON/YAML extraction), reducing missed fields: reported accuracy from 58% to 94%.
  3. Running lint and formatting tasks so the agent catches all violations (72% → 98%).
  4. Finding, filtering, or counting items in long lists with a lower chance of omissions or miscounts.
  5. 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?

Pros
  • 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.
Limitations
  • 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.

FAQ

Will it slow my model down?
No. Repetition happens in the parallelizable prefill stage, not during generation; the repo claims zero latency impact.
Do I need to enable or configure anything?
No. It is enabled by default for Haiku agents in Loki Mode; you only set env vars to disable it (LOKI_PROMPT_REPETITION=false) or change the repetition count (LOKI_PROMPT_REPETITION_COUNT).
Does it help with Opus or Sonnet?
No. SKILL.md states reasoning models see no benefit from repetition, so the skill does not apply to Opus/Sonnet agents.
Can I install this skill standalone in another Agent Skills client?
The SKILL.md is a standard-format instruction file, but its automatic repetition depends on the Loki Mode runtime and dedicated env vars; outside Loki it serves mainly as reference material for the prompt-repetition technique.

More skills from this repository

All from asklokesh/loki-mode

Related skills