Repository navigation
Releases
Releases · 4anti/antis-optimizer
v1.6.0
Upgrade note
- Run
--sync-ignores --writeonce after upgrading. It rewrites.contextignorein the new form and adds the private-key patterns. - Folder patterns in
.contextignorenow really block Token Optimizer reads; before, they matched nothing. To keep a folder readable and searchable, add!folder/to.ignore.
Fixed
.contextignoreis now written in the form Token Optimizer reads (fnmatch on the full path or the file name, which denies the whole Read):- Folder patterns become
*/dir/*. A baredir/never matched anything there. - Image and PDF patterns (
*.png,*.jpg,*.webp,*.pdf, ...) are no longer written, so agents can open reference images again. !lines, which Token Optimizer ignores, are not copied.- Lines an older sync wrote in the old form are replaced on the next
--sync-ignores --write. Lines you added yourself are kept.
- Folder patterns become
- Keep-list: a
!pathline in.ignore(e.g.!_work/,!decompiled/) now means "keep this on purpose":- It is never suggested as junk, and neither is anything under it.
- It is left out of
.contextignore. --verifystops reporting it.
- Landmarks (
file:Lstart-Lend):- Paths are resolved relative to the doc that holds them (nested
AGENTS.md/INDEX.md), then to the root, and never outside the root. - Paths with spaces work inside a backtick code span.
- A command written in a code span still checks its path argument.
--sync-landmarks --writenow printsFAILand exits 1 when some references need a manual fix (missing file, unknown symbol, out of range) instead ofPASS healed 0.
- Paths are resolved relative to the doc that holds them (nested
--audit:- Python virtual environments are found by
pyvenv.cfg/conda-metaunder any name (.venv_re/,env/), and their library files no longer count as active source. - Plain-text files over 1 MB (
.txt,.log,.csv, ...) are flagged for review. - Subfolders with their own
AGENTS.md+.ignoreare listed as nested setups instead of being counted again. .exe/.dll/.binare labelled "binary/media" instead of "media/fonts".
- Python virtual environments are found by
- Private key files (
*.pem,*.key,*.p12,*.pfx,id_rsa*,id_ed25519*) are now in the base ignore set, so search never surfaces them. Re-run--sync-ignores --writeto add them. - C# outline:
- Methods with default parameter values (
RunAsync(int retries = 3)) are listed. - Expression-bodied methods (
ToString() => ...) are listed.
- Methods with default parameter values (
--outlineon a file whose full list exceeds the output cap now hides nested symbols first (the header says how many), so the top-level map is not cut off. A[filter]lists them.
Security
- Secret redaction now catches four kinds of secret that used to pass through
--slice/--outline/--mapoutput unredacted:- AWS secret access keys (40-char base64) next to an AWS secret key name (
aws_secret_access_key = ...,AWS_SECRET_ACCESS_KEY=,secretAccessKey:), quoted or not. The same 40-char shape elsewhere is left alone. - Quoted values of 8+ characters assigned to
password,passwd,secret,secret_key,api_key/apiKeyortokennames, including prefixed names such asDB_PASSWORDoraccess_token(:,=,:=and=>). Only the value is redacted, so the key name stays readable. Code such asconst password = getPassword(),token = req.headers.x, text with spaces and${VAR}placeholders is not redacted. - Hugging Face
hf_tokens. - Azure
AccountKey=andSharedAccessKey=values in connection strings.
- AWS secret access keys (40-char base64) next to an AWS secret key name (
v1.5.0
Added
-
--outline/--slicenow find more symbols:- Go generic functions (
func Map[T any, U any](...)). - Rust
impl<T: Into<String>> Point<T>blocks written without a space before<, andmacro_rules!macros. - TS/JS class properties that hold arrow functions (
static create = <U,>(v: U) => ...,handle = async (e) => {). - Top-level object/array constants of 10+ lines (
const OL = Object.freeze({,const ROUTES = [,new Set([).
The TypeScript Compiler AST path applies the same rules. TS lexer accuracy baseline: 90.1% to 90.3% (141 to 145 judged symbols).
- Go generic functions (
Fixed
--slice <file> <symbol>no longer silently returns a different symbol when the name is only a partial match. A partial name that fits several symbols is refused with the candidate list (for exampleOLused to printcollectAuditStats); a partial name that fits exactly one symbol still works but prints anote: partial matchline. An exact name shared by several symbols (two__init__methods, for example) still returns the first one, with anote: N symbols named "X"line.- Python one-line
def/classbodies (def f(self): return 1,class B(A): pass) now end on their own line instead of swallowing the code that follows. Signature scanning also skips:,#and brackets inside string defaults.
v1.4.0
Security
- All repository writes (
--sync-ignores --write,--sync-landmarks --write,--handoff --out) now refuse symlinks and paths that resolve outside the repository root. Previously a repository shipping.ignoreas a symlink could make--sync-ignores --writeoverwrite a file outside the repo.
Fixed
--sync-ignores --writeno longer deletes patterns that exist only in.contextignoreor in the user's ownextra_ignore_patternsin.jcodemunch.jsonc; they are merged, as already done for the other tool ignore files.
Changed
typescriptis no longer an optional dependency: installs are truly zero-dependency (no ~20 MB download onnpx). Compiler-AST mode is opt-in via a globaltypescriptinstall, now also detected in the macOS/Linux global npm directory.- CI: macOS added, Node 18/20/22/24 matrix, least-privilege token permissions, superseded PR runs cancelled, Actions bumped to v5, Dependabot for workflow actions.
v1.3.1
Added
- Lexer accuracy corpus: 21 unmodified real-world files scored against real parsers (
npm run accuracy); CI fails when a language drops below its recorded baseline.
Fixed
- Lexer (TS): type aliases without braces no longer run on to a later block; class methods indented with tabs or with parameters wrapped across lines are now listed; arrow functions whose expression body starts on the next line get the right end line. Measured TypeScript exact-span accuracy went from 66.0% to 90.1%.
Changed
- Install instructions, site, demo, and the
--check-updateupgrade hint now use the npm package (npx antis-optimizer,npm install -g antis-optimizer). - Release workflow stages the npm publish for maintainer 2FA approval.
v1.3.0
Added
- Release automation: pushing a
vX.Y.Ztag tests, creates the GitHub Release from this file, and publishes to npm with provenance. SECURITY.md,CODE_OF_CONDUCT.md, and this changelog.
Changed
--auditslice savings are now measured from each monolith's real symbol spans instead of a fixed 450-token constant; the line is labelled as an estimate and states its basis. Break-even shows two decimals.--helpgroups commands by purpose, leading with--outline/--slice.- README: real output examples, supported-languages table, Safety & Limits section.
v1.2.0
Added
- OpenCode first-class support and multi-host / RTK detection in
--detect - Conditional (anti-bloat) ignore sync: only tool ignore files that already exist are updated
- Expanded language and config outlines/slices (Java, C# namespaces, YAML list items, JSON arrays) and stack detection
AGENTS.mdand synced ignore files for this repo; CI now runs--verifyon itself
Security
- Secret redaction now covers Slack, GitHub fine-grained (
github_pat_), Stripe, npm and GitLab tokens, PEM private-key blocks, passwords inscheme://user:pass@hostURLs, and_authToken=values .npmrc,.netrc,.pypirc,.git-credentialsand non-RSA SSH keys are refused- TypeScript is no longer resolved from the script's own directory when that directory is inside the scanned root (set
ANTIS_TRUST_LOCAL_TS=1to opt out)
Changed
- Narrowed over-broad
.gitignoreglobs - Site savings figures labelled as modeled
- Test suite: 59 tests
Full changelog: v1.1.0...v1.2.0
v1.1.0
What's New in v1.1.0
Highlights
- Tier-0 / Tier-1 / Tier-2
--audit&--verifyparity: Extracted sharedcollectAuditStats()andclassifyRepoTier()helpers so clean repos with many small files do not fall through to Tier 2, Tier-00-doc repos pass--verifycleanly, and passing--verifyoutput prints on a single|-delimited line. - AST/Lexer
--slice&:Lstart-Lendranges: Added:Lstart[-Lend]range slicing alongside#symbol, resolved code symbols viaparseFileOutline()instead of first substring hits, surfaced missing-symbol errors, eliminated false secret blocks on code files likesecretManager.ts, and gated raw.jsonarg refusal onhasTokenOpt. .gitignore!negation preservation & comment-safe.jcodemunch.jsoncsync: Preserved!negation ordering across ignore checks/sync targets and inserted missingextra_ignore_patternswithout stripping JSONC comments.- Read-only
--check-update [--critical-only]: On-demand GitHub Releases checker (pinnedhttps://api.github.com,2.5stimeout, zero auto-writes) that flags intermediate[CRITICAL]/[SECURITY]releases and prints exact manual upgrade steps per install type.
Full Changelog: v1.0.0...v1.1.0
v1.0.0 — Cut AI Context Bloat & Token Waste
What Is antis-optimizer?
AI coding assistants (Claude Code, Cursor, Codex, and Antigravity) quietly waste huge chunks of your context window reading build folders (dist/, node_modules/, lockfiles), giant JSON dumps, and entire 800-line files just to inspect one function.
v1.0.0 gives you a fast, zero-dependency CLI and lightweight repo setup to stop the waste.
What's Inside v1.0.0
- Find what's eating your tokens (
--audit): Scans your repo for junk folders, oversized bundles, and huge files, then recommends the lightest setup that pays off. - Sync ignore files in one shot (
--sync-ignores --write): Mirrors ignore rules across.ignore,.contextignore, and.jcodemunch.jsoncwithout wiping your existing comments. - Read exact line ranges, not whole files (
--outline,--slice): Maps functions, classes, HTML sections, CSS blocks, and JSON keys tofile:Lstart-Lendranges across TS/JS/JSX/TSX, Python, Rust, Go, C/C++, C#, HTML, CSS, and JSON (uses TypeScript's real parser if installed, or its own built-in parser with zero required dependencies). - Auto-update shifted line numbers (
--sync-landmarks --write&--verify): KeepsAGENTS.md/INDEX.mdline numbers accurate after edits, strips secrets automatically, and checks everything in one cleanPASSline.
Quick Start
Try it right away without cloning:
npx github:4anti/antis-optimizer --auditOr install globally:
npm install -g git+https://github.com/4anti/antis-optimizer.git
antis-optimizer --help- Tested: 29/29 automated checks passing on Linux & Windows (Node 18 and Node 22).
- Attached archive:
antis-optimizer-1.0.0.tgz(v1.0.0npm package bundle).