Please do not open a public issue for a security problem. Open a private security advisory on the repository instead: on GitHub, go to the repository's Security tab, choose Report a vulnerability, and describe the issue, how to reproduce it, and the version or commit you tested. You will get a reply through the advisory thread. If private reporting is not available to you, open a plain issue that says only "security report, please contact me" without details, and the maintainer will open the advisory.
Only the latest release is supported. Fixes land on the main branch and ship in the next release; older tags receive no patches.
Terminal FM is a local, single-user command-line tool run from Claude Code (as the terminal-fm plugin, or a manual install) or from a shell. What follows describes the design as it stands.
- No network listener. The radio opens no ports. A detached background daemon plays audio from a local folder and coordinates with the CLI only through files in the data directory (
~/.claude/terminal-fmby default, or the folder named byTERMINAL_FM_HOME). - Outbound connections.
radio gen,radio egenand the credit-balance check callhttps://api.stability.ai(the three URLs understability_apiinconfig.json) over TLS: Python'surllibwith certificate verification and User-Agentterminal-fm/1.0, andstability_api.ca_bundlemay point verification at a PEM file such as certifi's. The DJ, the local model (llama-cli, run as a local process) and playback make no network calls. The one other caller isradio setup <extra> install, only when you run it (in Claude Code, only after you say yes): it downloads fromgithub.comandhuggingface.co(both redirect to their CDNs), pip fetches the voice's packages from PyPI, and on a machine with no suitable Python it runswingetorbrewto install Python 3.13. Each file it downloads itself is pinned inradio.pyto a size and SHA-256 its publisher lists, and a file that doesn't match is deleted. The Python packages are not pinned: pip installs what PyPI serves forkokoro-onnx>=0.6andsoundfile, into the voice's own environment. - The Hugging Face login.
radio setup tokenizer installreads your token fromHF_TOKEN,HUGGING_FACE_HUB_TOKENor the filehuggingface_hubkeeps (HF_TOKEN_PATH, else<HF_HOME>/token), sends it as aBearerheader tohuggingface.coonly (a redirect keeps it only while it stays on the same scheme, host and port, so the CDN never gets it), and never prints or stores it. Claude never asks for it. - The API key. Read from
<data dir>/.keyfirst, then from theSTABILITY_API_KEYenvironment variable. The repository ships no key and.keyis git-ignored.radio keyreads the key at a hidden prompt (never as an argument, so it stays out of shell history and process listings), writes it atomically through a temp file created with0600permissions on POSIX, so no other user can read it at any point. If that rename is refused, it writes.keydirectly, still with0600permissions applied before the key goes in. On Windows the file gets the data directory's default permissions.radio key showprints only whether a key is set and where it came from, never any of its characters. The key is sent only as aBearerheader to thestability_apiURLs. - The
curlfallback. If Python's own request never connects (a DNS, TCP or TLS failure, not an HTTP error),radio.pyretries through the systemcurlwhen one is present. TheAuthorizationheader goes to curl through a config read from stdin (curl -K -), so the key never appears on curl's command line or in a process listing, and form fields are passed with--form-string, so a prompt starting with@or<is sent as text and never makes curl read a local file. On Windows 10 the fallback cannot reach the API at all (Schannelcurlhas no TLS 1.3), so it is effectively inert there. - Local files the radio writes.
state.json(pids and playback position),nowplaying.txt,config.json,playlist.json,resume.json,last_*.json, thequeue/folder of pending DJ lines,breaking.txt,prompt_history.jsonl(every prompt and idea you generate from, append-only),.kokoro_python(an interpreter path),dj_engine.log, andstatusline.py(copied from the plugin by the SessionStart hook).setup <extra> installadds the voice's Python environment (kokoro/venv/), the models, llama.cpp's files inllm/bin/, and.partfiles while a download is in progress. Anything you would not want in a shared folder is best kept out ofTERMINAL_FM_HOME. dj_engine.logkeeps text. Every spoken line appends one record naming the TTS engine used, why, the interpreter, and the first 60 characters of the spoken text. Spoken lines come fromradio say,play --sayand the Claude Code Stop hook, so the log can contain fragments of your Claude session. Delete or rotate it as you see fit; the radio only appends.- The Stop hook reads Claude's last message. When Claude Code runs
radio.py hook Stop(through the plugin'shooks/radio-hook.sh, or asettings.jsonentry on the manual install), the hook receives Claude Code's JSON on stdin. It takescwdfor the project name and Claude's last message from thelast_assistant_messagefield, which Claude Code sends with Stop (seen on version 2.1.296); when that field is present the session transcript is never opened. Only when it is absent, as on older Claude Code versions, does the hook read the transcript JSONL at thetranscript_pathit is given, trusting that input, and it reads no other transcript. The extracted text goes to the DJ queue (a file inqueue/), the TTS engine, anddj_engine.logas above. Nothing is read unless music is playing orradio announceis on. Turn narration off by uninstalling the plugin (or not adding the manual hooks), or keep the hooks and leaveradio announceoff and the radio stopped. - Subprocesses. The radio launches the audio player, the TTS engine (
kokoro_tts.pythrough a probed Python interpreter, or the system fallback),llama-clifor the local model,ffmpegforradio format wav+mp3, and optionallycurl.setup <extra> installalso runspython -m venv, pip,wingetorbrew, and the downloadedllama-cli --versionbefore moving it into place; it unpacks llama.cpp's archive itself and refuses one holding anything but plain files and links to files beside them, or any path that climbs out of its folder. The plugin's hook launcher,hooks/radio-hook.sh, runs a workingpython3,pythonorpyfound onPATH. All are found onPATHor in the data directory; an attacker who can write to those locations can already run code as you. Prompts and DJ lines are passed as arguments or on stdin, never through a shell; the TTS engines get the spoken text on stdin or from a file, so a line starting with-can't become an option. - Install from GitHub or a clean copy, never from a data directory. The
.gitignorekeeps the key, settings, library and models out of the repository, but it does not protect a directory-source install:claude plugin marketplace add <local path>plusclaude plugin installcopies the whole folder,.keyincluded, into~/.claude/plugins/cache/, andclaude plugin uninstallleaves that copy behind. - Third-party models and binaries are not bundled; you download them, by hand or with
setup <extra> install(seeTHIRD_PARTY_NOTICES.md). By hand, verify what you download against its source page.
Weaknesses in the audio players, TTS engines, llama.cpp, FFmpeg, curl or the Stability API belong to those projects. Misuse of a leaked Stability key is between you and Stability: rotate the key at https://platform.stability.ai if you suspect exposure.