DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to add Context Mode to Gemini CLI with one settings file with Context Mode

Install the npm package and register the MCP server and four hooks in settings.json.

Short answer: Run npm install -g context-mode; then add the mcpServers and hooks block from the README to ~/.gemini/settings.json; Restart Gemini CLI. All steps.

Who it is forA developer who uses Gemini CLI on large repos and wants the same context savings without the Claude Code plugin.

The problemGemini CLI tool output can fill the context window quickly, and the default setup has no sandbox for it.

The outcomeThe MCP server shows as connected and the BeforeTool, AfterTool, PreCompress, and SessionStart hooks route large output through Context Mode.

What you need first

  • Claude Code v1.0.33+ for the plugin install, or Node.js >= 22.5 (or Bun) for the Gemini CLI setup
  • An existing AI coding agent session in a project you want to work on

Steps

  1. Run npm install -g context-mode.
  2. Add the mcpServers and hooks block from the README to ~/.gemini/settings.json.
  3. Restart Gemini CLI.
  4. Run /mcp list and confirm context-mode: ... - Connected.
  5. Optionally copy configs/gemini-cli/GEMINI.md into your project as ./GEMINI.md for routing instructions. (inferred, check the README)

Prompt for your agent

Install context-mode globally with npm, add the Gemini CLI settings from the context-mode README to ~/.gemini/settings.json, then run /mcp list in Gemini CLI. Report whether context-mode shows as Connected and list the four hooks that are registered.

Caveat. The README says Gemini CLI needs Node.js >= 22.5 or Bun, so check your runtime before editing the settings file.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for mksglu/context-mode and "Add Context Mode to Gemini CLI with one settings file"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer