I built a free CBT thought record tool that runs entirely in the browser - no signup, no backend, no frameworks.
Why Vanilla JS?
CBT tools handle sensitive mental health data. Every extra dependency is an attack surface. Vanilla JS means: zero dependencies, works offline, auditable, portable.
The Core: Thought Record State Machine
A CBT thought record is a 7-step process: Situation -> Emotions -> Thoughts -> Distortions -> Alternatives -> Re-rate -> Action.
Here's the state machine that drives it:
const ThoughtRecord = { state : { emotions : [ ] , thoughts : [ ] , distortions : new Set ( ) } , save ( ) { localStorage . setItem ( 'cbt-thought-record' , JSON . stringify ( this .…