Skip to content
Skill

Rag reranker

Reranks retrieved RAG passages by whether they answer a question and checks citations

Rag reranker is an open-source agent skill for knowledge and memory. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

Scripts
None
Platforms
Claude Code, Codex, Cursor
GitHub stars
440
Last commit
License
MIT
Listing updated

Similar skills

About Rag reranker

This skill helps an agent filter a batch of retrieved passages before they go into a prompt. Each passage is judged against a question as answering it, relating to it without answering, or being unrelated, and the agent keeps only the ones that answer. It also covers a second pass that checks each claim in a generated answer against the passage it cites, flagging claims that are unsupported or contradicted by their source.

The workflow sends all candidates in one batched call to an external classification API at classifier.dev, using the returned scores and calibrated confidences to rank and cut passages. The skill includes a Python example using the standard library, and it advises rank-by-score and gate-by-confidence with thresholds for when to trust a result, when to have a model review it, and when to treat it as unreliable.

It expects a vector search or retrieval step that has already produced candidate passages and a question, plus network access to the classifier.dev service and Python for the sample code. The skill does not generate text itself and does not perform first-stage retrieval.

When your agent uses it

Rerank retrieved passages by whether each one answers the question, drop the near-misses before they reach the prompt, and check every citation in the answer against the passage it points at. Use after a vector search returns twenty plausible chunks, or when an answer needs its citations verified. Triggers on "rerank these", "which chunks answer this", "check these citations", "my RAG cites the wrong chunk".

From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.

What it can access

From a static check of its 1 file (6 KB) on GitHub on 4 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.

Check another skill before you install it.

Install

Copy the skill folder to ~/.claude/skills/rag-reranker to use it in all your projects:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mrmps/classifier-dev.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/rag-reranker &&
cp -R "$tmp/skills/rag-reranker" ~/.claude/skills/rag-reranker &&
rm -rf "$tmp"

For one project only, put the folder in .claude/skills/rag-reranker inside it instead.

Claude Code docs on skills

Copy the skill folder to ~/.agents/skills/rag-reranker to use it in every repository:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mrmps/classifier-dev.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/rag-reranker &&
cp -R "$tmp/skills/rag-reranker" ~/.agents/skills/rag-reranker &&
rm -rf "$tmp"

For one repository only, put the folder in .agents/skills/rag-reranker inside it instead.

Codex docs on skills

Copy the skill folder to ~/.cursor/skills/rag-reranker to use it in every project:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mrmps/classifier-dev.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/rag-reranker &&
cp -R "$tmp/skills/rag-reranker" ~/.cursor/skills/rag-reranker &&
rm -rf "$tmp"

For one project only, put the folder in .cursor/skills/rag-reranker inside it instead.

Cursor docs on skills

Run in a terminal (add --scope workspace to install it for the current workspace only):

gemini skills install https://github.com/mrmps/classifier-dev.git --path skills/rag-reranker

Or copy the folder to ~/.gemini/skills/rag-reranker yourself.

Gemini CLI docs on skills

For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/rag-reranker:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mrmps/classifier-dev.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/rag-reranker &&
cp -R "$tmp/skills/rag-reranker" ~/.copilot/skills/rag-reranker &&
rm -rf "$tmp"

For one project only, put the folder in .github/skills/rag-reranker inside it instead.

VS Code docs on skills

Get the folder:

git clone --depth 1 https://github.com/mrmps/classifier-dev.git

Then copy classifier-dev/skills/rag-reranker into your agent's skills folder as rag-reranker. Agents that support SKILL.md read one folder per skill.

The SKILL.md format

What it does

Passage relevance ranking
Scores each retrieved passage on whether it answers the question, so candidates can be sorted by that score.
Near-miss filtering
Drops passages labelled as related but not answering, or unrelated, before they reach the prompt.
Citation verification
Checks each generated claim against the passage it cites, labelling it as stated, merely about the topic, or contradicted.
Confidence-based gating
Uses calibrated confidence thresholds to decide which results to trust, review or discard.
Batched API calls
Classifies up to 1,000 passages in a single request to the classifier.dev endpoint.

Good for

  • Rerank twenty chunks from a vector search and keep only those that answer my question
  • Check whether each citation in my RAG answer actually supports the claim it is attached to
  • Trim retrieved context down to the passages that contain the answer before prompting a model
  • Find which of my RAG chunks is citing the wrong source

Rag reranker FAQ

What does the skill need to run?

It calls the classifier.dev classify endpoint over the network and includes a Python example using the standard library. A User-Agent header must be set, since the default Python one is refused with a 403.

Does Rag reranker write or change the answer?

No. It only picks among the labels you supply. Writing the answer, summaries or citation rewrites remain the agent's job.

When should Rag reranker not be used?

Not for first-stage retrieval, not when only a few passages are already in context, and not when every candidate is relevant, since a uniformly good set will all be labelled as answering.

How should the results be interpreted?

Rank passages by the score for the answering label and gate on confidence: 0.9 and above can be acted on, 0.5 to 0.9 should be checked by a model, and below 0.5 should not be the sole source of a claim.

How do I install Rag reranker in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/rag-reranker to use it in all your projects, or to .claude/skills/rag-reranker in one project.

Does Rag reranker run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

Which AI agents can use Rag reranker?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

What are the best alternatives to Rag reranker?

The closest alternatives to Rag reranker are Rag and model tuning, Rag eval, Kb query, Haiku rag and Rag perf.

Where this comes from

  • Description: from the skill's own SKILL.md.

More from mrmps/classifier-dev

  1. Sorts many texts into your own labels in one call, with a confidence per answer

    • Open source
    • 440 GitHub stars
    • Developer tools
  2. Lets a browser or desktop agent pick its next action from on-screen elements

    • Open source
    • 440 GitHub stars
    • Browser automation
  3. Gates user posts against a written content policy using per-category scores

    • Open source
    • 440 GitHub stars
    • Security
  4. Sorts each page of a multi-document intake packet by type before extraction

    • Open source
    • 440 GitHub stars
    • Files and documents
  5. Sorts a downloads folder into invoice, receipt and contract folders with an undo log

    • Open source
    • 440 GitHub stars
    • Files and documents