@everme/cline
v0.7.10
Published
EverMe long-term memory for Cline CLI: profile and recall injection and automatic turn capture, as a Cline hooks plugin.
Readme
@everme/cline
EverMe memory for Cline CLI 3.x, as a Cline hooks plugin.
What it does
evercli plugin install cline does three things:
- It stages this bundle at
~/.cline/plugins/everme/. - It writes credentials to
~/.cline/everme.env(mode 0600). - It adds the read-only
everme-memoryMCP server to~/.cline/data/settings/cline_mcp_settings.json.
Cline finds plugins under ~/.cline/plugins by itself. The cline.plugins entry
in package.json makes Cline load src/plugin.js only.
| Hook | What it does |
|---|---|
| beforeRun | Returns appendContext with the profile (first run of a session only) and the recall for the prompt. Cline saves this context as a <hook_context> message, so the model keeps it for every tool step of the run. |
| afterRun | Starts bin/worker.js as a detached process. The worker reads the session file and uploads the new messages. |
Cline runs one agent run for each user message, so afterRun fires once per turn.
Limits that come from Cline
- Each plugin hook has 3 s. Cline counts five failures in a row and then
disables the plugin.
beforeRuntherefore waits at most 2.3 s for the profile and the recall. If the recall search takes longer, the plugin drops it for that prompt. - The CLI exits right after a one-shot run. That stops the plugin process,
so the plugin does not upload in-process. The detached worker runs with
Cline's own binary (
BUN_BE_BUN=1), so the upload needs no separate Node. - The hub daemon shares one process. Cline can run plugins inside its
long-lived hub daemon, which keeps the environment of the CLI that started
it. For this reason the plugin reads credentials from
everme.env, not fromprocess.env. The worker also checks that the run's last message is in the session file that the plugin names. If the message is not there, the worker searches the newest session files for it. - No
beforeModelhook. Cline sends the full request (all messages and tools) over IPC for every model call. Cline also prints a warning to the terminal when the payload cannot be cloned. - Script hooks (
~/.cline/hooks) are not used: the CLI runsTaskStartandUserPromptSubmitdetached and ignores their output. - The VS Code extension does not load plugins. This package covers the CLI only.
How a turn is read
Cline rewrites ~/.cline/data/sessions/<id>/<id>.messages.json after each
message. The worker maps the file like this:
| Cline | EverMe |
|---|---|
| user text inside <user_input mode="…"> | role: user, wrapper removed |
| user message with metadata.displayRole: "system" (hook context, our profile and recall) | dropped |
| assistant text blocks | role: assistant |
| tool_use | toolCalls (arguments as a JSON string) |
| tool_result | role: tool, toolCallId = tool_use_id |
| thinking, image, file | dropped |
The checkpoint stores the Cline message ids that are already uploaded. Each upload sends only the messages after the checkpoint. A capture that runs again on an unchanged file sends nothing. The first capture of a session that started before the install sends only the newest turn.
Test
npm test --workspace @everme/clinetests/fixtures/ holds three real Cline CLI 3.0.74 session files. The paths in
them are redacted, and system_prompt is removed.
