Back to OneCue

How OneCue works.
Hooks in. One cue out.

The lifecycle, the store, and the judge — the whole loop that puts your project’s decisions in front of the agent before it edits the code.

OneCue

open source · onecueai/onecue-cli

The decision layer for coding agents. Your agent reads your project’s decisions before it edits.

The OneCue lifecycleSET UPINSTALLS HOOKSCAPTURESSURFACESCOMMITS01Installonecue.sh/install.shor npx skills add02onecue installWrites the four hooks into.claude/settings.local.json03Claude hooksALWAYS ONUserPromptSubmitPostToolUseSessionEndStoponecue.onecue/decisionschoice · reason · rules-outgit-visible · one file each04RecallThe cues that matter, with their source.Or silence.05Commit.onecue/ travelswith the repo.

What are hooks, and why you need them?

Your agent forgets your decisions between sessions. Hooks capture them on the way out and surface the one that matters on the way in, with no LLM and no network on the recall path.

onecue17 decisions0 violated78% context saved

Illustrative onecue doctor line.
  • No vector DB
  • 100% local
  • No network on recall
  • Git-shared .onecue/
  • As few as needed, or silence
  • Claude Code · Codex · Cursor

The four hooks

UserPromptSubmit

Before the agent acts: retrieve candidates, judge relevance, inject only the decisions this task would touch — usually one, a few when it spans several. Silent by default. Always exits 0.

PostToolUse

Records a cheap receipt: which files the turn touched. Never stores raw tool output.

Stop

Turn complete: extract any durable decision from the exchange and write it to .onecue/decisions/.

SessionEnd

Marks the session closed. Kept minimal. The shared end-of-session budget is tight.

What a decision looks like

Plain Markdown, readable by you and the agent. The frontmatter carries the reason and provenance; the body is the decision itself.

---
kind: "decision"
outcome: "rejected"
reason: "Redelivered webhooks double-charged a customer."
files: ["src/webhooks/stripe.ts"]
---

Claim the Stripe event id in processed_events before
applying a payment. Retries redeliver the same event.

How the judge chooses

Precision over recall. The unsolved half of the problem is not storing context. It is refusing to inject the wrong one.

  • score = retrieval · 0.6 + lexical overlap · 0.25 + kind / rejected / file boosts
  • surface one cue only when score ≥ 0.45, otherwise stay silent
  • a rejected approach, and a file you are editing, both raise the score
  • prefer a false negative (silence) over a wrong interruption

How decisions relate

Decisions are not a flat pile. They point at each other, and recall reads the links — so you get the current decision, and a warning when two disagree instead of one side picked in silence.

  • supersedes: a newer decision retires an older one — recall surfaces only the head of the chain, never the retired ancestor
  • conflicts-with: two active decisions disagree — recall surfaces the match and flags the conflict rather than picking a side
  • a supersede cycle (a data error) retires nothing and is reported — a bad link can never hide both decisions
  • onecue doctor summarizes the graph: conflicts, cycles, and decisions retired by a supersede

Install it and watch the first decision get captured.

Install OneCue