Isogram — AI Text Score (VS Code extension)
Per-line AI-edit scores in the editor, from the Isogram detector. Lines the detector attributes to
AI are tinted by class — orange for AI-assisted (AI-edited), red for AI-generated — with
intensity by score and the exact numbers on hover. The status bar shows the document verdict;
click it to rescore. The adjacent view picker switches between Lines, Spans and Words.
More at isogram.hails.info/vscode.
Install
Download the .vsix from isogram.hails.info/vscode, then:
code --install-extension isogram-vscode-0.13.0.vsix
Then run Isogram: Set API Token from the command palette and paste your iso_… API key. The
key is stored in the OS keychain via VS Code's SecretStorage, never in settings. Scoring needs a
key; keys are issued on request.
What it sends
The extension sends the contents of each scored document, and its file name (not its
path — the name steers prose vs. code scoring), to the configured endpoint. It refuses untrusted
workspaces, and the endpoint setting is machine-scoped so a workspace cannot redirect your
documents or key elsewhere.
How scoring is scheduled
Every eligible document (file or untitled, non-empty, ≤ isogram.maxDocumentKb) is scored after
isogram.debounceMs of edit-idle, when it becomes the active tab, and immediately on a manual
save. Tab switches share one idle wait, so flipping through several unscored files sends one
request, for the one you settle on. The content is SHA-256-hashed first: an unchanged document
never re-fires, and verdicts seen before are served from an in-memory cache. Each document has
at most one request in flight: content edited while one is out waits for it, then goes as one
follow-up request. Documents nobody can see (not shown in an editor, or the window unfocused)
are not scored until they are shown.
While you edit
Editing keeps the tints on passages you have not touched. The endpoint scores a document in
blocks, cut at section and paragraph breaks, and re-scores only the blocks whose text changed.
The extension follows suit at paragraph level: the paragraphs an edit touches lose their tints
and get a dotted grey rule in the left margin; every other tint moves with the text. The status
bar spins while a request is out. When the rescore lands, the rule goes and the edited
paragraphs take their new tints; if it fails, the rule goes and they stay untinted until the
next score.
A response for text you edited while it was out still paints straight away: its unchanged
paragraphs show their scores, and the paragraphs edited since stay marked for the follow-up
request.
Prose is scored at token resolution: each line takes the class of the authorship spans covering
it. Code falls back to overlapping 512-token windows decoded jointly per line. Lines under the
tint threshold (isogram.tintThreshold) get no tint.
Highlight views
Use the bottom-right Lines / Spans / Words picker, or Isogram: Change Highlight View
in the command palette. The choice is saved in isogram.view; switching repaints the cached
result immediately without another scoring request. Lines remains the default. A saved Tokens
choice automatically migrates to Words. If VS Code has not registered the setting after an
update, the picker remembers the choice in extension storage.
- Lines summarises authorship across each whole line.
- Spans highlights the returned authorship ranges after CRF smoothing, sentence voting and
short-run merging.
- Words shows the raw token-head signal before the segment prior, calibration and CRF
smoothing, grouped into whole words. Hover a word for its human, AI-assisted and AI-generated
probabilities. Red/orange intensity follows half the assisted probability plus the generated
probability. Overlapping tokens are first averaged per character, then subword pieces are
averaged by character overlap within each word. Excluded text never receives a tint.
Words uses the ordinary scoring pass: no deletion experiments or additional model requests.
This is contextual local model signal, not causal word influence or calibrated authorship
certainty. It helps inspect variation hidden inside a smoothed span; it does not establish
which words caused the document verdict. Document verdicts are unchanged across views.
If an endpoint or track lacks the selected detail, the picker says unavailable. Words never
substitutes old smoothed token probabilities for missing raw data. After the updated endpoint
is live, reload the window to replace results cached before it supplied raw probabilities.
Turning a file off
Run Isogram: Disable for This File from the command palette, the editor's right-click menu
or the editor title bar's … menu. The file's tints go at once, any request for it is
cancelled, and nothing scores it again: not typing, saving, switching to it, an on-disk change,
Score Selection or Score Files Matching Glob… (which lists it as skipped). The status bar
reads isogram off; click it, or run Isogram: Enable for This File, to turn the file back
on and score it again.
The choice lives in the isogram.disabledFiles setting, so it survives a reload and you can
see and edit it. The command writes the file's path relative to its workspace folder into the
workspace's .vscode/settings.json (the folder's own, in a multi-root workspace); a file outside
any folder goes into user settings by absolute path. Entries can also be globs, and lists from
user, workspace and folder settings all apply, so a repo can turn off whole directories:
{
"isogram.disabledFiles": ["drafts/**", "**/*.txt"]
}
** spans directories, * and ? stay within one, {md,mdx} is an alternation, and a
pattern matches the whole path, so write **/*.md rather than *.md for every depth.
Enable for This File removes the file's own entry; if a glob still matches, it says which
one to edit.
Excluded text
Matches of isogram.excludePatterns are cut out of the text before it is sent: they never reach
the endpoint, never move the verdict, and are never tinted. A line that is entirely excluded stays
untinted; a line mixing excluded and kept text is tinted by its kept text alone. The default
excludes HTML comments (<!-- … -->) and MDX comment-only expressions ({/* … */}).
Whitespace between the braces and the comment is allowed. The exclusions apply to every document.
Set the list to [] to score everything.
Matches are removed rather than blanked: a run of spaces where a comment was would still be an
input the model reads, and would shift every window after it. The endpoint's offsets are mapped
back onto the document, so tints land on the right characters.
Patterns are JavaScript regex sources compiled with flags gmu (^/$ match per line; use
[\s\S] to cross lines). The setting is resource-scoped, so a workspace can set its own in
.vscode/settings.json, for example to also drop fenced code blocks:
{
"isogram.excludePatterns": [
"<!--[\\s\\S]*?-->",
"\\{\\s*/\\*(?:(?!\\*/)[\\s\\S])*\\*/\\s*\\}",
"^```[\\s\\S]*?^```"
]
}
An invalid pattern raises one warning, is logged, and is ignored; the others still apply.
Changing the list rescores visible documents (from cache when the sent text was scored before).
The endpoint scales to zero: an idle editor costs nothing, and the first score after idle waits
for a GPU cold start (up to a minute or two; warm scores return in seconds).
Commands
| command |
what it does |
| Isogram: Set API Token |
store your iso_… key (empty input clears it) |
| Isogram: Toggle Highlighting |
switch the tints on and off, for every file |
| Isogram: Disable for This File / Enable for This File |
turn one file off or back on (see Turning a file off); the palette offers whichever applies |
| Isogram: Score Current Document |
force a rescore of the active editor |
| Isogram: Score Selection |
score only the selected text (also on the editor right-click menu); the verdict pops up every time, instantly and marked cached when that passage was scored before. Multiple selections are joined with a blank line; isogram.excludePatterns still applies |
| Isogram: Score Files Matching Glob… |
batch-score the workspace (default **/*.{md,mdx,txt}); results open as a markdown report sorted worst-first |
| Isogram: Show Log |
every request, skip and failure |
Settings
| setting |
default |
meaning |
isogram.enabled |
true |
score + highlight open documents |
isogram.endpoint |
https://djrhails--isogram-score.modal.run |
scoring endpoint (POST) |
isogram.debounceMs |
1500 |
edit-idle time before a rescore |
isogram.externalChangeDebounceMs |
60000 |
idle time after an on-disk change (a git checkout, another tool's write) before a visible document is rescored |
isogram.maxDocumentKb |
256 |
larger documents are skipped |
isogram.excludePatterns |
["<!--[\\s\\S]*?-->", "\\{\\s*/\\*(?:(?!\\*/)[\\s\\S])*\\*/\\s*\\}"] |
regexes whose matches are removed before scoring and never tinted (see Excluded text) |
isogram.disabledFiles |
[] |
paths and globs of files never scored or tinted (see Turning a file off) |
isogram.tintThreshold |
null |
minimum per-line score to tint (0-1); null uses the detector's own "human" threshold (~0.05). Raise to ~0.6 to show only AI-generated lines |
Verdicts are probabilistic: treat them as evidence, not proof.
Development
pnpm install
pnpm run typecheck && pnpm run lint && pnpm test
pnpm run package # → isogram-vscode-<version>.vsix
pnpm run build bundles src/extension.ts → dist/extension.js with esbuild (CJS — the VS Code
extension host does not load ESM entry points, which is why this package has no "type": "module"). Pure logic (hashing, per-line decode, buckets, cache) lives in src/scoring.ts,
batch-report building and the concurrency pool in src/batch.ts, carrying tints across edits
(paragraph diffing, offset mapping) in src/retain.ts, isogram.disabledFiles glob matching in
src/disable.ts, all tested with vitest;
src/extension.ts is the thin VS Code glue.