deja-vu · vshulcz — Claude Code hook: cross-session memory
deja-vu is a hook bundle that hands the agent notes from earlier sessions, so it starts out already knowing what was done before.
MIT ★ 1,645 updated 2026-10-24
/plugin marketplace add vshulcz/deja-vu
/plugin install deja-vu@deja-vuWhat deja-vu does
deja-vu ships as hooks for the Claude Code plugin. Recall fires on six lifecycle events: PreToolUse, PostToolUse, UserPromptSubmit, SessionStart, SessionEnd, PreCompact. Each one calls deja.sh with its own subcommand; the timeout is 10 seconds, and the status message shows what is being loaded.
Matchers decide when a hook runs. PostToolUse covers Bash and PowerShell; PreToolUse also watches Edit, Write, MultiEdit, NotebookEdit, plus Task and Agent calls.
Memory is shared across Claude Code, Codex, Cursor, opencode and thirty-nine more agents, so the same work does not get recorded twice. MIT license. Configuration lives in .claude/settings.json.
What it helps with
- restore working context after the agent restarts
- find how a similar error was fixed earlier
- avoid re-analyzing a file that was already reviewed
- save session state before the window closes
- keep key actions when the transcript is compacted
Example prompts for the agent
- Check whether we touched this file in an earlier session before editing it
- Recall how the last run of
deploy.shended - Save this session to memory before I close the window
How to install deja-vu
1Plugin marketplace
/plugin marketplace add vshulcz/deja-vu/plugin install deja-vu@deja-vu2Manually: put the files in place
.claude/settings.jsonThe hooks block: event (PreToolUse, PostToolUse, Stop…) → command. Personal ones go to ~/.claude/settings.json
Step by step, with commands for each platform: Claude Code hooks: what they are, where to configure them, how to block a risky command
Questions about deja-vu
How do I install deja-vu in Claude Code?
Run /plugin marketplace add vshulcz/deja-vu, then /plugin install deja-vu@deja-vu. The hooks are registered in .claude/settings.json.
What does deja-vu do?
Its hooks feed the agent records from previous sessions at startup and on each step, so context is not empty.
Which agents share deja-vu's memory besides Claude Code?
Codex, Cursor, opencode and thirty-nine more agents write to the same store.
Source text
claude-plugin · MIT
Hooks bundle shipped with the deja-vu plugin for Claude Code.
Your agent starts already knowing what you did before — recall across Claude Code, Codex, Cursor, opencode and thirty-nine more agents.
Triggers on: PreToolUse, PostToolUse, UserPromptSubmit, SessionStart, SessionEnd, PreCompact.
```json
{"PreCompact":[{"hooks":[{"type":"command","command":"${CLAUDE_PLUGIN_ROOT}/hooks/deja.sh hook-precompact","timeout":10,"statusMessage":"Saving this session to memory…"}],"matcher":"manual|auto"}],"PreToolUse":[{"hooks":[{"type":"command","command":"${CLAUDE_PLUGIN_ROOT}/hooks/deja.sh hook-tool","timeout":10,"statusMessage":"Checking what this touches…"}],"matcher":"Bash|PowerShell|Edit|Write|MultiEdit|NotebookEdit|Task|Agent"}],"SessionEnd":[{"hooks":[{"type":"command","command":"${CLAUDE_PLUGIN_ROOT}/hooks/deja.sh hook-session-end","statusMessage":"Marking this session as ended…"}]}],"PostToolUse":[{"hooks":[{"type":"command","command":"${CLAUDE_PLUGIN_ROOT}/hooks/deja.sh hook-tool-after","timeout":10,"statusMessage":"Checking what fixed this before…"}],"matcher":"Bash|PowerShell"}],"SessionStart":[{"hooks":[{"type":"command","command":"${CLAUDE_PLUGIN_ROOT}/hooks/deja.sh hook-context","timeout":10,"statusMessage":"Recalling past sessions…"}]}],"UserPromptSubmit":[{"hooks":[{"type":"command","command":"${CLAUDE_PLUGIN_ROOT}/hooks/deja.sh hook-prompt","timeout":10,"statusMessage":"Searching past sessions…"}]}]}
```
© vshulcz · MIT · vshulcz/deja-vu
Similar hooks
All hooks for Agent setup: memory, context, orchestration →deja-vu by other authors comes first.