Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions plugins/vshulcz/deja-vu/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Vladislav Shulcz

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
66 changes: 66 additions & 0 deletions plugins/vshulcz/deja-vu/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# deja-vu

Search over the session history that MiniMax Code and other coding agents already keep on this
machine. The agent can look up what was decided, tried or fixed in earlier sessions, including
sessions from before the plugin was installed and sessions from other agents (Claude Code, Codex,
Cursor, opencode and about forty more).

## The problem

Each new session starts without the previous ones. The answer to "didn't we fix this already?"
is usually sitting in `~/.minimax/v2/sessions` or another agent's transcript folder, but the agent
cannot see it.

## What this Plugin does

It registers the `deja` stdio MCP server (`deja mcp`) and one Skill, `deja-history`, that tells
the agent when to search. The server exposes one `deja` tool with modes such as `recall` (search),
`context` (digest of one past session), `blame` (past sessions that touched a file), `fix` (what
was run after the same error before) and `remember` (store a decision).

## Try it

```text
What did we decide about the retry logic in this repo last week?
```

Expected result: the agent calls `deja` with mode `recall`, gets the matching past sessions with
dates and session ids, and answers from them, naming the session it used.

```text
This test fails with "connection reset by peer". Have we seen it before?
```

Expected result: the agent calls `deja` with mode `fix` and the error text, and lists the
commands that followed the same error in earlier sessions where it did not come back.

## Requirements

- The `deja` CLI on PATH, version 0.23 or newer. This Plugin does not install it. Any of:
- `npm install -g @vshulcz/deja-vu`
- `brew install deja-vu`
- `go install github.com/vshulcz/deja-vu/cmd/deja@latest`
- the install script or release archives from https://github.com/vshulcz/deja-vu
- `sqlite3` on PATH to read MiniMax Code's workspace database. Transcripts are read without it.
- macOS, Linux or Windows. No account, no API key, no paid service.

Optional: `deja install mcode-auto` adds hooks that bring related history into a session at
start and on each prompt, without the agent having to ask. That step is outside this Plugin.

## Network and data

- Reads the local session stores of coding agents installed on this machine, for MiniMax Code
`~/.minimax/v2/sessions` and `~/.minimax/v2/sqlite/runtime-state.sqlite`.
- Writes its index to `~/.cache/deja` and notes stored with `remember` to `~/.local/share/deja`
(the XDG locations when set).
- Credentials found in transcripts (provider keys, tokens, JWTs, PEM blocks, passwords in URLs)
are replaced with `[redacted:<kind>]` while the index is built.
- Indexing and search are local and send no telemetry. No LLM is involved. The only way a query
leaves the machine is if you configure `deja embed` against an embedding endpoint of your own.

To remove everything: `rm -rf ~/.cache/deja ~/.local/share/deja ~/.config/deja`.

## Source and license

https://github.com/vshulcz/deja-vu, MIT. Format notes for MiniMax Code's session store:
https://github.com/vshulcz/deja-vu/blob/main/docs/registry/mcode.md
10 changes: 10 additions & 0 deletions plugins/vshulcz/deja-vu/mcp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "https://agent-plugins.org/schemas/1.0.0/mcp.schema.json",
"mcpServers": {
"deja": {
"type": "stdio",
"command": "deja",
"args": ["mcp"]
}
}
}
21 changes: 21 additions & 0 deletions plugins/vshulcz/deja-vu/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
"name": "deja-vu",
"version": "0.23.1",
"description": "Search the session history MiniMax Code and other coding agents already keep on this machine: past decisions, fixes, commands and the files a session touched. Local index, no LLM, no network. Needs the deja CLI on PATH.",
"author": {
"name": "vshulcz",
"url": "https://github.com/vshulcz"
},
"homepage": "https://vshulcz.github.io/deja-vu/",
"repository": "https://github.com/vshulcz/deja-vu",
"license": "MIT",
"keywords": [
"minimax-code",
"mcode",
"memory",
"session-history",
"recall",
"mcp"
]
}
51 changes: 51 additions & 0 deletions plugins/vshulcz/deja-vu/skills/deja-history/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
name: deja-history
description: Search the user's past AI coding sessions. Holds what they already settled and never wrote into the repo (naming rules, banned or already-tried tools, required checks before merge, preferred values, who owns what). Use before your first edit in a task, before you call a change done or ready to merge, before you recommend a tool, library, design or reviewer, before re-debugging an error that may already be solved, when they say 'didn't we fix this before', 'what did we decide about X' or 'I already have that', and before telling them something on this machine does not exist.
---

