{"version":"2.1.281","anchor":"plugin-hooks-runtime-gains-a-state-library-atomderivememb","canonical_anchor":"plugin-hooks-runtime-gains-a-state-library-atomderivememb","heading":"Plugin hooks runtime gains a state library (atom\/derive\/memberOf\/read\/update)","tier":null,"area":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.281\/e\/plugin-hooks-runtime-gains-a-state-library-atomderivememb","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.281","markdown":"### Plugin hooks runtime gains a state library (atom\/derive\/memberOf\/read\/update)\n\nThe plugin function-hooks runtime gains a state library with atom, derive, memberOf, read and update\n\n**Unclear.** The finding does not say whether plugin authors can use this library in this build.\n\n**What**\n\nThe runtime for plugin function hooks has a new state library. Plugin function hooks are code a plugin runs at certain points in Claude Code. Modules import the library from \"claude-code\", and it provides:\n\n- `atom`\n\n- `derive`\n\n- `memberOf`\n\n- `read`\n\n- `update`\n\nUpdates are compare-and-set: a value is written only if nothing else changed it since it was read. After a limited number of tries, an update gives up with \"nothing was written\".\n\nA scan checks each module's code without running it and lists which state keys the module reads and writes. It rejects code it cannot follow this way, with errors saying the function \"takes a source the scan can read\".\n\n**Why**\n\nPlugin hook code gets a shared way to keep state that knows up front which values each module touches. Code that uses the library must be written so the scan can read it, or it is refused."}