r/GithubCopilot • u/ShunsukeF • 9d ago
Showcase ✨ I got tired of Copilot Chat context bloat, repeating the same rules, and burning credits overnight—so I built three small local extensions to fix them (Open Source / MIT)
If you use GitHub Copilot Chat or Agent mode heavily, long sessions tend to break down in three predictable ways:
- The context window silently fills up and the model starts ignoring instructions.
- You keep typing the exact same corrections across different chats.
- Leaving a task running overnight risks either a stalled chat or an ugly surprise in your premium request / credit usage.
I built three lightweight, standalone VS Code extensions (all MIT-licensed and local-first) to put guardrails around each of those failure modes:
1. Tsugi — Live Context Meter, Handoff & Task Split
- What it does: Shows live context window / token usage right in the status bar. When it hits your warning threshold (default 80%), one click opens a fresh chat pre-filled with your goal, recent exchanges, and workspace Git state. It can also split a bloated multi-topic session into separate task-filtered chats.
- Design & safety: Uses a small resident Zig scanner (with a JS fallback) to read session patches without reconstructing huge chat objects on every refresh. Handoffs use zero extra model tokens, and prompts are only placed in the input box—nothing is auto-sent without your review.
2. Ne — Turn Repeated Corrections into Custom Instructions
- What it does: Scans your past chat sessions for corrections you keep repeating across multiple chats, analyzes the likely root cause, and drafts a concrete rule for
.github/copilot-instructions.mdor your globaluser-preferences.instructions.md. - Design & safety: Only triggers when a pattern appears across at least 2 separate sessions (so one-off back-and-forth isn't noise). Gives you a 5-second review window with CodeLens actions to edit, change scope, or roll back just that rule without touching the rest of your file.
3. Eien — Overnight / AFK Resume with a Strict Credit Circuit Breaker
- What it does: Monitors an active, still-processing chat that has gone quiet (default 120s) and sends a continuation prompt so you can leave long tasks running overnight.
- Design & safety: Before starting, you set a strict AI credit budget for that run. Eien polls the saved
copilotCreditsdelta every 15s, cancels the active request, and kills its loop the moment the limit is reached. Each intervention is saved as a rollback-ready Git checkpoint underrefs/eien/checkpointusing a temporary index—so your working branch, normal Git index, and GPG signing hooks are never touched. (OS accessibility auto-click for approval buttons is also available, but disabled by default.)
Caveats / Under the Hood
- No external servers or telemetry: Everything runs locally in VS Code. Model calls only happen when you explicitly confirm a task split (Tsugi) or rule analysis (Ne).
- Undocumented file format: All three rely on parsing Copilot Chat's local
chatSessions/*.jsonlfiles. Because that format isn't a public API, they are built to fail safely and stop rather than corrupt anything if an upstream update changes the schema (currently verified on VS Code 1.147 / Copilot Chat 0.75).
Source code, architecture notes, and demos are on GitHub: https://github.com/furukawa658/vscode-chat-tools
They work independently or together as a pack (links in the comments). Curious how others here are handling context bloat or keeping Agent runs from burning through credits unattended—happy to hear any edge cases or feedback.
1
u/ShunsukeF 4d ago
Quick update (v0.4.0 is out!):
Thanks for all the feedback so far! I just pushed an update to Tsugi with a few major workflow improvements: Dedicated Sidebar: You can now pick the exact source chat to hand off (super helpful when you have multiple chats open in the same workspace) and keep it pinned even as other sessions update.
Customizable Handoff Detail: Choose between summary-only, summary + decisions, or full context. Next-Chat Credit Budget: Set a suggested AI-credit target that gets written right into the handoff prompt as a pacing guide.
Instant EN/JA Switch: Toggle the sidebar UI between English and Japanese on the fly. Auto-open or Clipboard: Choose whether to automatically open a fresh chat with the prompt ready or just copy it to your clipboard.
Still 100% local/zero-model-call for standard handoffs. If you've been using it, let me know how the new sidebar feels!
1
u/ShunsukeF 3d ago
Author's note: If you want to squeeze even more mileage out of Eien and Tsugi before hitting context limits, check out Zuma MCP—the fourth piece of this suite that handles log/context compression and test execution: https://marketplace.visualstudio.com/items?itemName=ShunsukeF.inazuma-pwsh