Adding memory to Cline
its hooks cannot carry context; its plugins can
Cline writes every task to disk — the message log under its data directory, and the API conversation history under VS Code's global storage — and can reopen one. A new task reads your rules files and nothing else: not last week's task, and not the Claude Code or Codex session on the same machine where the problem was already solved. This page is about adding that.
Why not hooks
Cline has hooks, and deja does not use them, because they cannot say anything to the model. Verified against CLI 3.0.46: TaskStart and UserPromptSubmit are spawned detached with stdout closed, PreToolUse keeps only cancel and overrideInput, PreCompact is mapped to no event at all, and --hooks-dir is read by nothing.
Adding recall
deja install cline-auto
That registers a plugin with three parts, plus the MCP server so the model can call the deja tool itself — search past sessions, read one in full, see a file's history, ask what fixed an error, ask how a command is really run here, store a decision:
- A rule whose content is a function, resolved when the session builds its instructions — session-start recall by another name. A rule is handed nothing, so it recalls against the session rather than the question.
- A message builder, the prompt-aware half: its build is called with the messages on their way to the model, and the new array it returns is what gets sent. That is where the history the prompt is actually about goes in.
- A
/dejacommand in the same session, for asking directly.
What arrives
At task start, a digest of what this machine has done on the project. On each prompt, the history it is about, when there is any; silence is the common case. An injection is capped at about 1.5 KB per prompt and 4 KB per tool call — what memory costs has the measured comparison.
The part that is not about Cline
The index covers every agent's transcripts on the machine — twenty-two of them, each in its own format — so a fix found in Claude Code answers a question asked in Cline, including sessions from before any of this was installed. A transcript a client later deletes stays searchable; only deja forget drops one on purpose. Nothing here writes memories, so there is nothing to hallucinate into your history; indexing and search are local, and credentials are stripped as the index is built (privacy).
Getting started · Switching between agents · The Cline session format