{"version":"2.1.228","anchor":"per-session-state-replaces-module-level-globals","canonical_anchor":"per-session-state-replaces-module-level-globals","heading":"Per-session state replaces module-level globals","tier":"internal","area":"Session State","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.228\/e\/per-session-state-replaces-module-level-globals","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.228","markdown":"### Per-session state replaces module-level globals\n\nProcess-wide state moved onto the session object, the biggest structural change in this build.\n\n**What**\n\nState that used to live in module-level singletons now hangs off the session object, so two sessions in one process no longer share it. No behaviour change on its own, but it is the largest structural change in this release.\n\n**Details**\n\n- The session object previously carried only workflow usage consent; it now owns a dozen stores, including observers, shell and command history, pending hints, prompt suggestions, plugin sync, precompute, tool progress throttling and the stash of pending write permissions.\n- Forked sessions share these stores with their root session rather than getting fresh copies.\n- Hundreds of call sites now take an explicit session parameter; for example the pending-write-permission stash is reached through the session rather than a global.\n\n**Evidence**\n\n`writePermissionStash`\n\n- Area: Session State\n- Tier: Under the hood\n- Useful: 2\/5\n- Signal: 3\/5"}