Developer anxiety is specific. You dread code reviews. You catastrophize about production outages at 3 AM. You seek reassurance before every deploy. Generic mental health apps don't speak to these ??they offer "think positive" when you need a structured cognitive technique.
So I built 8 free, browser-based CBT (Cognitive Behavioral Therapy) tools that run on vanilla JavaScript. No framework, no backend, no signup, no dependencies. Your thoughts never leave your browser. Each tool targets a specific cognitive pattern that shows up in developer work.
Here's the complete collection.
The 8 Tools
1. Cognitive Distortion Detector (200 lines)
Detects 10 cognitive distortions (all-or-nothing thinking, catastrophizing, mind-reading, etc.) in free-text thoughts using keyword-pattern matching. No ML, no NLP library ??just a well-structured data table and a 30-line analyze function.
??Read the build
2. Core Belief Detector (120 lines)
Uses the downward arrow technique as a two-level keyword drill: surface thought ??intermediate belief ??core belief. 13 terminal core beliefs from decades of CBT research. Genuinely different algorithm from the distortion detector ??semantic drilling vs flat classification.
??Read the build
3. Safety Behavior Detector (90 lines)
Classifies ACTIONS (not thoughts) into 9 CBT-defined categories: 6 safety behaviors (checking, reassurance-seeking, avoidance, escape, over-preparation, hypervigilance) and 3 adaptive responses. Generates a response-prevention plan. This one resonated most with developers.
??Read the build
4. Habituation Pattern Detector (90 lines)
Tracks anxiety-drop per exposure and detects split-half starting-anxiety trends. Tells you whether your ERP (Exposure and Response Prevention) is working over time. Time-series trend detection ??genuinely different from the flat classifiers above.
??Read the build
5. Catastrophe Prediction Calibration Detector (90 lines)
Computes how often your predicted catastrophe did NOT happen (empirical disconfirmation rate). 3-regime adaptive guidance based on your track record. The computational backbone of behavioral experiments.
??Read the build
6. Catastrophic Thought Reframer (15 lines)
5 keyword branches matching catastrophic thoughts ("heart attack", "faint", "losing control") ??returns targeted, medically-accurate CBT reframes. Rule-based text generation beats LLM here: zero latency, zero cost, zero privacy risk, full explainability.
??Read the build
7. Analytics Dashboard (150 lines)
Div-based bar charts with flexbox, recovery rate computation, adaptive next-step guidance. No Chart.js, no D3 ??150 lines total vs 200KB of Chart.js (5000x size difference). Domain logic over generic charting.
??Read the build
8. localStorage Database (for 23 tools)
A 40-line DB module handling QuotaExceededError, corrupted JSON, entry IDs, export, and namespacing. Why localStorage beats IndexedDB/cookies/backend for client-only mental health apps.
??Read the build
Why These Tools Work for Developers
The most-viewed article in this series isn't the most technically complex ??it's 5 Cognitive Distortions That Kill Developer Productivity. Developers don't need generic mindfulness. They need:
- A distortion detector for the "my PR will get rejected ??I'm a bad engineer ??I'll never get promoted" chain
- A safety behavior detector for the "I check the build status 12 times before lunch" pattern
- A catastrophe calibration tool for the "every on-call shift will be the one where production breaks" prediction
CBT gives structured techniques for exactly these. The tools above operationalize those techniques in code.
The Architecture
Every tool follows the same pattern:
HTML structure ??vanilla JS logic ??localStorage persistence ??zero dependencies
No React. No build step. No npm install. Open index.html in a browser and it works. This is deliberate ??mental health tools should have zero friction and zero privacy risk. Your thoughts stay in localStorage, never sent anywhere.
The full toolkit is live at: 473185670.github.io/cbt-toolkit
What's Next
I'm working on tools for:
- Imposter syndrome ??a thought record variant with evidence-for/evidence-against columns
- On-call anxiety ??a pre-shift CBT protocol with the 3 AM pager scenario built in
- Code review anxiety ??a pre-review cognitive prep checklist
If you've used any of these tools, I'd genuinely like to hear what worked and what didn't. The whole point is building things that are actually useful, not just technically interesting.
All tools are free, open source, and run entirely in your browser. No signup, no backend, no tracking. If you found this useful, the best thing you can do is share it with someone who might need it.
Related Articles in This Series
- 5 Safety Behaviors That Kill Developer Productivity (and How to Break Them) ??over-checking, reassurance-seeking, avoidance, over-preparation, hypervigilance
- 5 Cognitive Distortions That Kill Developer Productivity (And How to Cope) ??the original article that started this series (40 views, top performer)
- 5 Cognitive Distortions That Kill Code Review Confidence (And How to Break Them) ??mind reading, catastrophizing, personalization, all-or-nothing, fortune telling (code review confidence)
- 5 Cognitive Distortions That Fuel Developer Burnout (And How to Break Them) ??all-or-nothing, overgeneralization, should statements, emotional reasoning, personalization (burnout fuel)
CBT ? Developer Productivity
- 5 Core Beliefs That Make You Dread Performance Reviews ??the deeper layer: the bedrock assumptions under review anxiety, and how to rewire them with evidence.
Top comments (0)