{"version":"2.1.271","anchor":"new-react-context-hooks-for-hostprojectsession-in-plugin-u","canonical_anchor":"new-react-context-hooks-for-hostprojectsession-in-plugin-u","heading":"New React context hooks for host\/project\/session in plugin UI","tier":"use","area":"Plugin UI","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.271\/e\/new-react-context-hooks-for-hostprojectsession-in-plugin-u","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.271","markdown":"### New React context hooks for host\/project\/session in plugin UI\n\nPlugin UI code gains React context hooks for accessing host, project, and session data\n\n**What**\n\nClaude Code's plugin UI framework now includes new provider components, one acting like a `SessionProvider` and one like a `HostProjectProvider`, along with `useHost` and `useProject` hooks for reading their data. Using either hook outside of its matching provider now throws a clear error message telling the developer it must be called inside a `<SessionProvider \/>` or `<HostProjectProvider \/>`.\n\n**Why**\n\nThis gives plugin UI developers a standard, safe way to access host, project, and session information from their components, with a clear error instead of confusing behavior if they're used in the wrong place.\n\n- Area: Plugin UI\n- Names: `useHost`, `useProject`\n- Tier: Use it now\n- Useful: 3\/5\n- Signal: 2\/5"}