Completion Ranking

@ files and / commands you use often rise to the top of the completion menu

The interactive @ and / menus float the files and commands you pick most into the top slots — no setup, no config.

Diagram

⌨️ Type /h or @acc

🔎 Fuzzy match

💾 Usage history

➕ Boost

📊 Reorder close matches

⭐ Your pick first

Quick Start

  1. Pick a file once with @

    Start an interactive session, type @acc and accept src/accounts.py from the popup.

    text
    ❯ @acc
      src/account_service.py
      src/accounts.py        ← accept this one
  2. Pick it again — it's first in the menu

    Next time you type @acc, the file you chose is ranked above the other close matches.

    text
    ❯ @acc
      src/accounts.py        ← now on top
      src/account_service.py

How It Works

Each pick is recorded, and the next menu uses a small usage boost (0–20) to reorder matches.

Diagram
Usage history@ / PopupUserUsage history@ / PopupUserType @accBoost for each match?0–20 per itemMenu reorderedAccept src/accounts.pyRecord pick (count + time)

Recent picks count more than old ones:

Age of last pickRecency weight
< 4 hours1.0
< 1 day0.7
< 1 week0.5
< 30 days0.3
≥ 30 days0.1

The boost is round(count × weight × 4), capped at 20.

  • @ files — the boost is added to the 0–100 fuzzy score before sorting.
  • / commands — matching commands are sorted by boost alone; ties keep their original order.
Diagram

No

Yes

< 4h

< 1d

< 1w

< 30d

older

Is there usage
history for this item?

Pure fuzzy order
exactly as before

How recent?

Full weight 1.0

0.7

0.5

0.3

0.1

Boost = count × weight × 4
capped at 20

Which Surfaces Use It

Ranking applies wherever you accept an @ file or a / command from a menu.

SurfaceWhat gets ranked
@ file popup (Textual TUI)File paths you accept
/ command popup (Textual TUI)Commands you accept
/ completer in prompt_toolkit REPLCommands, using picks recorded in the TUI popup

Where History Is Stored

History lives in ~/.praisonai/sessions/projects/<project-id>/frecency.json (under PRAISONAI_HOME if set).

Clones and worktrees of the same repo share one history. Delete the file to reset ranking.

No Config Needed

There is no on/off switch — an empty history already gives the original fuzzy order.

Best Practices

Reset ranking per project

Delete frecency.json in the project’s sessions folder to start fresh. The next pick creates a new file.

History is per-project, not global

Clones and worktrees of the same repo share history; unrelated repos never see each other’s picks.

Type more to reach any item

For @ files the 20-point cap keeps much better string matches on top. For / commands, used commands rise above unused ones — type more of the name to narrow the list.

No history leak between kinds

Files and commands are tracked separately, so a busy /help never affects @ file order.

Related