Aletheia

Windsurf memory with Aletheia

Aletheia (aletheia-mem) can write a local memory setup for Windsurf: an MCP server entry, four Cascade hooks, a global rules file and a per-project rules file. This setup is config written from docs, not tested on a real install. No hook ran in Windsurf. Windsurf has no session-start or session-end hook, so Aletheia injects no context there.

What you get

Level: full. Verification: from-docs-only. No session-start context and no session-end summary, because Cascade has neither event.

Install

npm install -g aletheia-mem
aletheia install windsurf            # dry run: prints every step, writes nothing
aletheia install windsurf --write    # MCP entry, hooks and global rules, with backups
aletheia rules sync --tools windsurf --dir <project> --write    # the project rules file

Restart Windsurf afterwards.

What gets written

Real dry-run output from a temporary HOME. Paths start with /tmp/tmp.Ez6NqCkeLC, the temporary home folder of the run. On your machine they start with your own home folder.

$ aletheia install windsurf
Windsurf (windsurf) — full, from-docs-only
  write  mcp      /tmp/tmp.Ez6NqCkeLC/.config/devin/mcp_config.json  (mcpServers.aletheia)
  write  hooks    /tmp/tmp.Ez6NqCkeLC/.codeium/windsurf/hooks.json  (pre_user_prompt, post_run_command, post_write_code, post_cascade_response)
  write  rules    /tmp/tmp.Ez6NqCkeLC/.codeium/windsurf/memories/global_rules.md  (1 rule)
  note  Cascade has no session-start/session-end hook: there is no context injection and no session-end summary.
  note  Hooks run from the workspace root by default; the installer omits working_directory.
  ...
Dry run: nothing was written. Add --write to apply.

The MCP file path is chosen by the code like this: ~/.config/devin/mcp_config.json unless the legacy ~/.codeium/windsurf/mcp_config.json already exists, or only the legacy folder exists. The code was read, not tested on a machine with the legacy layout.

The hooks file that --write produced. Windsurf's format is a flat array per event:

{
  "hooks": {
    "pre_user_prompt": [
      {
        "command": "/home/you/.bun/bin/bun /tmp/tmp.eHRtbNMs5s/aletheia.bundle.mjs hook windsurf pre_user_prompt # aletheia-managed"
      }
    ],
    ...
  }
}

The Windsurf docs have moved. docs.windsurf.com/windsurf/cascade/hooks, /mcp and /memories answered with a redirect to docs.devin.ai/desktop/cascade/... on 2026-10-29, and the product is documented as Devin Desktop. Those pages (fetched 2026-10-29) agree on these points: the user hook file is ~/.codeium/windsurf/hooks.json; the MCP file is ~/.config/devin/mcp_config.json with a mcpServers object of command and args; the global rules file is ~/.codeium/windsurf/memories/global_rules.md.

Hooks and events

EventWhat Aletheia does
pre_user_promptStores tool_info.user_prompt as a note, redacted. Prompts under 3 characters are skipped.
post_run_commandStores a Shell event with tool_info.command_line. It stores no command output.
post_write_codeStores a Write event with tool_info.file_path and tool_info.edits. It stores no output.
post_cascade_responseStores tool_info.response as a summary, once per response. Queues the session for compression.

The Devin Desktop hooks page lists 12 events, including pre_read_code, pre_write_code, pre_run_command and post_mcp_tool_use. Aletheia installs four. The page says pre_user_prompt can block a prompt with exit code 2. Aletheia's hook always exits 0, so it never blocks. The page also says there is no session-start or session-end event.

Not captured, because the events do not exist or are not installed:

Every hook exits 0 whatever happens, makes no network call and no model call, and redacts before it stores. The project name comes from tool_info.cwd, then the payload cwd, then the hook process directory. See Hooks reference.

Rules file

aletheia install windsurf --write adds the managed block to ~/.codeium/windsurf/memories/global_rules.md. It is a plain block, with no frontmatter:

<!-- aletheia:rules:begin -->
# Rules

Managed by aletheia-mem. Edit them in the Rules page; this block is rewritten on sync.

## Everywhere

- Run the narrow test before the full suite.
<!-- aletheia:rules:end -->

For a project, aletheia rules sync --tools windsurf --dir <project> --write writes <project>/.windsurf/rules/aletheia.md. Real output in the test run: - windsurf: /tmp/tmp.e1CAvpmUGV/myproject/.windsurf/rules/aletheia.md — 1 rules, written. The file starts with frontmatter that makes the rule always on:

---
trigger: always_on
---

<!-- aletheia:rules:begin -->
...
<!-- aletheia:rules:end -->

The Devin Desktop memories page (https://docs.devin.ai/desktop/cascade/memories, fetched 2026-10-29) says the global file is always on and limited to 6,000 characters, that workspace rules live in .devin/rules/*.md (preferred) or .windsurf/rules/*.md (fallback), each limited to 12,000 characters, and that the trigger field takes always_on, model_decision, glob or manual. Aletheia writes the fallback path .windsurf/rules/. See Rules.

Verify it works

aletheia install windsurf --verify
aletheia doctor

--verify prints ok, drift or missing for the MCP file, the hooks file and the global rules file. In doctor, look for hooks windsurf 4/4 in ...hooks.json. The verify windsurf line says verified with the evidence text no working Windsurf/Devin install here. The word verified there means the evidence date is recent. It does not mean a real install was tested.

Nobody has seen these hooks run in Windsurf. If you try it:

  1. Run the install, restart Windsurf, and send one prompt to Cascade.
  2. Run aletheia search "<a word from your prompt>", or open http://127.0.0.1:37790 and check the Activity and Knowledge tabs. The Connections tab shows the hook count and the time of the last capture.
  3. Report what you saw, with your Windsurf or Devin Desktop version, in an issue at https://github.com/mohamed-ashraf-elsaed/aletheia-mem/issues.

Uninstall

aletheia uninstall windsurf            # dry run
aletheia uninstall windsurf --write

Real dry-run output:

Windsurf (windsurf)
  remove mcp      /tmp/tmp.Ez6NqCkeLC/.config/devin/mcp_config.json
  remove hooks    /tmp/tmp.Ez6NqCkeLC/.codeium/windsurf/hooks.json  (no aletheia hooks)
  remove rules    /tmp/tmp.Ez6NqCkeLC/.codeium/windsurf/memories/global_rules.md
Dry run: nothing was written. Add --write to remove.

The (no aletheia hooks) label is the installer's own wording for the hooks line. In the Claude Code test run the same label appeared and the hook entries were removed. Uninstall does not remove .windsurf/rules/aletheia.md. Delete that file yourself in each project where you ran rules sync.

Verification status

Known limits

Next steps