Skip to content
| Marketplace
Sign in
Visual Studio Code>AI>CreditLensNew to Visual Studio Code? Get it now.
CreditLens

CreditLens

Arijit Aich

|
2 installs
| (0) | Free
Cut GitHub Copilot Claude credit consumption with cache-aware prompt compression, and see every credit spent and saved in real time.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

CreditLens

Cut your GitHub Copilot (Claude) credit consumption — and see exactly how much you save, in real time.

CreditLens compresses the parts of your Copilot prompts that are safe to compress, without touching Copilot's cache, so your Claude requests cost fewer credits. It also meters Copilot's real billed cost per call (not an estimate) and proves the savings on a live dashboard: credits with the compressor on vs. off, side by side.

Everything runs locally on your machine. Nothing is sent anywhere except your normal Copilot traffic to GitHub, unchanged in destination.


What it does

  • Cache-aware prompt compression. Copilot heavily caches your prompt prefix (system prompt, tools, context) — that part is already cheap. CreditLens never modifies cached content; it only compresses the new, uncached parts of each request, so it can never break Copilot's cache.
  • Two levers, both optional and toggleable:
    • Imaging — renders large blocks of prose into a compact image (a vision model bills a big image at a flat, low token rate). Code and tool-call structure are left untouched.
    • Caveman — appends a terse-output directive so Claude answers concisely (output tokens are the most expensive kind).
  • Real credit metering. Reads Copilot's own billed cost (total_nano_aiu) from each response — exact, not a guess — and shows credits spent and saved.
  • Proof, measured. A dashboard panel compares real credits/call compressor on vs. off, with a plain verdict (X% cheaper / X% more) and small-sample warnings. If a setting ever costs more on your workload, it tells you — honestly.

Requirements

  • VS Code 1.85+ with GitHub Copilot (using a Claude model — e.g. Sonnet / Opus).
  • Python 3.10+ installed and on your PATH. CreditLens auto-installs its Python dependencies (Pillow + mitmproxy) on first run.
    • On macOS, if you don't have a recent Python: brew install python.
  • Windows, macOS, and Linux are all supported. The certificate-trust step differs per OS — the Show Certificate-Trust Command gives you the right one.

Platform support

OS Status Notes
Windows ✅ Supported Certificate trust installs to your user store — no admin needed.
macOS ✅ Beta Certificate trust uses the System keychain and requires your password (sudo). If you don't have Python 3.10+, run brew install python.
Linux ✅ Beta Certificate trust shown for Debian/Ubuntu; other distributions trust CAs differently.

The Show Certificate-Trust Command action always gives the correct command for your OS. Beta = fully implemented and expected to work, but less widely tested than Windows — feedback welcome.


Setup (first run — about 2 minutes)

  1. Install CreditLens from the Marketplace and reload VS Code. On first activation it locates Python, installs its dependencies (one-time, may take a minute), and starts two local background services: a sidecar (dashboard + renderer) and a proxy (the compressor).

  2. Trust the local certificate (one-time). Compression works by routing Copilot through a local proxy, which needs a locally-generated certificate to be trusted.

    • Run CreditLens: Show Certificate-Trust Command from the Command Palette (Ctrl/Cmd+Shift+P). It copies the correct command for your OS:
      • Windows (PowerShell, no admin):
        Import-Certificate -FilePath "$env:USERPROFILE\.mitmproxy\mitmproxy-ca-cert.cer" -CertStoreLocation Cert:\CurrentUser\Root
        
      • macOS (Terminal, enter your password):
        sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain "$HOME/.mitmproxy/mitmproxy-ca-cert.pem"
        
      • Linux (Debian/Ubuntu):
        sudo cp "$HOME/.mitmproxy/mitmproxy-ca-cert.pem" /usr/local/share/ca-certificates/mitmproxy.crt && sudo update-ca-certificates
        
    • Paste it into your terminal and run it.
  3. Route Copilot through CreditLens.

    • Run CreditLens: Route Copilot Through Proxy and confirm.
    • Reload the window so Copilot picks up the change.
  4. Use Copilot Claude normally. Compression is on by default (cache-aware). Your Copilot chat and agent behave exactly as before — just cheaper.

  5. Watch it work. Click the CreditLens item in the status bar to open the dashboard: real credits, the on-vs-off proof, and the compression levers.

To turn compression off entirely, run CreditLens: Stop Routing Through Proxy.


The dashboard

