{"id":51413209,"url":"https://github.com/anvanster/compressor-vscode","last_synced_at":"2026-07-04T16:30:46.150Z","repository":{"id":364628264,"uuid":"1268621051","full_name":"anvanster/compressor-vscode","owner":"anvanster","description":"Save tokens in GitHub Copilot agent mode: compressed read/search/outline tools, a savings ticker and report, and instruction-pack management for the compressor toolchain. No network calls.","archived":false,"fork":false,"pushed_at":"2026-06-13T19:40:04.000Z","size":147,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-13T21:10:44.448Z","etag":null,"topics":["ai-coding-assistant","claude","context-compression","copilot","developer-tools","github-copilot","language-model-tools","llm","token-optimization","vscode","vscode-extension"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anvanster.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-13T18:42:50.000Z","updated_at":"2026-06-13T19:40:08.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/anvanster/compressor-vscode","commit_stats":null,"previous_names":["anvanster/compressor-vscode"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/anvanster/compressor-vscode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anvanster%2Fcompressor-vscode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anvanster%2Fcompressor-vscode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anvanster%2Fcompressor-vscode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anvanster%2Fcompressor-vscode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anvanster","download_url":"https://codeload.github.com/anvanster/compressor-vscode/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anvanster%2Fcompressor-vscode/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35129187,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-04T02:00:05.987Z","response_time":113,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-coding-assistant","claude","context-compression","copilot","developer-tools","github-copilot","language-model-tools","llm","token-optimization","vscode","vscode-extension"],"created_at":"2026-07-04T16:30:46.061Z","updated_at":"2026-07-04T16:30:46.142Z","avatar_url":"https://github.com/anvanster.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Compressor — AI Token Savings (VS Code)\n\n[![VS Code Marketplace](https://img.shields.io/visual-studio-marketplace/v/aStudioPlus.compressor-vscode?label=Marketplace)](https://marketplace.visualstudio.com/items?itemName=aStudioPlus.compressor-vscode)\n\nCompanion extension for\n[compressor](https://github.com/anvanster/compressor): compressed\nread/search/outline tools for Copilot agent mode, a savings ticker/report over\nthe compressor ledger (`~/.compressor/ledger`, override with\n`COMPRESSOR_LEDGER_DIR`), and manage commands for instruction packs. No network\ncalls.\n\n## Features\n\n- **Three language-model tools** for Copilot agent mode, all confined to the\n  open workspace folders and all recording worthwhile compressions to the\n  ledger as agent `vscode`:\n  - **`#compressorRead`** — reads a file through the engine: comment-stripping\n    that preserves line numbers, repeated-line dedupe, and recoverable\n    `[compressor:]` markers stating the exact `offset`/`limit` to retrieve\n    omitted lines. Pass `offset`/`limit` for an exact uncompressed range.\n  - **`#compressorSearch`** — workspace text/regex search returning compressed\n    grep-style results (file, line, match). Accepts `isRegex`, `ignoreCase`,\n    an `include` glob, and `maxResults`. Find where something is used without\n    reading whole files.\n  - **`#compressorOutline`** — a file's imports and signatures with bodies\n    collapsed into recoverable markers (TypeScript/JavaScript, Rust, Python,\n    Go). Understand a large file's shape cheaply, then expand a body with\n    `#compressorRead`.\n- **Copilot steering** — **Compressor: Enable/Disable Copilot Steering**\n  installs/removes three extension-owned files. VS Code has no API to force tool\n  choice or override the built-in read, and instructions don't route tools, so\n  the deterministic lever is a `tools:` allowlist that omits the built-in read:\n  - `.github/agents/compressor.agent.md` — a **custom agent** (\"compressor\")\n    whose toolset is the compressor read/search/outline tools plus edit, with\n    the built-in read/codebase-search left out. Pick it from the Chat agents\n    dropdown and every read in that session goes through the compressor tools.\n  - `.github/prompts/compressor.prompt.md` — the **`/compressor`** prompt, the\n    same scoping for one-shot tasks.\n  - a marker-fenced section in `.github/copilot-instructions.md` — a best-effort\n    nudge for the *default* agent (instructions are advisory for tool routing,\n    so this alone is unreliable; the agent/prompt are the real lever). It is\n    fenced in distinct `compressor-vscode:steering` comments so it updates and\n    removes cleanly and coexists with a `compressor init` pack section in the\n    same file.\n- **Ticker** (status bar): `≈12.3k tok saved (30d)` — estimated tokens saved\n  in the configured window. Chars are exact; token figures are estimates from\n  the cheap estimator, never billable counts. Click it for the report.\n- **Compressor: Show Savings** — the savings report (by day / agent / tool / mode) in\n  a webview, themed to the active color scheme. Static HTML, scripts disabled.\n  Optionally (set `compressor.showActualUsage`, off by default) appends an\n  **actual-usage** section parsed from this project's Claude Code session\n  transcripts (`~/.claude`) — authoritative token counts, clearly labeled\n  *not savings* and not billable dollars (Claude Code only).\n- **Mode indicator** (status bar): `$(fold) compressor: \u003cmode\u003e` — click to\n  switch the read tool's compression mode without the command palette.\n- **Compressor: Count Tokens** — exact chars and an estimated token count for\n  the active file or selection (chars/3.5; never billable).\n- **Compressor: Preview Compression** — runs the engine over the active file or\n  selection exactly as `compressor_read` would and opens a side-by-side diff\n  (numbered original vs compressed). No file writes.\n- **Compressor: Status** — per-adapter install status for the first workspace\n  folder, steering state, and ledger recency.\n- **Compressor: Init / Set Instruction-Pack Mode / Uninstall** — plan\n  instruction-pack changes with the library adapters, review the rendered diff,\n  confirm, apply. Changed files are backed up first (under `~/.compressor/backups`)\n  — undo from a terminal with `compressor restore`. claude-code/copilot\n  (hook-bearing) are offered only when `compressor-hook` resolves on PATH;\n  otherwise use the `compressor` CLI.\n\nSettings: `compressor.savingsWindow` (`7d` | `30d` | `all`, default `30d`),\n`compressor.mode` (`full` | `optimized` | `slim`, default `optimized` — the\nread tool's compression mode; `full` = passthrough), and\n`compressor.showActualUsage` (default `false` — show the Claude Code\ntranscript usage section in the report).\n\n## Try it\n\nNew install? Open the **Get started with Compressor** walkthrough (VS Code\nWelcome page, or run `Welcome: Open Walkthrough`).\n\nAfter **Compressor: Enable Copilot Steering**, the strongest path is to pick the\n**compressor** agent from the Chat agents dropdown (or run **/compressor**) — the\nbuilt-in read is out of scope there, so the agent must use the compressor tools.\nYou can also `#`-reference them explicitly in any agent-mode chat:\n\n```\nRead #compressorRead src/server/router.ts and explain the route table.\n```\n```\nSummarize the failures in #compressorRead logs/test-run.txt — just the failing\nassertions and the final count.\n```\n\nIn the *default* agent the model only *tends* to pick `compressor_read` on its\nown (no API forces it); the compressor agent and `/compressor` make it\ndeterministic. More examples and the full command list are in\n[`docs/USAGE.md`](docs/USAGE.md).\n\n## What it does NOT do\n\n- It **cannot compress VS Code Copilot's built-in tool output**. VS Code hooks\n  cannot replace tool output (doc-verified 2026-06-12); in-IDE compression\n  happens only when the agent uses `#compressorRead`. Instruction packs reach\n  Copilot via `.github/copilot-instructions.md` / `AGENTS.md` — see the\n  [compressor docs](https://github.com/anvanster/compressor).\n- It makes no network calls and reads no file contents beyond the ledger\n  JSONL, this project's Claude Code session transcripts (for the usage report),\n  and files explicitly requested through `compressor_read` / the preview and\n  count commands.\n- It shows no percentage claims; measured savings come from\n  `compressor benchmark`, not this view.\n\n## Install\n\nFrom the [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=aStudioPlus.compressor-vscode)\n— search **\"Compressor — AI Token Savings\"** in the Extensions view, or from a\nterminal:\n\n```sh\ncode --install-extension aStudioPlus.compressor-vscode\n```\n\nOr build and install the VSIX locally:\n\n```sh\nnpm run package            # produces compressor-vscode-\u003cversion\u003e.vsix\ncode --install-extension compressor-vscode-\u003cversion\u003e.vsix\n```\n\nUsage guide and example prompts: [`docs/USAGE.md`](docs/USAGE.md).\n\n## Development\n\nRequires VS Code ≥ 1.95 (LanguageModelTool API) and a built `../compressor`\ncheckout next to this directory (the library is a `file:` dependency):\n\n```sh\n(cd ../compressor \u0026\u0026 npm install \u0026\u0026 npm run build)\nnpm install\nnpm run typecheck\nnpm run build      # esbuild bundle → out/extension.js\nnpm test           # vitest ('vscode' is aliased to a local mock)\nnpm run package    # vsce → .vsix\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanvanster%2Fcompressor-vscode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanvanster%2Fcompressor-vscode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanvanster%2Fcompressor-vscode/lists"}