Building Small Clinical Tools as Single-File HTML
Clinicians often need tools that fit a specific client, session, workflow, practice task, business need, or teaching moment. Off-the-shelf tools can be useful, but they rarely match the exact wording, sequence, examples, constraints, calculations, or visual layout you want. Single-file HTML is one of the easiest ways to build a small interactive tool around that specific need.
The whole tool lives in one file. Save it as .html, open it in a browser such as Chrome, Edge, Safari, or Firefox, and it runs.
This format works well when the tool has one focused job. A therapist-facing exposure ladder, personalized coping menu, parent coaching prompt, psychoeducation visual, supervision log, fee estimator, referral tracker, session activity, values sort, or custom worksheet can often live comfortably in a single file. The tool should have a defined job and avoid extra features that make it harder to use.
One file can hold the structure, the visual design, and the behavior together. HTML controls what appears on the page. CSS controls how it looks. JavaScript controls what it does when someone clicks, types, adds an item, changes a setting, sorts a list, calculates a score, stores a setting, or prints the result. A single file can still do quite a lot.
Learning this format means learning its boundaries. A single HTML file can run locally, print cleanly, respond to clicks, calculate scores, hide and show sections, and remember simple entries in the browser if you ask for that. It is not the right format for accounts, shared records, synced databases, access permissions, or anything that needs careful privacy control. Knowing those boundaries helps you decide which ideas fit the format before you start building.
This also lines up well with how many AI chat tools now work. You can ask for the tool, see it in a preview pane, click around, and revise it right there. Some tools will let you download the file. Some will let you publish it to a URL from the same workspace. The early loop gets faster, and the basic format stays the same. It is still one page living in one file.
A therapist-facing exposure ladder is a good example. The tool might let the user enter feared situations, rate distress from 0 to 100, reorder items, add notes, and print the finished ladder. A business-facing version might calculate fees, track consult calls, organize referral options, or format a simple report. These are real tools that can still fit neatly in one file.
Here is a quick example of the format in action. Elevator Quest is a one-file exposure practice tool for a fictional teen client working on elevator anxiety. It includes editable ladder steps, video links inside specific steps, points based on difficulty, a progress view, printing, and browser-saved progress. It is still just one .html file.
Download the example HTML file
You can also open the example in the browser. The example is not meant to be the perfect exposure tool. It shows how quickly a clinician can make something specific to one client, one fear, one practice plan, or one workflow.
After you download the file, you can attach it to a chatbot and ask for changes. That is one of the easiest ways to learn the format. You are not starting from a blank page. You are giving the AI a working tool and asking it to revise the exact file.
I attached a single-file HTML tool. Please revise it for a different exposure target. Keep it as one self-contained
.htmlfile that opens directly in a browser. Replace the elevator steps with steps for dog anxiety, keep the points system, and make the wording appropriate for a 12-year-old.
The Basic Process
- Define the job clearly.
Write one sentence that says what the tool does. For example
A therapist-facing exposure ladder builder that lets the user add feared situations, rate distress, reorder items, and print the ladder.
That sentence keeps the build focused.
- Open a chatbot and ask for one self-contained HTML file.
Use plain language. Ask for a single self-contained HTML file that runs by opening it directly in a browser. Say what the tool should do. Say if it should print cleanly. Say if it should save anything locally. One real prompt is enough.
For example
Create a single self-contained HTML file for a client-specific exposure practice tool. It should run by opening the file directly in a browser. The exposure target is riding elevators. Include a short sequence of practice steps, links to therapist-approved elevator videos, a simple points system for completed practices, and a progress view the client can see over time. Keep the design calm, clear, and easy to use.
- Use the preview if the chat tool gives you one.
Some AI tools show the HTML file in a preview pane. Use it. Click the buttons. Add items. Try a long entry. Change ratings. Print it if printing is part of the tool. Test the behavior, not just the appearance.
- Download the file if the chat tool offers one.
Some chat tools give you an actual .html file to download. Download it and save it somewhere you can find it again, such as your desktop, downloads folder, or a project folder.
- Copy the code into a text file if there is no download.
Sometimes the chatbot gives you the code as text. In that case, copy all of the code into a plain text editor on your computer. Notepad works on Windows. TextEdit can work on a Mac if it is set to plain text mode. Save the file with .html at the end instead of .txt.
The file name can be simple, such as exposure-ladder.html. The .html ending tells the computer to open it as a webpage instead of a plain text note.
- Open the file in your browser.
A browser means Chrome, Edge, Safari, Firefox, or another app you use to open webpages. Double-clicking the file will usually open it in your default browser. You can also right-click the file and choose a browser directly.
Opening an .html file this way does not put it on the internet by itself. The browser is just running the file locally on your computer.
- Test it like a real user.
Useful problems show up during testing. A first draft may technically work and still be wrong in ordinary ways. The print layout may be ugly. Long text may break the design. The reorder controls may be awkward. A button may work in a clumsy way that makes the tool irritating to use.
With the exposure ladder example, real testing means entering several feared situations, including one with a long description, changing distress ratings, reordering items, deleting one, printing the ladder, closing the file, reopening it, and doing it again. That is how you find the problems that affect use.
- Edit the file and refresh the browser.
If you are editing on your computer, right-click the file and open it with a text editor instead of a browser. Make the change, save the file, then refresh the browser tab. The updated version appears immediately. Work in that edit-save-refresh loop.
- Revise in rounds.
Most first drafts are close, not finished. Keep what works and ask for targeted changes. A few focused revisions usually get you further than starting over.
What Single-File HTML Can Do
Single-file HTML is not limited to static worksheets. Because CSS and JavaScript can live inside the same file, a small tool can include useful interaction.
It can add and remove items. It can sort or reorder lists. It can show and hide sections. It can calculate scores. It can update a visual display while someone types. It can print a cleaner version than what appears on screen. It can store simple information in the browser on the same device if you deliberately ask for that. It can also avoid saving anything when privacy is more important than persistence.
It can include simple visuals too. The easiest version uses CSS, icons, small inline SVG, or page layout rather than separate image files. A single HTML file can also link out to videos, handouts, or other websites. That is usually cleaner than trying to pack a whole media library into one file.
Saving the .html file is different from saving information inside the tool. You always need to save the file itself so you can open it later. A separate question is whether the tool should remember what someone typed after the browser closes. For most first versions, it is easiest to avoid saved entries. If you do want simple saving on the same device, ask for local browser storage and avoid client-identifying information unless you know where it is stored and who can access the computer.
The format works well for focused clinical tasks where the wording, steps, examples, or sequence need to match a specific purpose.
When One File Is Not Enough
Some tools stay clean in one file for a long time. Others get heavy quickly. You can usually tell after a round or two of use.
Client-facing tools can outgrow one file when they need to support multiple clients at once, keep a history across weeks, send reminders, collect responses between sessions, or separate what the client sees from what the clinician sees. Personal workflow tools can outgrow one file when they need to pull information from calendars, spreadsheets, EHR exports, or multiple documents. Business or practice tools can outgrow one file when they need reliable records, multiple users, permissions, invoicing history, referral pipelines, or shared updates across a team.
A one-file exposure ladder, supervision-hours calculator, fee estimator, or referral list can be reasonable. A full exposure homework system with client histories, a months-long reporting workflow, or a practice management system needs a different setup. The first version did not fail. The idea outgrew the format. A lot of clinician-built tools never need to get there. They need to do one job well, open easily, and stay easy to revise.
When You Get Stuck
When something breaks or stops making sense, copy the error message and paste it back into the chatbot. This is normal. Early versions often break, and debugging is part of the process. The good news is that this happens less often as AI models get stronger.
Tell the chatbot what you clicked, what happened, and what you expected to happen. If the tool has a thinking mode, reasoning mode, or a stronger model option, use it when the problem is confusing. Ask it to explain the problem in plain language before it changes the file.
Starting Small
Single-file HTML is a practical way to start because it keeps the build close to the purpose of the tool. You ask for one file, test the real behavior, revise it in place, and decide quickly whether it is useful.
This format is exciting because a clinician can move from an idea to a working tool in the same afternoon, then adjust the language, sequence, layout, and behavior around the actual people and workflows they know. The result does not have to become a product or a platform to be worthwhile. The win is a small tool that fits one job better than anything you could find off the shelf.
Subscribe for future posts
If you want new writing at the intersection of AI and psychology, ethics, and implementation of AI in clinical practice, subscribe on Substack.
The views expressed here are my own and do not necessarily reflect the views of any current or future employer, training site, academic institution, or affiliated organization.