By mhardist
Work all day in Claude Code without context rot. Hooks monitor context pressure and nudge delegation; skills consolidate session knowledge into file-based memory; you /clear with confidence because everything important is already saved.
Use when performing memory consolidation — orienting on existing memories, gathering recent signal from logs and transcripts, merging updates into topic files, and pruning the index. Triggers on "dream", "consolidate memories", "memory cleanup", or end-of-day reflection passes.
Use when the user asks how a session went or how we collaborated — "How did we collaborate in this session?", highlights/lowlights, what could Claude or the user do better/faster, or which skills/agents/hooks/tools/MCP would improve our work. Triggers on end-of-session reflection and retrospective requests.
Use when context is running low, "save context", "preserve context", "context checkpoint", "prepare for context clear", or when conversation exceeds ~50 messages/tool calls. Auto-preserves session knowledge before /clear. Also saves intermediate data results (metrics, file paths, environment context) for multi-phase analytical workflows.
Matches all tools
Hooks run on every tool call, not just specific ones
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
Work all day in Claude Code without context rot — and make the harness better every session.
Tired of compacting? Start with The Shift — why long sessions degrade, why compaction is the wrong fix, and the workbench-not-filing-cabinet model that makes the problem disappear. The rest of this repo is the machinery; that page is the mental model that makes the machinery make sense.
This is a working harness built around two loops:
/clear with confidence — clear, not compact — because everything important is already saved. work → hooks nudge delegation & watch context %
→ memory-capture (40%) / context-monitor (50%) prompt consolidation
→ /dream consolidates memories, /clear wipes the window
→ next session recalls from memory and starts clean
↘ session-retrospective → feedback memories / new hooks / new rules
One month of real daily use (108 main sessions, ~3.6/day, mined from actual transcripts):
/plugin marketplace add mhardist/claude-context-harness
/plugin install context-discipline@claude-context-harness
/plugin install working-style@claude-context-harness
Plugin installs are purely additive. The skills, hooks, and commands live
inside the plugin's own directory — your existing CLAUDE.md, settings.json,
hooks, and skills are not modified. Don't like it? /plugin uninstall removes
it cleanly. The hooks start nudging immediately; that's them working.
The files in templates/ are merge sources, not
replacements. Never copy them over your existing files — you'd silently
erase your own accumulated configuration. Back up first, then open the
template side-by-side and pull in the sections you want:
# Back up before touching anything (yes, we practice what we preach)
cp ~/.claude/CLAUDE.md ~/.claude/CLAUDE.md.backup_$(date +%Y%m%d) 2>/dev/null
cp ~/.claude/settings.json ~/.claude/settings.json.backup_$(date +%Y%m%d) 2>/dev/null
CLAUDE.md.example — append or weave sections into your existing ~/.claude/CLAUDE.md (or a project CLAUDE.md): the context-discipline rules, local-knowledge-first pattern, CLI-first preferences, learn-from-mistakes instructions. If you don't have a CLAUDE.md yet, copying the whole file is fine.settings.json.example — not a complete settings file. Merge individual keys (statusLine, permissions.deny, the extra hooks entries) into your existing settings.json by hand or with jq. If you already have hooks configured, append to the matching event arrays — don't replace them.mcp.json.example — reference for the env-var-placeholder pattern and the activate-on-demand philosophy; adapt to your servers rather than copying.If you only do Step 1, you still get the full hook + skill machinery. Step 2 is where the standing instructions and statusline come from — worth doing, carefully.
context-discipline (the hero)npx claudepluginhub mhardist/claude-context-harness --plugin context-disciplineSkills that shape how work gets done: turn vague ideas into explicit prompts (prompt-architect), deliberate important decisions from seven perspectives (seven-advisors), and activate MCP servers on demand to keep context lean (mcp-guide + /mcp-activate-* commands).
Ultra-compressed communication mode. Cuts ~75% of tokens while keeping full technical accuracy by speaking like a caveman.
Memory compression system for Claude Code - persist context across sessions
Multi-model consensus engine integrating OpenAI Codex CLI, Gemini CLI, and Claude CLI for collaborative code review and problem-solving.
Curate auto-memory, promote learnings to CLAUDE.md and rules, extract proven patterns into reusable skills.