v0.2.20
flowglad/flowgladv0.2.20Sep 4, 2026by het0814
AI Summary
This release overhauls the `memanto connect` system by introducing version-stamped agent instructions, a new hook system for Claude Code, Codex CLI, and Cursor, and update detection capabilities. It also resolves Windows-specific issues with template rewriting and the Connections UI.
Key Highlights
- Version-stamped agent instructions with automatic update detection
- New hook system for session start and memory sync in IDE integrations
- Separate local and global instruction file paths per agent
- Windows-specific fixes for template rewriting and UI handling
New Features
- Versioned agent instructions with update detection
- memanto connect update command
- Hook installation for Claude Code, Codex CLI, and Cursor
- Instruction update banner in the Web UI
Full Release Notes
# Release Notes for v0.2.20
This release is a full overhaul of `memanto connect`: agent instructions and the `memanto-memory` skill were rewritten and are now version-stamped, so Memanto can tell when an installed integration is stale and update it in place. Connect gained a real hook system, session-start and pre-compact memory sync plus readable in-chat summaries of memory operations for Claude Code, Codex CLI, and Cursor and instruction file paths are now resolved separately for local and global installs across all 14 supported agents. Alongside it are Windows-specific fixes to template rewriting and the Connections UI.
## New Features
- **Versioned agent instructions with update detection** (`memanto/cli/connect/updater.py`, `memanto/cli/connect/templates.py`)
- Instruction files and `SKILL.md` now carry a `<!-- memanto-template-version: X.Y.Z -->` stamp, seeded at `TEMPLATE_VERSION = 1.0.0`.
- New `check_for_updates()` scans every registered agent, locally and globally, and reports the lowest installed version; a file carrying the legacy `<!-- MEMANTO-MANAGED-SECTION -->` marker with no version tag is treated as `0.0.0`.
- `memanto status` and `memanto memory sync` now print a non-fatal notice when any installed integration is behind the shipped version.
- **`memanto connect update`** (`memanto/cli/commands/connect.py`, `memanto/cli/connect/updater.py`)
- Re-installs the latest instructions and skill for every active integration, local and global, in one command, with deduplicated per-agent status output and an error summary if any agent fails.
- **Hook installation for Claude Code, Codex CLI, and Cursor** (`memanto/cli/connect/assets/hooks/`, `memanto/cli/connect/engine.py`, `memanto/cli/connect/agent_registry.py`)
- Hook definitions now ship as JSON assets (`hooks.json`, `codex-hooks.json`, `cursor-hooks.json`) plus two Python scripts copied into the agent's `hooks/` directory at connect time; `${CLAUDE_PLUGIN_ROOT}`, `${PLUGIN_ROOT}`, and `${CLAUDE_PROJECT_DIR}` are substituted with real paths on install.
- `session_start.py` refreshes `MEMORY.md` on session start and resume, and prints a one-line context notice that Claude Code folds into the session.
- `notify.py` runs as a `PostToolUse` hook gated on `Bash(memanto *)` and replaces the raw shell line in chat with a readable summary (`๐พ Memanto ยท stored a decision (confidence 0.95)`); it stays silent on anything it cannot confidently describe.
- Both scripts are registered under `python` and `python3` and use a temp-file claim lock, so the duplicate registration needed for cross-platform coverage never produces duplicate output.
- Codex CLI and Cursor gained `supports_hooks=True` with session-start and pre-compact sync entries; Claude Code additionally gets a `PreCompact` sync so context about to be summarized away is persisted first.
- **Instruction update banner in the web UI** (`memanto/app/ui/routes/ui_router.py`, `memanto/app/ui/static/index.html`, `sdks/typescript/openapi.json`)
- New endpoints `GET /api/ui/template-status`, `GET /api/ui/template-status/dismissed`, `POST /api/ui/template-status/dismiss`, and `POST /api/ui/template-status/update`.
- The dashboard shows a dismissible banner when instructions are outdated, with an **Update Now** button that runs the same local+global update as the CLI. Dismissal is stored per version in `cli.dismissed_template_version`, so the banner returns when a newer version ships.
## Improvements
- **Rewritten agent instructions and `memanto-memory` skill** (`memanto/cli/connect/templates.py`)
- Instructions are now organized as five numbered directives (environment-aware execution protocol, abstraction rule, durability test, recall trigger matrix, execution reference) instead of the previous rule list.
- Adds an explicit anti-pattern rule: store the generalized principle ("Exclusively use functional components for React UI"), not the chat log ("User told me to use functional components").
- Native CLI and integrated-IDE agents are instructed to run the memory evaluation in a `<thinking>` block; VS Code Copilot and extension-mode agents, which have no thinking block, are given a three-step sequence that writes the evaluation into the `explanation` parameter of a no-op terminal call.
- `SKILL.md` gains a full command reference (including `edit`, `forget`, and the temporal `recall` variants), per-type default provenance, and worked workflow examples; `get_skill_content()` now takes the agent name and substitutes it into every `--source <agent_name>` example.
- **Separate local and global instruction paths per agent** (`memanto/cli/connect/agent_registry.py`, `memanto/cli/connect/engine.py`)
- `AgentDef.instruction_file` is replaced by `instruction_local_file` and `instruction_global_file`, and global paths are declared explicitly per agent (`~/.claude/CLAUDE.md`, `~/.codex/AGENTS.md`, `~/.pi/agent/AGENTS.md`, `~/.config/opencode/AGENTS.md`, `~/.codeium/windsurf/.windsurfrules`, and others) rather than derived by stripping the local config directory.
- GitHub Copilot's global target resolves to the platform VS Code user prompts directory (`%APPDATA%\Code\User\prompts\` on Windows, `~/Library/Application Support/Code/User/prompts/` on macOS, `~/.config/Code/User/prompts/` on Linux).
- **Copilot instructions get aut
## Bug Fixes
- **Template rewrites corrupted content containing backslashes** (`memanto/cli/connect/engine.py`)
- `_write_dedicated_file()` and `_inject_into_file()` passed template content straight into `re.sub()` as the replacement string, where `\` is an escape character โ Windows paths and other literal backslashes were mangled or raised a bad-escape error. Replacement text is now backslash-escaped before substitution.
- **Reinstalling instructions wiped synced dynamic memories** (`memanto/cli/connect/engine.py`, `memanto/cli/connect/templates.py`)
- A new `<!-- MEMANTO-DYNAMIC-MEMORIES -->` block sits outside the managed static section, and `_strip_dynamic_block()` removes it from the incoming content before rewriting, so an update or re-connect replaces only the static instructions and leaves memories synced into the file intact. `_remove_instructions()` strips both blocks on disconnect.
- **Disconnect button broke on Windows project paths** (`memanto/app/ui/static/index.html`)
- The project path was HTML-escaped but not JS-escaped before being interpolated into an inline `onclick` string literal, so any path containing `\` produced a broken handler and the Disconnect/Untrack button did nothing. Backslashes and single quotes are now escaped for the JavaScript string context.
- **Hook removal only handled `SessionStart` and exact payload matches** (`memanto/cli/connect/engine.py`)
- `_remove_hooks()` compared against the registry's hardcoded payload, so hooks installed from the JSON assets โ and anything under `PostToolUse` or `PreCompact` โ were left behind on disconnect. Removal now sweeps every hook event, drops any group containing a Memanto command (`memanto`, `notify.py`, or `session_start.py`), prunes emptied events, and deletes the copied hook scripts and their directory. Note that a group is removed as a unit: an unrelated hook sharing a group with a Memanto hook is removed with it.
- **Global instruction paths resolved incorrectly for several agents** (`memanto/cli/connect/agent_registry.py`)
- `resolve_instruction_file()` previously built global paths by stripping the local config directory prefix from the local filename, which produced wrong targets for agents whose global layout differs from their local one. It now uses the declared global path directly, handling absolute, `~/`-prefixed, and bare-relative forms.
## Tests
- `tests/test_connect_engine.py` โ updated hook-removal assertions for the new sweep behavior; removed the case asserting that non-Memanto hooks sharing a group with a Memanto hook survive disconnect.
- `tests/test_connect_detection.py` โ updated for the `instruction_file` โ `instruction_local_file` rename.
## Full Changelog
Full Changelog: https://github.com/moorcheh-ai/memanto/compare/v0.2.19...v0.2.20