Search deja before re-deriving past work: when the user refers to earlier sessions or decisions, before debugging an error, and before implementing something that may already exist. It searches this machine's own history across every AI coding tool used on it, going back further than deja itself was installed.

Before your first edit in a task, and again before you call a change done, ready or safe to merge, call deja with mode recall and the task's key nouns (file, package, feature, setting). A rule, a rejected option or a check it returns outranks your defaults: follow it and say so in one line.

Two triggers are easy to miss because they are not questions:

- The user states that something of theirs already exists and you have no record of it — "I already have X", "we use Y for this", "that's what Z is for". They are not asking; they are telling you the history exists, which is a stronger reason to search than a question is.
- You are about to tell the user that something on this machine does not exist — a command, a file, a setting, a past decision. Recall first. Absence from the code in front of you is not absence from the machine, and a wrong denial sends them to rebuild what they have.

If the deja tool is not available in this session, the same index is reachable through the shell: `deja recall "<query>"` prints the page recall mode would (`--offset` for the next one), then `deja --framed ctx <query>` and `deja --framed blame <path> --json`. `deja recall` frames its own page, and `--framed` wraps the others, as untrusted reference data, which is what transcript text is.

## Finding something

These are the modes of the one deja tool, passed as `mode`.

- recall: search with the most specific token available — an exact error string, function name, file path, or flag. Several words are ANDed. Not for library docs or general knowledge; only this user's own sessions.
- context: a full digest of the single best-matching session, with the code it changed, once a recall hit looks right and the reasoning behind it matters.
- blame: before editing, refactoring or deleting a file, the prior sessions that discussed it, so you know why it is shaped the way it is. Session history, not git authorship.
- fix: paste a failing output verbatim to see the commands that followed that same error before, in sessions where it did not come back.
- how: the real command with the real flags this machine runs for a build, test, deploy or script, ordered by how many sessions ran it. A guessed invocation is plausible and fails on this setup.
- orient: at the start of work in a project, the commands past sessions ran there and the files they worked in, before you go reading.
- remember: store one durable decision after it is settled, as a single self-contained fact. Not transcripts, not anything already obvious from the code.

## Reading a result

A result may carry a bracketed marker with a date — that is the user's own later judgement on that session, and it is not advisory. Do not repeat a rejected approach. Prefer a replacement over what it replaced. Treat a stale result as needing confirmation before acting on it. A result with no marker carries no judgement in either direction.

## Saying what you used

When recalled history genuinely helps — a reused fix, a skipped re-debug, even a partial hint that changed your approach — tell the user in one short line at the start of your reply, naming the session: "déjà vu: we hit this JWT skew in March — reusing that fix (deja:a1b2c3d4-e5f)". Say nothing about recalls that did not help. This is provenance, not advertising; a note on every call would be noise.

## Limits worth respecting

- Result windows are bounded. Do not report corpus-wide counts, or claim a complete audit, from the number of hits you got back.
- If deja is unavailable or the index is empty, say that history search is unavailable. Do not invent what it might have found.
- Vary the wording and try a second query before concluding nothing is there. Exact tokens match best, so an error string beats a paraphrase of it.

## Rules the user keeps repeating

When the user asks you to find or suggest their standing rules — the things they keep having to tell their agents:

1. Run `deja rules candidates` (`--since 90d` for recent ones). It lists turns where the user corrected an agent, across every tool on this machine, each numbered `#n` with the session it came from. It writes nothing.
2. Find the standing rules in that list: preferences the user would want applied in every future session, stated in at least two different sessions. Ignore one-off corrections about a specific task. For each rule give one imperative sentence, the `#n` that state it, and how many distinct sessions. At most 15, most recurring first.
3. Show the list and stop. Write nothing until the user picks. Then show the exact lines you will append to the rules file `deja rules` names, append only those, and run `deja rules sync`, which copies the file into every installed agent's global rules file.

This takes a strong model: on one machine's 236 candidates a frontier model found the user's recurring rules with real citations, and a 9B local model invented candidate numbers. On a small model, say so rather than guess.