Open it from the status bar or CreditLens: Open Dashboard:

  • Credits & tokens — real billed credits, input/output, and cache read/write.
  • Compression levers — toggle Imaging, Caveman, Include-Code, Include-Tool-Call-Prose. Changes apply immediately and persist.
  • Proof — average real credits/call, compressor on vs. off, with a verdict. This is Copilot's own billing, not an estimate.
  • Real-time token flow and per-model breakdown.

The status bar shows the live total and the current verdict at a glance.


Commands

Command What it does
CreditLens: Open Dashboard Open the full dashboard in your browser
CreditLens: Show Panel In-editor summary panel
CreditLens: Route Copilot Through Proxy Start compressing (sets http.proxy)
CreditLens: Stop Routing Through Proxy Stop compressing
CreditLens: Show Certificate-Trust Command Copies the one-time CA-trust command
CreditLens: Start / Restart Services Restart the sidecar + proxy
CreditLens: Toggle — image large prose Imaging lever
CreditLens: Toggle — terse output (caveman) Caveman lever
CreditLens: Toggle — also compress code Image code too (off by default; see below)
CreditLens: Toggle — also compress tool-call prose Image prose beside tool calls
CreditLens: Reset Stats Clear recorded stats

Settings

Setting Default Meaning
creditlens.hubUrl http://127.0.0.1:7878 Local sidecar (dashboard + config + renderer)
creditlens.proxyUrl http://127.0.0.1:8080 Local compression proxy
creditlens.pythonPath (auto) Path to Python 3.10+ if auto-detect fails
creditlens.autoStartServices true Start the sidecar + proxy on activation

Compression toggles (imaging, caveman, include-code, include-tool-calls, density, min-words) live in the sidecar so they're shared across all VS Code windows; change them from the dashboard or the toggle commands.


How compression stays safe

  • Cache-aware by design. CreditLens reads Copilot's cache_control markers and only ever rewrites content after the last cache breakpoint — your cached system prompt, tools, and context are never touched, so caching keeps working.
  • Code is not imaged by default. A single OCR misread can corrupt code, so imaging is limited to prose unless you explicitly opt in with Include code.
  • Tool-call structure is preserved. The tool_use blocks that drive Copilot's agent loop are never turned into images; only the prose beside them can be (opt-in).

Privacy & security (plain English)

  • Local only. The dashboard, renderer, and proxy all run on 127.0.0.1. CreditLens does not send your prompts or data to any third party. Your Copilot requests still go to GitHub as usual — CreditLens just makes them smaller first.
  • How interception works. To compress a request before it reaches Copilot, VS Code is pointed at a local proxy, which needs a locally-generated certificate to be trusted (step 2 above). That certificate lets the local proxy read your machine's TLS while it is trusted — this is the same mechanism corporate security proxies use.
  • Fully reversible. Remove the trusted certificate and clear the http.proxy setting (CreditLens: Stop Routing Through Proxy) to return to a completely normal setup. To remove the certificate:
    Get-ChildItem Cert:\CurrentUser\Root | Where-Object { $_.Subject -like '*mitmproxy*' } | Remove-Item
    
  • Your choice. CreditLens intercepts and rewrites your own Copilot traffic on your own machine, for your own cost savings. Install it only if that's what you want.

Troubleshooting

  • Status bar says "offline" → run CreditLens: Start / Restart Services. If it persists, check the CreditLens output channel.
  • "No Python found" → install Python 3.10+ and ensure it's on PATH, or set creditlens.pythonPath.
  • Copilot errors right after enabling the proxy → the certificate isn't trusted yet. Run the trust command (step 2) and reload the window.
  • Dashboard shows no data → three things to check, in order:
    1. Fully restart VS Code (quit and reopen — not just "Reload Window"). Copilot only picks up proxy routing on a fresh start.
    2. Confirm "http.proxySupport": "override" in your settings. "on" is not enough — only override routes extension traffic (Copilot) through the proxy.
    3. Make sure you're using a Claude model in native Copilot Chat. Other AI extensions that answer locally or via their own backend produce no Copilot traffic to measure.
  • Copilot works but nothing is captured → almost always http.proxySupport set to on instead of override, or VS Code wasn't fully restarted.
  • Want to compare fairly → toggle a lever, run a few turns, and read the Proof panel's verdict. Small samples are flagged; run several turns each way.

Notes

  • CreditLens estimates and measures credits, not answer quality. The only lever with a quality trade-off is Include code (image OCR); it's off by default.
  • Savings depend on your workload. On cache-heavy agent sessions the biggest costs are already cached and cheap, so gains come mainly from trimming output (Caveman) and compressing large uncached prose. The dashboard tells you the truth for your usage.

License: MIT.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft