lean-context

lean-context is a Claude Code mod by mercynet that measures and, once approved, strips configured sections of the project instruction file from the Claude Code context while no spec is active for the branch.

Updated 2026-10-09

What is lean-context?

lean-context is a Claude Code mod by mercynet that measures and, once approved, strips configured sections of the project instruction file from the Claude Code context while no spec is active for the branch. It is listed under Context & memory and has no public popularity data yet.

TypeClaude code mod
Authormercynet
Repositorymercynet/my-claude-mods
Popularityno public popularity data yet
CategoryContext & memory
SecurityReview before installing (72/100)
Rank#3,974 of 5,272 Claude Code mods; #375 in Context & memory
Last commit2026-10-09
Hooks8 events
Seescompaction, every prompt, the system prompt
Draws onnothing

Is lean-context safe to install?

lean-context scores 72/100 on the MCPMods security check: Review before installing. Things to review: starts processes outside the sandbox; watches every prompt or event. It passed 5 of 8 checks.

Mod footprints come from claude plugin validate, which lists every event a mod hooks and every API call it makes without running it.

CheckResult
No network accessPass
Starts processes outside the sandboxReview
Writes no files or configPass
Doesn't read environment variablesPass
Watches every prompt or eventReview
Doesn't drive ClaudePass
Passes claude plugin validatePass
No license detectedNote

API calls in its code

CallWhat it means
$.clock.now
$.command.register
$.fs.existsreads files
$.fs.statreads files
$.process.runruns processes
$.session.id
$.session.root
$.session.turns
$.session.usage
$.state.get
$.state.set
$.store.deletekeeps its own state
$.store.getkeeps its own state
$.store.setkeeps its own state
$.ui.logdraws interface
$.ui.statusdraws interface
$.ui.toastdraws interface

How do I install lean-context?

  1. Check your Claude Code version. Mods need Claude Code 2.1.287 or later and are on by default.
    claude --version
  2. Read its footprint. This lists every event it hooks and every API call it makes, without running it.
    git clone https://github.com/mercynet/my-claude-mods
    claude plugin validate ./my-claude-mods/lean-context
  3. Install it. Run this in your terminal, then /reload-plugins in an open session.
    claude plugin marketplace add mercynet/my-claude-mods && claude plugin install lean-context@local-mods

Or ask Claude to set it up

Paste this into Claude Code and it installs lean-context for you:

Install the "lean-context" Claude Code mod from https://github.com/mercynet/my-claude-mods/tree/main/lean-context. Run claude plugin validate on it first and show me what it can access before you enable it.

More from mercynet/my-claude-mods

This repository has 6 Claude Code mods on MCPMods.

  • context-forecast: Forecast of the context window with a clear-or-compact score, usage limits, cross-session calibration and guided compact (Low risk)
  • env-doctor: Read-only preflight of a dev environment at session start: stopped compose services, missing node_modules for MCP server (Low risk)
  • graph-sync: Keeps a code knowledge graph fresh: after code edits, runs an AST-only update command in the background when the turn en (Low risk)
  • session-banner: Shows a plain-text logo with a gradient and one shimmer sweep above the prompt when a session starts, until the first pr (Review before installing)
  • spec-band: A band above the prompt showing the active spec of the current branch: task progress, STATE.md age and phase, and a warn (Review before installing)