drift-fuse

Reviewed at commit 5c78ba7

Sends data to TypeSafe Jev model (api.typesafe.ai)

Scores each unattended turn against the task the person asked for with TypeSafe's Jev model, and after consecutive off-task turns redirects or pauses the next…

What we checked

After a turn started by a loop, routine or notification (or every turn, if you choose), it sends your last typed prompt, edited file paths, the start of Bash commands and the start of Claude's answer to TypeSafe (api.typesafe.ai), which judges whether the turn stayed on task. Only in projects with CC_TYPESAFE_PROJECT=1 and a TypeSafe key. After repeated off-task turns it warns on, or drops, the next prompt no person typed.

Review details

Static review of the source at the pinned commit; not run. Delta review of the changes since 8dda097; the rest carries over from the review at that commit. Registers prompt.submit, turn.start, tool.call and turn.complete. Keeps the last person-typed prompt (composer or bridge origin) as the task contract, up to 2000 characters, and per turn up to 40 lines of 'Edit/Write/NotebookEdit <path>' and 'Bash: <first 120 chars>' for the main agent only. On turn.complete, only when the turn was not aborted, made at least one tool call and (default scope unattended) was started by a non-person prompt, it POSTs {task, actions, answer truncated to 1200 characters} to https://api.typesafe.ai/v1/systemone through $.http.fetch with the key as a Bearer token and a 2.5 second timeout. typesafeKey returns nothing unless CC_TYPESAFE_PROJECT is 1 in the process environment or in the env block of the merged Claude settings (read through $.settings.read, only that one value inspected), so without the opt-in nothing is scored or sent. The key comes from the TYPESAFE_API_KEY environment variable or from the settings env block; only that value is extracted. A failure or missing key means nothing is scored (fail-open). When tripAfter consecutive turns fall below driftBelow, the next non-person prompt either gets an extra context line (redirect) or is dropped with a message (pause); prompts a person types always pass and reset the state. Changes in this version: an internal refactor of the fuse state (armed or tripped, keeping the trip's own actions) and a queue that matches each turn.start to the prompt that started it, only counting prompts the rest of the chain accepts and not those delivered into a running turn. No new data, hosts, files or permissions. Tool calls are only observed, never changed. Logs through $.ui.log; state is in memory only. The data flow is disclosed in the source header and the plugin description.

What it uses
  • Reads your prompts: yes
  • Sees tool calls: yes
  • Blocks or changes tool calls: no
  • Reads or writes files: yes
  • Runs programs on your machine: no
  • Calls the model (uses tokens): no
  • Sends data over the network: yes
  • Stores data: no
  • Shows something on screen: no
Hooked events

Scores each unattended turn against the task the person asked for with TypeSafe's Jev model, and after consecutive off-task turns redirects or pauses the next machine-submitted prompt.

Made this mod? Add a badge to your README

modsforClaude badge for drift-fuse

Paste this into your README. The badge says reviewed once the current version has been reviewed, and links readers to this page.

[![Listed on modsforClaude](https://modsforclaude.com/badge/drift-fuse.svg)](https://modsforclaude.com/mods/drift-fuse/)

← All mods