VarAlign – catch the duplicate variables AI agents scatter across sessions

andreab671 pts0 comments

GitHub - greenyogainc/varalign: VarAlign — catch the duplicate, drifted, and misaligned variables AI coding agents scatter across sessions. VS Code extension (source-available, BSL 1.1). · GitHub

/" data-turbo-transient="true" />

Skip to content

Search or jump to...

Search code, repositories, users, issues, pull requests...

-->

Search

Clear

Search syntax tips

Provide feedback

--><br>We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Cancel

Submit feedback

Saved searches

Use saved searches to filter your results more quickly

-->

Name

Query

To see all available qualifiers, see our documentation.

Cancel

Create saved search

Sign in

/;ref_cta:Sign up;ref_loc:header logged out"}"<br>Sign up

Appearance settings

Resetting focus

You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.

Dismiss alert

{{ message }}

Uh oh!

There was an error while loading. Please reload this page.

greenyogainc

varalign

Public

Notifications<br>You must be signed in to change notification settings

Fork

Star

main

BranchesTags

Go to file

CodeOpen more actions menu

Folders and files<br>NameNameLast commit message<br>Last commit date<br>Latest commit

History<br>5 Commits<br>5 Commits

media

media

scripts

scripts

src

src

.gitignore

.gitignore

.vscodeignore

.vscodeignore

LICENSE

LICENSE

README.md

README.md

esbuild.js

esbuild.js

package-lock.json

package-lock.json

package.json

package.json

tsconfig.json

tsconfig.json

View all files

Repository files navigation

Public source-available mirror of the VarAlign VS Code extension (Business Source License 1.1). Install from the VS Code Marketplace / Open VSX.

VarAlign

Also on the VS Code Marketplace.

Catch the duplicate, drifted, and misaligned variables AI coding agents scatter across sessions — right in your editor. 100% local: your code never leaves your machine.

AI assistants forget. Across sessions they re-introduce a variable that already<br>exists under another name, let a value drift from the one they wrote last week,<br>or strand a definition when a file moves. VarAlign tracks every assignment your<br>assistant writes, scores the duplicates and drift, and hands you a ready-to-paste<br>fix prompt.

Native tree views — Duplicates · Variables · Sessions — over the VarAlign<br>engine. Detection, scoring, and persistence run in a zero-dependency Python<br>engine that ships inside the extension; the views are a thin, read-through<br>client. Everything runs on your machine — no cloud, no telemetry, no code<br>upload — so it works in locked-down and air-gapped environments.

Features

Duplicates — High / Medium / Low groups. Expand a pair to see both sides;<br>right-click to Dismiss (not a duplicate) , Confirm , or Dismiss with<br>note . Verdicts persist, and dismissing one member auto-quiets the whole<br>family so you review each pattern once.

Variables — every tracked assignment, grouped by file and coloured by its<br>worst duplicate level; click to jump to the definition.

Sessions — what each AI session introduced or changed.

Status bar — VarAlign: N high; click to focus the Duplicates view.

Generate Fix Prompt — a repo-scoped remediation prompt in a new tab,<br>ready to paste back to your assistant.

Fix with AI — hands a targeted consolidation prompt to Claude Code or<br>Kilo Code, whichever you have open.

Auto-refreshes when the store changes (a hook or the CLI wrote to it).

Getting started

Install VarAlign.

Make sure Python 3.11+ is on your PATH — the extension bundles the engine,<br>so there's nothing else to install or point at.

Open a repo and click the VarAlign chip in the activity bar. VarAlign<br>scans the workspace and starts tracking.

That's it — you're running locally, and every byte stays on your machine.

VarAlign keeps its tracking data in a .varmem/ folder at your repo root. The<br>extension adds .varmem/ to your .gitignore automatically (git repos only).<br>If it can't, add this line yourself:

.varmem/

VarAlign Pro

Pro unlocks Merge Variables : right-click a duplicate pair and VarAlign picks<br>the canonical name, rewrites the references, and removes the duplicate<br>definition — in your editor, on your machine.

Licenses are verified offline (an Ed25519-signed key, checked locally with a<br>14-day grace period past expiry — nothing is ever sent anywhere, so Pro works<br>air-gapped too). Activate with VarAlign: Enter License ; check anytime with<br>VarAlign: License Status .

Settings

Setting<br>Default<br>Meaning

varalign.pythonPath<br>python<br>interpreter used to run the local engine

varalign.corePath<br>(bundled)<br>path to varmem.py; empty = the bundled engine

varalign.minLevel<br>medium<br>lowest duplicate level shown

varalign.showDismissed<br>false<br>include dismissed / auto-quieted pairs

varalign.aiTool<br>auto<br>assistant for Fix with AI...

varalign code duplicate variables sessions json

Related Articles