{"version":"2.1.333","anchor":"plugin-hook-api-gains-store-fs-processrun-uikey-events","canonical_anchor":"plugin-hook-api-gains-store-fs-processrun-uikey-events","heading":"Mods can now react to more events, including session loading, key presses and file writes","tier":"internal","area":"Mods","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.333\/e\/plugin-hook-api-gains-store-fs-processrun-uikey-events","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.333","markdown":"### Mods can now react to more events, including session loading, key presses and file writes\n\nMods get new events for stored data, files, running programs, key presses, the window title and sessions, including when a session is loaded\n\n**Unclear.** It is not clear whether mods installed from outside Claude Code can use these new events.\n\n**What**\n\nMods, the add-ons that run inside Claude Code, can now hook into a wider set of events. The new ones include:\n\n- `store.get`, `store.set` and `store.delete`, for the mod's saved data\n\n- `fs.write` and `fs.remove`, for writing and removing files\n\n- `process.run` and `tool.run`, for running programs and tools\n\n- `session.load`, `session.append`, `session.measure`, `session.messages` and `session.state`, for sessions\n\n- `ui.key`, `ui.title` and `ui.verbs`, for key presses and parts of the interface\n\n- `turn.recache`\n\nWhen a session is loaded, a mod hooked into `session.load` can see its messages and the tool uses in them, the same way it can on `session.compact`, and can return a result that tells Claude Code to skip the load. A tip handler also now picks which tip to show based on how many sessions have passed since that tip was last shown. Claude Code also now reads a `CLAUDE_CODE_SYNC_SESSION_REFS` setting.\n\n**Why**\n\nMod authors have many more points at which to watch or change what Claude Code does.\n\n- Area: Mods\n- Tier: Under the hood\n- Useful: 4\/5\n- Signal: 3\/5\n- Scope: individual\n- Heads-up: no"}