mksglu

Activity

Stars and mentions · Last 30 days, Oct 6 – Nov 4

GitHub stars3,913
Mentions143
088176264352Oct 6Oct 20Nov 4
UTC days · repositories mksglu owns4 repositories

Top repositories

mksglu’s repositories ranked by new forks, as on trending.

Loading

Contributes to

Repositories outside mksglu’s account where mksglu opened or reviewed pull requests in the past 365 days.

Who noticed mksglu

Everyone who starred or forked mksglu’s repositories since the archive began in 2011.

Notable accounts

Ordered by the stars their own repositories have received.

Biggest fans

Accounts that starred the most of these repositories.

Breakout weeks

Each repository’s best week of new stars, with the release published around it.

Mentions

142posts
Nov 50 posts
  1. Hacker News · · Moon_Y · mksglu/context-mode

    Context Mode – An Open-Source MCP Server That Reduces AI Coding Context Usage

    1 point
  2. Your AI agent is drowning in tool output: this MCP server shrinks 315 KB of context to 5.4 KB and keeps sessions alive through compaction. 🔗 mksglu/context-mode #contextmode #typescript #mcp

    1 like
  3. Stop Claude Code context bloat with Context Mode: a 5 step setup Every MCP tool call dumps raw data into your context window. According to the Context Mode README, a Playwright snapshot costs 56 KB, twenty GitHub issues cost 59 KB, and one access log is 45 KB. After about 30 minutes of work, roughly 40% of a Claude Code context can be gone, and when the conversation compacts, the agent forgets which files it was editing. Context Mode is an MCP server plus a set of hooks that attacks this from two sides: it keeps raw output in a sandbox so only a small result reaches the chat, and it tracks session events in SQLite so work survives compaction. Our shorter walkthrough lives on the Deduped use-case page. Here is the full setup. Prerequisites You need Claude Code v1.0.33 or newer. Check with: claude --version If /plugin is not recognized, update first with brew upgrade claude-code or npm update -g @anthropic-ai/claude-code. Step 1: install the plugin Inside Claude Code, add the marketplace and install: /plugin marketplace add mksglu/context-mode /plugin install context-mode@context-mode Restart Claude Code, or run /reload-plugins. Step 2: verify with the doctor /context-mode:ctx-doctor All checks should show [x]. The doctor validates runtimes, hooks, FTS5 and plugin registration. If something is red, fix that before you continue, because the routing hooks are what make the savings automatic. What you get The plugin registers hooks (PreToolUse, PostToolUse, UserPromptSubmit, PreCompact, SessionStart, Stop) and 11 MCP tools. Six are sandbox tools: ctx_batch_execute, ctx_execute, ctx_execute_file, ctx_index, ctx_search and ctx_fetch_and_index. Five are meta tools: ctx_stats, ctx_doctor, ctx_upgrade, ctx_purge and ctx_insight. Routing is automatic. A SessionStart hook injects routing instructions at runtime, so nothing is written into your project. Step 3: think in code The idea the README pushes hardest: the model should program the analysis, not compute it. Instead of reading 50 files into context to count functions, the agent writes a script and prints only the answer: // Before: 47 x Read() = 700 KB. After: 1 x ctx_execute() = 3.6 KB. ctx_execute("javascript", ` const files = fs.readdirSync('src').filter(f => f.endsWith('.ts')); files.forEach(f => console.log(f + ': ' + fs.readFileSync('src/'+f,'utf8').split('\\n').length + ' lines')); `); One script replaces many tool calls. The README quotes 315 KB shrinking to 5.4 KB, a 98% reduction, for sandboxed output. Treat those as the project's own numbers, and measure yours. Step 4: measure your savings /context-mode:ctx-stats This shows a per-tool breakdown, tokens consumed and the savings ratio. For a live meter, add a status line to ~/.claude/settings.json: { "statusLine": { "type": "command", "command": "context-mode statusline" } } Restart Claude Code and the bar shows dollars saved this session, saved across sessions and percent efficient. Step 5: index docs you keep re-reading Point it at a local file or directory and search it later instead of pasting it in: /context-mode:ctx-index /context-mode:ctx-search Content goes into a persistent FTS5 knowledge base and comes back through BM25 search, so only relevant passages enter the chat. If you ever want it gone, /context-mode:ctx-purge permanently deletes everything indexed. Just want to try it? Skip the plugin and add only the MCP server: claude mcp add context-mode -- npx -y context-mode You get all 11 tools without automatic routing or slash commands. The model can use them but will not be nudged away from raw Bash, Read and WebFetch, so savings are smaller. It is a good way to test before committing. Session continuity Context Mode records file edits, git operations, tasks, errors and your decisions in SQLite. After a compaction it does not dump that history back in. It indexes the events into FTS5 and retrieves only what is relevant. One caution from the README: if you do not start with --continue, previous session data is deleted immediately, so a fresh session is a clean slate. Tips - Run ctx-stats after a long session so you know whether the hooks are routing. - Other clients are supported too, including Gemini CLI and VS Code Copilot, with their own config files; see the README. - If your pain is specifically noisy shell output, compare it with a CLI output compressor before stacking tools. Who this is for Anyone who runs long Claude Code sessions with browser, GitHub or log-heavy MCP tools and keeps hitting compaction. If your sessions are short, the overhead is not worth it. Repo: mksglu/context-mode. More ways people use it are on Deduped. --- Get one email every Monday with the week's hottest AI repos and exactly how to use them: subscribe free at dedupedai.com

  4. Context Mode helps your AI agent: ⚡ Process huge outputs without flooding context 🧠 Store results in searchable memory 🔍 Retrieve only what matters Works with multiple AI coding agents via MCP. 🔗Open source: mksglu/context-mode

    4 likes · 26 views
  5. O que é o Context Mode e como ele otimiza o contexto de agentes de IA O que é O Context Mode é um servidor MCP voltado para a otimização da janela de contexto em agentes de IA para programação. Ele utiliza isolamento em sandbox para evitar que chamadas de ferramentas insiram grandes volumes de dados brutos na conversa, alcançando uma redução de até 98%. Além disso, o sistema registra edições, tarefas, erros e decisões em um banco SQLite, permitindo resgatar informações via busca FTS5 e BM25 após a compactação do chat. Ele também encoraja a IA a executar scripts em vez de carregar múltiplos arquivos diretamente no contexto. Para quem serve É recomendado para desenvolvedores que utilizam agentes de código e enfrentam perda de histórico e esgotamento rápido de memória durante sessões longas. Serve para usuários de qualquer uma das 17 plataformas compatíveis ou da integração com o gateway OpenClaw que buscam manter a continuidade do trabalho. Como começar O Context Mode funciona como um servidor MCP integrado ao seu cliente de IA. Para reutilizar dados e manter o histórico de uma sessão anterior, utiliza-se a opção --continue. Caso essa opção não seja informada, os dados anteriores são excluídos para permitir um novo início limpo. As preferências de estilo e formato do texto final continuam sendo definidas pelo modelo ou por arquivos de instrução do usuário, como CLAUDE.md ou AGENTS.md. Instalação claude mcp add context-mode -- npx -y context-mode 🔗 Repositório oficial: mksglu/context-mode Veja em 1 minuto {% embed youtube.com %} 📚 Mais conteúdos do canal: gist.github.com

    1 reaction
  6. YouTube · · YouTube description · 민둥이 | 쉽게 배우는 AI · mksglu/context-mode

    개발자들이 먼저 깔았다..꼭 알아야 할 토큰 절약 도구 깃허브 TOP 7(깃허브 ★51만) AI 코딩할 때 토큰이 새는 네 군데(쓰는 양·읽는 양·찾아 헤맴·내 설정)와, 그걸 막으려고 개발자들이 만든 깃허브 도구 7개를 정리했습니다. 00:00 오프닝 00:28 포니테일 01:47 케이브맨 02:54 RTK 04:15 헤드룸 05:27 컨텍스트 모드 06:31 세레나 07:39 토큰 옵티마이저 08:39 마무리 📌 영상에 나온 도구 링크 1. 포니테일 (Ponytail) DietrichGebert/ponytail 2. 케이브맨 (Caveman) JuliusBrussee/caveman 3. RTK rtk-ai/rtk 4. 헤드룸 (Headroom) headroomlabs-ai/headroom 5. 컨텍스트 모드 (Context Mode) mksglu/context-mode 6. 세레나 (Serena) oraios/serena 7. 토큰 옵티마이저 (Token Optimizer) alexgreensh/token-optimizer [en-US] Developers' Must-Have Token Saving Tools: Top 7 GitHub Repos (517K Stars) I have summarized the four places where tokens leak when coding with AI (writing volume, reading volume, searching, and my settings), and seven GitHub tools created by developers to prevent them. I have compiled a list of these tools. 00:00 Opening 00:28 Ponytail 01:47 Caveman 02:54 RTK 04:15 Headroom 05:27 Context Mode 06:31 Serena 07:39 Token Optimizer 08:39 Wrap-up 📌 Links to tools featured in the video 1. Ponytail DietrichGebert/ponytail 2. Caveman JuliusBrussee/caveman 3. RTK rtk-ai/rtk 4. Headroom headroomlabs-ai/headroom 5. Context Mode mksglu/context-mode 6. Serena (Serena) oraios/serena 7. Token Optimizer alexgreensh/token-optimizer [id] Alat Penghemat Token Wajib Punya Pilihan Pengembang (Total 517 Ribu Bintang di GitHub) TOP 7 Saya telah merangkum empat tempat di mana token bocor saat melakukan pengkodean dengan AI (volume penulisan, volume pembacaan, pencarian, dan pengaturan saya), dan tujuh alat GitHub yang dibuat oleh pengembang untuk mencegahnya. Saya telah menyusun daftar alat-alat tersebut. 00:00 Pembukaan 00:28 Ponytail 01:47 Caveman 02:54 RTK 04:15 Headroom 05:27 Context Mode 06:31 Serena 07:39 Token Optimizer 08:39 Penutup 📌 Tautan ke alat yang ditampilkan dalam video 1. Ponytail DietrichGebert/ponytail 2. Caveman JuliusBrussee/caveman 3. RTK rtk-ai/rtk 4. Headroom headroomlabs-ai/headroom 5. Context Mode mksglu/context-mode 6. Serena (Serena) oraios/serena 7. Token Pengoptimal alexgreensh/token-optimizer

    258 likes · 11 comments · 25,737 views
  7. Context Mode: Cut Claude Code Context Usage by 98% (Open Source) --- title: "Context Mode: Cut Claude Code Context Usage by 98% (Open Source)" published: true tags: opensource, ai, claudecode, mcp canonical_url: devpik.com cover_image: devpik.com --- Here is a number that should worry anyone paying for Claude Code by the token. A single Playwright snapshot costs 56 KB of context. Twenty GitHub issues cost 59 KB. One access log, 45 KB. Every MCP tool call dumps raw data straight into the context window, and after about 30 minutes of real work, 40% of it is gone. Then comes the second blow. When the conversation gets too long, the agent compacts it to free space, and the compaction wipes its working memory. It forgets which files it was editing, what tasks were in progress, and what you last asked for. You spend the next ten minutes re-explaining everything. And there is a third leak most people never notice: the agent burns output tokens on filler, pleasantries and verbose explanations, eating context from both sides at once. This is the problem Context Mode was built for. It is an open-source MCP server by mksglu that attacks context bloat from four directions simultaneously, and the numbers are startling: 315 KB of raw tool output becomes 5.4 KB. That is a 98% reduction, and it extends a typical session from about 30 minutes to around 3 hours. How It Works: Sandboxes, Memory, and Thinking in Code Context Mode solves what its README calls all four sides of the context problem. 1. Context saving. Sandbox tools intercept raw tool output and keep it out of the context window. Instead of the model reading the full output, it gets a compact reference. A Playwright snapshot goes from 56.2 KB to 299 bytes (99% saved). Twenty GitHub issues go from 58.9 KB to 1.1 KB (98%). An access log of 500 requests goes from 45.1 KB to 155 bytes, effectively 100%. The benchmark table in the repo lists 21 scenarios, and the pattern holds across all of them. 2. Session continuity. Every file edit, git operation, task, error and user decision is tracked in a local SQLite database. When the conversation compacts, Context Mode does not dump all of that back into context. It indexes events with FTS5 full-text search and retrieves only what is relevant via BM25 ranking. The model picks up exactly where it left off, and it only pays context for the memories it actually needs. There is a privacy-conscious default worth knowing: if you do not pass --continue, previous session data is deleted immediately. A fresh session means a clean slate. 3. Think in code. This is the most opinionated idea in the repo, and arguably the smartest. Instead of reading 50 files into context to count functions, the agent writes a script that does the counting and logs only the result. One ctx_execute call replaces 47 Read calls: 700 KB becomes 3.6 KB. The philosophy is blunt: stop treating the LLM as a data processor and start treating it as a code generator. This is enforced as a mandatory paradigm across all supported clients. 4. No prose policing. Context Mode keeps raw data out of context but deliberately never tells the model how to write its final answer. Brevity, completeness, formatting, that is your model's call (or yours, via your own CLAUDE.md). The README cites research showing aggressive brevity prompts degrade coding benchmarks. The routing stays focused on where data goes, not how the model talks. The Benchmarks: 315 KB Becomes 5.4 KB The repo ships a full benchmark table, and it is worth reading because the savings are consistent rather than cherry-picked. Playwright snapshot: 56.2 KB raw, 299 bytes in context, 99% saved. GitHub issues (20): 58.9 KB to 1.1 KB, 98%. Access log with 500 requests: 45.1 KB to 155 bytes, effectively 100%. Context7 React docs: 5.9 KB to 261 bytes, 96%. An analytics CSV with 500 rows: 85.5 KB to 222 bytes, 100%. Git log of 153 commits: 11.6 KB to 107 bytes, 99%. Test output across 30 suites: 6.0 KB to 337 bytes, 95%. Even a deep repo-research subagent run drops from 986 KB to 62 KB, 94% saved. Over a full session, the headline number is 315 KB of raw output becoming 5.4 KB in context. Session time extends from roughly 30 minutes to around 3 hours. If you are paying per token, that is not a marginal improvement, it is the difference between an agent that taps out mid-task and one that finishes. Installing It Takes Two Commands on Claude Code On Claude Code, installation is a plugin marketplace add. You need Claude Code v1.0.33 or newer. Open Claude Code and run: /plugin marketplace add mksglu/context-mode /plugin install context-mode@context-mode Restart Claude Code (or run /reload-plugins), then verify with /context-mode:ctx-doctor. Every check should show green. The plugin registers hooks for SessionStart, PreToolUse, PostToolUse, UserPromptSubmit, PreCompact and Stop, plus 11 MCP tools: six sandbox tools (ctx_batch_execute, ctx_execute, ctx_execute_file, ctx_index, ctx_search, ctx_fetch_and_index) and five meta-tools (ctx_stats, ctx_doctor, ctx_upgrade, ctx_purge, ctx_insight). The hooks do the heavy lifting automatically. The SessionStart hook injects routing instructions at runtime, so no file gets written into your project. PreToolUse and PostToolUse hooks intercept tool calls and redirect raw output to the sandbox before it ever touches your context. There is also a status line you can add with a one-time edit to ~/.claude/settings.json. It shows dollars saved this session, dollars saved across sessions, and your efficiency percentage, updating in real time as you work. Watching the savings accumulate is the fastest way to believe the benchmarks. 17 Platforms, but Hooks Are What Make It Work Context Mode supports 17 platforms: Claude Code, Qwen Code, Gemini CLI, VS Code Copilot, JetBrains Copilot, GitHub Copilot CLI, Cursor, OpenCode, KiloCode, OpenClaw, Codex CLI, Kimi Code, Antigravity, Antigravity CLI, Kiro, Zed and Pi. That breadth matters because most developers do not live in one agent. But the README is honest about a split that matters more than the platform count. On hook-capable platforms, hooks intercept tool calls programmatically: they can block dangerous commands and redirect output to the sandbox before execution. Measured savings sit around 98%. On platforms without hook support, Context Mode falls back to routing instruction files (a copied AGENTS.md or GEMINI.md), which guide the model through prompt instructions but cannot block anything. Measured savings there drop to around 60%, because one unrouted curl or Playwright snapshot can dump 56 KB into context and wipe out a whole session's savings. Concretely: Claude Code, Gemini CLI, the Copilots, Cursor, OpenCode, Codex CLI, Kiro and Pi get the full ~98% treatment. Antigravity and Zed do not support hooks, so they rely on the manually copied routing file at ~60%. If you are choosing where to run it, pick a hook-capable host. The README's own advice is direct: always enable hooks where supported. The Utility Commands You Will Actually Use Inside any AI session, you just type the command and the model calls the MCP tool for you. ctx stats shows your context savings with a per-tool breakdown, tokens consumed and savings ratio. ctx doctor diagnoses runtimes, hooks, FTS5 and versions. ctx index indexes a local file or directory into the persistent knowledge base, and ctx search searches it later. ctx upgrade pulls the latest from GitHub, rebuilds and fixes hooks. ctx purge permanently deletes all indexed content. ctx insight opens the hosted Insight dashboard at context-mode.com/insight, which gives org-level analytics for AI-assisted engineering teams. From the terminal, the same operations run without an AI session: context-mode doctor, context-mode index, context-mode search, context-mode upgrade. There is also a debug script (scripts/ctx-debug.sh) that collects OS info, runtime versions, hook validation and environment into a single pasteable markdown report for bug reports, which tells you something about how the maintainer thinks about support. One design decision deserves credit: everything is stored locally in SQLite under your own machine. The privacy section of the README is explicit about the architecture, and combined with the delete-on-fresh-session default, it is clear the project was designed by someone who has thought about what it means to let a tool watch every file edit. Who Should Install It (and Who Can Skip) Install it if you use Claude Code (or another hook-capable agent) for sessions longer than 30 minutes, you pay per token and watch usage climb, your agent keeps forgetting context after compaction, or you run lots of MCP tools like Playwright, GitHub or database queries whose raw output is enormous relative to what you actually need from it. Skip it if your sessions are short and simple, you work exclusively in Zed or Antigravity where only the ~60% instruction-file mode applies, or you are uncomfortable with a tool that hooks every tool call, even though the hooks run locally and the data stays in SQLite on your machine. The social proof is hard to ignore: #1 on Hacker News with 570+ points, 30,000+ GitHub stars, and a README that lists usage across teams at Microsoft, Google, Meta, Amazon, IBM, NVIDIA, ByteDance, Stripe, Datadog and Salesforce. It is ELv2 licensed and free to use. If context bloat is the tax you pay on every agent session, this is the most concrete rebate anyone has shipped. What is Context Mode? Context Mode (mksglu/context-mode) is an open-source MCP server for AI coding agents. It reduces context window usage by up to 98% by sandboxing raw tool output, persists session memory across context compaction using SQLite and full-text search, and enforces efficient routing with hooks. It supports 17 platforms including Claude Code, Cursor, Gemini CLI and GitHub Copilot. How does Context Mode reduce Claude Code context usage? Four mechanisms: (1) sandbox tools keep raw tool output out of context (315 KB becomes 5.4 KB), (2) session events are stored in SQLite and retrieved via BM25 search only when relevant, (3) the agent is made to write analysis scripts instead of reading files into context, and (4) hooks enforce the routing automatically. Measured savings are ~98% on hook-capable platforms. Is Context Mode free to use? Yes. Context Mode is open source under the Elastic License v2 (ELv2) and free to use. You install it as a plugin or MCP server for your AI coding agent; there is no subscription and no paid tier for the core functionality. Which AI coding agents does Context Mode support? 17 platforms: Claude Code, Qwen Code, Gemini CLI, VS Code Copilot, JetBrains Copilot, GitHub Copilot CLI, Cursor, OpenCode, KiloCode, OpenClaw, Codex CLI, Kimi Code, Antigravity, Antigravity CLI, Kiro, Zed and Pi. Hook-capable platforms get ~98% context savings; Antigravity and Zed rely on instruction files at ~60%. How do I install Context Mode in Claude Code? You need Claude Code v1.0.33+. Run /plugin marketplace add mksglu/context-mode then /plugin install context-mode@context-mode, restart Claude Code, and verify with /context-mode:ctx-doctor. All checks should pass. The SessionStart hook then injects routing automatically with no files written to your project. Does Context Mode keep working after context compaction? Yes, that is one of its core features. Every file edit, git operation, task, error and decision is tracked in SQLite and indexed with FTS5. When the conversation compacts, Context Mode retrieves only the relevant memories via BM25 search instead of dumping everything back into context, so the model picks up exactly where it left off. What is the difference between hooks and instruction files in Context Mode? Hooks intercept tool calls programmatically and can block or redirect raw output to the sandbox before it reaches context (~98% savings). Instruction files (AGENTS.md/GEMINI.md copies) only guide the model via prompt text and cannot block anything (~60% savings). Platforms like Zed and Antigravity lack hook support and use the instruction-file mode. How is Context Mode different from just using a bigger context window? A bigger window delays the problem but does not fix the economics: raw tool output still costs tokens on every call, and compaction still wipes working memory. Context Mode changes what enters the window at all (98% less per call) and makes memory survive compaction, so sessions run ~3 hours instead of ~30 minutes regardless of window size. --- Originally published on DevPik.

  8. Context Mode: Cut AI Coding Agent Context Bloat by 98% with Sandboxed MCP & SQLite FTS5 Developers relying on autonomous coding agents—such as Claude Code, Cursor, Gemini CLI, VS Code Copilot, and OpenCode—routinely encounter a hidden bottleneck: context window pollution from raw tool outputs. While frontier models boast 200K to 1M+ token context windows, everyday Model Context Protocol (MCP) and shell tool calls exhaust that capacity at an alarming rate: - A single Playwright snapshot consumes 56 KB. - Fetching 20 GitHub issues consumes 59 KB. - Inspecting one server access log consumes 45 KB. Within 30 minutes of active debugging, over 40% of the context window is filled with raw JSON payloads, log lines, and file dumps. When the coding agent triggers conversation compaction to free up space, it suffers from compaction amnesia—losing track of which files were edited, which edge cases were already ruled out, and what the user originally requested. Context Mode (mksglu/context-mode) is an open-source MCP server and lifecycle hook engine engineered to solve this exact problem. By sandboxing heavy tool outputs, enforcing programmatic analysis, and indexing session history into SQLite FTS5, Context Mode shrinks 315 KB tool payloads down to 5.4 KB—a 98% reduction in context consumption. --- The Four Pillars of Context Mode Context Mode addresses context degradation across four distinct architectural layers: ┌─────────────────────────────────────────────────────────────────┐ │ AI Coding Agent Session │ │ (Claude Code · Cursor · Gemini CLI · Copilot · OpenCode) │ └───────────────┬─────────────────────────────────┬───────────────┘ │ PreToolUse / BeforeTool Hook │ PreCompact Hook ▼ ▼ ┌───────────────────────────────┐ ┌───────────────────────────────┐ │ 1. Sandboxed Execution │ │ 2. SQLite + FTS5 Memory │ │ • ctx_execute / batch │ │ • Tracks edits, git, tasks │ │ • 315 KB raw → 5.4 KB │ │ • BM25 relevance retrieval │ │ • "Think in Code" paradigm │ │ • Zero-amnesia compaction │ └───────────────────────────────┘ └───────────────────────────────┘ 1. Context Saving via Sandboxed Tools (98% Reduction) Standard MCP servers return complete raw responses directly into the conversation transcript. Context Mode provides six specialized sandbox tools (ctx_batch_execute, ctx_execute, ctx_execute_file, ctx_index, ctx_search, and ctx_fetch_and_index) that process heavy outputs outside the prompt buffer, returning only high-signal summaries. 2. Session Continuity with SQLite & FTS5 BM25 Search Every file modification, git operation, task transition, error trace, and user decision is captured in a local SQLite database. When the host IDE or CLI compacts the conversation: - Context Mode does not dump raw history back into the system prompt. - Instead, it indexes session events into SQLite FTS5 and retrieves only the most relevant context on demand using BM25 ranking. - If you start a fresh session without --continue, prior session data is immediately purged so new tasks begin with a clean slate. 3. The "Think in Code" Paradigm One of the most wasteful anti-patterns in agentic coding is using the LLM as a manual data processor—such as calling Read() 47 times to count lines or search for exports across a codebase (consuming ~700 KB of context). Context Mode enforces a Think in Code paradigm across all 17 supported platforms: the LLM writes a compact script to perform the analysis in a sandbox and console.log()s only the result: // Before: 47 × Read() = 700 KB in context window // After: 1 × ctx_execute() = 3.6 KB in context window ctx_execute("javascript", ` const files = fs.readdirSync('src').filter(f => f.endsWith('.ts')); files.forEach(f => console.log(f + ': ' + fs.readFileSync('src/' + f, 'utf8').split('\\n').length + ' lines') ); `); One sandboxed script replaces dozens of sequential tool calls and reduces token usage by over 100x. 4. Routing Enforcement Without Prose Restrictions Research from frontier model teams has shown that aggressive "be concise / no explanations" system prompts degrade coding and reasoning benchmarks. Context Mode's runtime routing block focuses strictly on where data goes (intercepting heavy Bash, Read, Grep, and WebFetch calls), leaving response style, completeness, and formatting entirely up to your model and your project's CLAUDE.md or AGENTS.md. --- Complete Tooling & Diagnostics Suite Context Mode registers 11 MCP tools out of the box—six sandbox execution/indexing tools and five operational meta-tools: | Command / Tool | Purpose | | :--- | :--- | | ctx_execute / ctx_batch_execute | Execute analysis scripts in a sandbox and return compact output | | ctx_index / ctx_fetch_and_index | Index local files, directories, or remote docs into the FTS5 store | | ctx_search | Query indexed documentation and session events via BM25 | | ctx_stats | View per-tool token savings, consumption breakdown, and efficiency ratio | | ctx_doctor | Diagnose runtimes, hook registrations, FTS5 status, and plugin health | | ctx_upgrade | Pull latest updates, rebuild, migrate caches, and repair hooks | | ctx_purge | Permanently clear all indexed content from the local knowledge base | --- Quick Start & Installation Context Mode supports 17 coding platforms, including Claude Code, Gemini CLI, Cursor, VS Code Copilot, JetBrains Copilot, GitHub Copilot CLI, OpenCode, and KiloCode. Option 1: Claude Code (Plugin Marketplace — Fully Automatic) /plugin marketplace add mksglu/context-mode /plugin install context-mode@context-mode Restart Claude Code and verify your installation: /context-mode:ctx-doctor All lifecycle hooks (SessionStart, PreToolUse, PostToolUse, UserPromptSubmit, PreCompact, Stop) and all 11 MCP tools are registered automatically. Option 2: Global CLI Install (Gemini CLI, Copilot, Cursor, OpenCode) npm install -g context-mode For OpenCode (opencode.json) or KiloCode (kilo.json), register the in-process TypeScript plugin with a single line: { "$schema": "https://opencode.ai/config.json", "plugin": ["context-mode"] } For GitHub Copilot CLI, install the full bundle (MCP + hooks + routing skill) in one command: copilot plugin install mksglu/context-mode:configs/copilot-cli --- Conclusion As AI coding agents take on longer, multi-file engineering tasks, raw context window size is no longer enough—context hygiene determines whether an agent stays sharp after an hour of debugging or collapses under tool output bloat. By combining sandboxed code execution, automatic hook interception, and FTS5 BM25 session memory, Context Mode gives developers a drop-in upgrade that cuts token burn by up to 98% while keeping long-running coding sessions rock-solid. - GitHub Repository: mksglu/context-mode - NPM Package: context-mode - License: Elastic License 2.0 (ELv2)

  9. Making MCP Tool Output Boring: A Production Integration with Context Mode Making MCP Tool Output Boring: A Production Integration with Context Mode It's 2:47 AM. Your agent-driven deployment pipeline just burned through 900,000 tokens because npm test dumped 47,000 lines of Jest output into the model context. The MCP server faithfully serialized every byte. Claude Desktop dutifully ingested it. Your agent lost track of the original question halfway through and started hallucinating package names. The deploy failed. You're awake. AI coding agents rarely fail because they cannot invoke a tool. They fail because the tool returns too much information. That distinction matters when integrating mksglu/context-mode into an MCP-based development environment. Context Mode is designed to sandbox tool output, persist session memory, and route work across multiple agent platforms through MCP and hooks. Its most valuable property is not simply "smaller responses." It changes where context reduction happens: before large command output reaches the model context window. I evaluated this architecture around one production failure mode: a repository search or test command emits tens of thousands of lines, the MCP server serializes the entire result, and the agent loses useful context before it can make a decision. The architecture boundary A reliable integration needs four separate responsibilities: 1. Execution runs commands inside a controlled sandbox. 2. Reduction converts raw output into a bounded summary. 3. MCP transport exposes tools and resources over JSON-RPC stdio. 4. Agent configuration starts the process and owns its lifecycle. Context Mode belongs at the reduction and routing boundary. It should not be responsible for every domain-specific command, and an MCP server should not blindly proxy arbitrary subprocess output. The practical data path is: Claude Code or Claude Desktop | | JSON-RPC over stdin/stdout v MCP server | +--> bounded command runner +--> session memory resource +--> context-mode hooks and routing | v sandboxed process output The important invariant is that the model receives a bounded representation, not a compressed-looking copy of an unbounded log. A hardened TypeScript MCP server The following server exposes one bounded command tool and one session resource. It uses @modelcontextprotocol/sdk, keeps stdout reserved for JSON-RPC, and sends diagnostics to stderr. The output limit is deliberately enforced in the server rather than left to the client. // src/server.ts import { execFile } from "node:child_process"; import { promisify } from "node:util"; import { resolve, normalize } from "node:path"; import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import { z } from "zod"; const execFileAsync = promisify(execFile); const server = new McpServer({ name: "bounded-repo-tools", version: "1.0.0", }); const MAX_OUTPUT = 12_000; const SESSION_TTL_MS = 3_600_000; // 1 hour const sessions = new Map<string, { output: string; expires: number }>(); // Prune expired sessions every 5 minutes setInterval(() => { const now = Date.now(); for (const [id, entry] of sessions.entries()) { if (now > entry.expires) sessions.delete(id); } }, 300_000); function validateCwd(cwd: string, allowedRoot: string): string { const normalized = normalize(resolve(cwd)); const root = normalize(resolve(allowedRoot)); if (!normalized.startsWith(root)) { throw new Error(`Path traversal blocked: ${cwd}`); } return normalized; } function bound(text: string): string { if (text.length <= MAX_OUTPUT) return text; return `${text.slice(0, MAX_OUTPUT)}\n...[truncated ${text.length - MAX_OUTPUT} bytes by server]`; } server.registerTool( "run_repo_command", { description: "Run a safe repository command with bounded output.", inputSchema: { command: z.enum(["git-status", "test", "list-files"]), cwd: z.string().min(1), sessionId: z.string().min(1), }, }, async ({ command, cwd, sessionId }) => { const allowedRoot = process.env.REPO_ROOT || process.cwd(); let safeCwd: string; try { safeCwd = validateCwd(cwd, allowedRoot); } catch (err) { return { isError: true, content: [{ type: "text", text: `Security: ${err.message}` }], }; } const commands: Record<string, { file: string; args: string[] }> = { "git-status": { file: "git", args: ["status", "--short"] }, test: { file: "npm", args: ["test", "--", "--runInBand"] }, "list-files": { file: "git", args: ["ls-files"] }, }; try { const spec = commands[command]; const result = await execFileAsync(spec.file, spec.args, { cwd: safeCwd, timeout: 30_000, maxBuffer: 256 * 1024, // Reduced to 256KB to leave headroom shell: false, }); const output = bound(`${result.stdout}${result.stderr}`); sessions.set(sessionId, { output, expires: Date.now() + SESSION_TTL_MS, }); return { content: [{ type: "text", text: output || "(no output)" }], }; } catch (error: any) { let diagnostic = "Command failed"; if (error.code === "ETIMEDOUT") diagnostic = "Timeout after 30s"; else if (error.code === "ERR_CHILD_PROCESS_STDIO_MAXBUFFER") diagnostic = "Output exceeded 256KB"; else if (error.code) diagnostic = `Exit ${error.code}`; else if (error.signal) diagnostic = `Killed by ${error.signal}`; const output = bound( `${diagnostic}\nstdout: ${error.stdout || ""}\nstderr: ${error.stderr || ""}`, ); sessions.set(sessionId, { output, expires: Date.now() + SESSION_TTL_MS, }); return { isError: true, content: [{ type: "text", text: output }], }; } }, ); server.registerResource( "last-session-output", "context://session/{sessionId}", { description: "Read the bounded output retained for a session.", mimeType: "text/plain", }, async (uri, variables) => { const sessionId = String(variables.sessionId); const entry = sessions.get(sessionId); return { contents: [ { uri: uri.href, mimeType: "text/plain", text: entry?.output ?? "No output stored for this session.", }, ], }; }, ); const transport = new StdioServerTransport(); process.on("SIGINT", async () => { console.error("Shutting down gracefully..."); await server.close(); process.exit(0); }); process.on("unhandledRejection", (reason) => { console.error("Unhandled rejection:", reason); process.exit(1); }); await server.connect(transport); console.error("bounded-repo-tools MCP server started"); Install and run it with: npm install @modelcontextprotocol/sdk zod npm install -D typescript tsx @types/node REPO_ROOT=/absolute/path/to/allowed/root npx tsx src/server.ts The command allowlist is intentional. A tutorial that accepts arbitrary shell strings may look convenient, but it creates an injection and permission boundary that becomes difficult to reason about once an agent can invoke it. Claude Desktop stdio configuration Compile or run the server through tsx. The configuration below uses an absolute working directory and does not rely on the GUI process inheriting the same shell environment as your terminal. { "mcpServers": { "bounded-repo-tools": { "command": "/absolute/path/to/node_modules/.bin/tsx", "args": ["/absolute/path/to/project/src/server.ts"], "env": { "NODE_ENV": "production", "REPO_ROOT": "/absolute/path/to/allowed/root" } } } } If this server is used behind Context Mode, place the output reduction before persistence and before any provider routing decision. Persist summaries, identifiers, and failure diagnostics; do not persist every raw test log by default. The repository's session-memory behavior is most useful when stored context remains reusable without becoming another source of context-window pressure. The failure mode that tutorials omit My first integration test used a straightforward console.log(JSON.stringify(result)) pattern. It worked until a malformed subprocess response introduced an unhandled JSON-RPC parsing exception. The process exited silently because stdout and stderr were not being observed by the host. From the agent's perspective, the tool had simply disappeared. Production behavior requires three habits: - Never write logs to stdout; stdio is the protocol channel. - Catch tool-level failures and return isError: true. - Keep process-level diagnostics on stderr and supervise the child process. A second failure appeared after the parser was fixed: large JSON payloads exhausted the model context window even though the MCP call itself succeeded. Bounded output is therefore a correctness feature, not an optimization. For provider comparisons, I would keep the MCP server provider-neutral and benchmark the surrounding agent harness separately. When testing multi-provider fallback through relay gateways like https://b-lost.com/v1, compare token usage with and without server-side reduction. The meaningful metric is not only latency; it is useful agent work completed per context window. Context Mode's architectural advantage is its placement in the path. It can enforce reduction and routing across the agent ecosystem without requiring every individual tool author to understand each provider's context limits. The trade-off is deliberate loss of raw detail. In production, that is usually preferable to preserving every byte and losing the conversation that needed it. The hardest operational question The dilemma I still wrestle with: how do you tune the truncation threshold when different models have wildly different context windows, and the same model can exhaust its budget mid-conversation even with bounded tools? A static 12KB limit works until an agent needs to cross-reference three bounded outputs in a single turn and suddenly you're back in quota hell. Do you make truncation adaptive based on remaining context budget? Do you let the agent request verbosity levels? Do you accept that some tasks simply require multiple turns and teach agents to paginate their own investigations? How are you handling this in production?

  10. YouTube · · YouTube description · Solostack · mksglu/context-mode

    이번 주 개발자라면 봐야 할 오픈소스 Top 10 +@ 총정리 | GitHub 트렌딩 (10월 3주) 이번 주(10/14~10/21) GitHub 트렌딩 주간 순위 Top 10과 순위 밖 주목 저장소 3개를, 레포마다 무엇을 하는지·이번 주 바뀐 것·쓸 때 주의할 점까지 정리했어요. 순위는 GitHub Trending(weekly) 페이지 순서 그대로예요(2026-10-21 06:00 KST 수집). 별 수는 수집 시점 값이에요. ▶ 챕터 0:00 오프닝 0:20 10위 android/skills 0:54 9위 ruflo 1:34 8위 VoiceStudio 2:11 7위 HyperFrames 2:46 6위 scientific-agent-skills 3:22 5위 Ghidra 3:55 4위 context-mode 4:33 3위 claude-plugins-official 5:15 2위 ai-job-search 6:01 번외 ① OpenCode 7:12 번외 ② vLLM 7:50 번외 ③ cursor/plugins 8:18 1위 REA 9:22 이번 주 확인할 것 ▶ Top 10 10위 android/skills — Google Android 팀 공식 에이전트 스킬 30개. 새 스킬 4개(LiteRT 온디바이스 AI·Compose 성능 등), Claude Code 플러그인 설치 9위 ruvnet/ruflo — Claude Code·Codex 위 다중 에이전트 도구(옛 claude-flow). v3.57.0: Codex 기본 권한 danger-full-access → workspace-write·on-request, 경로 우회(CWE-22) 수정, 벡터 검색 실제 연결 8위 debpalash/VoiceStudio — 로컬 음성 복제·더빙 앱(AGPL-3.0). 모바일 원격 앱 미리보기(소스 빌드), 데이터·모델 저장 위치 변경. 기본 음성 모델 상업 이용 조건은 별도 확인 7위 heygen-com/hyperframes — HTML로 쓰고 영상으로 렌더. 릴리스 27번: hyperframes audio(음량·무음 측정), 720p·480p 렌더, 비영어 받아쓰기 수정. ⚠ v0.8.164부터 웹사이트 캡처가 HTTPS_PROXY를 쓰지 않음(프록시만 쓰는 회사망은 확인) 6위 K-Dense-AI/scientific-agent-skills — 연구용 스킬 177개, 데이터베이스 80개 조회법, 스킬별 워크플로 도해. README: 한꺼번에 전부 설치하지 말 것 5위 NationalSecurityAgency/ghidra — NSA 연구국의 무료 리버스 엔지니어링 도구(Apache-2.0). Ghidra Server 인증서 검사 수정, 다음 버전 12.2는 JDK 25 필요 4위 mksglu/context-mode — 도구 출력을 따로 처리해 컨텍스트를 아끼는 플러그인. "315KB→5.4KB, 98%"는 개발사 발표. Elastic License 2.0(사내 사용 가능, 호스팅 서비스 재제공 불가) 3위 anthropics/claude-plugins-official — Claude Code 공식 플러그인 목록(315개). security-guidance: 커밋 리뷰어 읽기 전용, Claude Code 자격증명 파일 검토 제외. 외부 플러그인 내용은 Anthropic이 검증하지 않음(README) 2위 MadsLorentzen/ai-job-search — Claude Code 구직 도구. v1.7.3: 외부 업로드·비밀 파일 읽기 deny, git push ask, 공고 읽는 서브에이전트 읽기 전용, 숨은 지시문 필터. 포크는 항상 공개 → 개인용은 private 저장소 1위 morluto/rea — 코딩 에이전트를 Ghidra·Hopper·IDA에 연결하는 리버스 엔지니어링 도구(MIT). 6.5.0~6.7.0: 패킷·SQLite·WASM 분석, BREAKING 7건(버전 고정 권장). 공식 출처(morluto/rea, npm rea-agents)만 사용. ⚠ 타사 소프트웨어 분석은 약관(EULA)·저작권 문제. Claude Code·Codex·Cursor가 이런 작업을 막는다는 사용자 보고(REA Discussion #2095·#2027) ▶ 번외(순위 밖) anomalyco/opencode — 모델 회사에 묶이지 않는 오픈소스 코딩 에이전트. OpenCode 자체가 하네스(도구·반복은 내 컴퓨터, 모델 API로는 추론만). 2.0 발표, 기간 한정 무료 모델(DeepSeek V4.1 Flash Free 등, Zen 게이트웨이 경유). ⚠ 10/17 Console 보안 사고 → 외부 API 키 교체, 되도록 격리된 환경에서 사용. 기본 설정은 도구 승인 없음 vllm-project/vllm — 공개 언어 모델을 OpenAI 호환 API로 띄우는 엔진. Ollama와 비슷하지만 서빙 처리량(연속 배칭)에 강해 실제 서비스용. v0.32.0: 기본 CORS 해제(--allowed-origins), Python 3.11 이상 cursor/plugins(주간 12위) — 플러그인 101 → 112개(업무 SaaS 연동, 다수 쓰기 권한), pstack을 Claude Code에서도 설치 ▶ 끄는 방법·확인할 설정 - hyperframes: HYPERFRAMES_NO_TELEMETRY=1 - vLLM: VLLM_NO_USAGE_STATS=1 또는 DO_NOT_TRACK=1 - ruflo 3.57.0 이전 init: .codex/config.toml의 danger-full-access 확인 - security-guidance LLM 리뷰 끄기: ENABLE_CODE_SECURITY_REVIEW=0 - Android CLI 사용 통계: 명령마다 --no-metrics ▶ 관련 영상 - 이번 주 트렌딩 쇼츠(Top 5 요약): youtu.be - REA 직접 써 본 쇼츠: youtu.be - REA 실험 롱폼: youtu.be ▶ 링크 morluto/rea MadsLorentzen/ai-job-search anthropics/claude-plugins-official mksglu/context-mode NationalSecurityAgency/ghidra K-Dense-AI/scientific-agent-skills heygen-com/hyperframes debpalash/VoiceStudio ruvnet/ruflo android/skills anomalyco/opencode vllm-project/vllm cursor/plugins ※ 내레이션은 AI 보이스(ElevenLabs)예요. 실화면이 없는 부분은 공식 문서에 적힌 동작을 그린 원리 모션이에요. #GitHub트렌딩 #오픈소스 #개발자 #코딩에이전트 #ClaudeCode #SoloStack [en] This Week's Must-See Open Source: GitHub Trending Top 10 + Extras (Oct, Week 3) A full walkthrough of this week's GitHub Trending (weekly) Top 10 in page order (collected 2026-10-21 06:00 KST), plus three notable repos outside the chart — what each does, what changed this week, and what to watch out for. 10 android/skills · 9 ruflo · 8 VoiceStudio · 7 HyperFrames · 6 scientific-agent-skills · 5 Ghidra · 4 context-mode · 3 claude-plugins-official · 2 ai-job-search · 1 REA Extras: OpenCode (the harness runs locally, the model API only provides inference; Console security incident — rotate stored keys), vLLM (like Ollama but built for high-throughput serving; 0.32 restricts default CORS), cursor/plugins. Narration is an AI voice (ElevenLabs).

    281 likes · 7 comments · 35,709 views

Achievements

Awards earned by the repositories mksglu owns. Select an award to embed its badge.

No awards yet

Repositories earn awards by reaching the top three in a completed trending day or week.

A repository earns an award for finishing first, second or third in a completed trending day or week, ranked by new stars, new forks or pull request authors. Awards follow a repository through renames and transfers and count toward its current owner. Weeks run Monday to Sunday, UTC.