---
repo: "mohan-n-swamy/claude-clean-context"
title: "claude-clean-context — Context-Window Hygiene & Memory Blueprint"
license: "MIT"
keywords: [claude-code, context-engineering, llm-optimization, token-optimization, ai-agents, claude-skills, developer-tools, python, cli]
capabilities:
  - "A context-window hygiene architecture and implementation blueprint that keeps always-loaded `CLAUDE.md` / `AGENTS.md` instructions compact while routing project memory and on-demand skills cleanly."
  - "Complete human and machine documentation pack (`AI-README.md`, `llms.txt`, `AGENTS.md`, `PRD`, `PR-FAQ`, `HLD`, `LLD`, `RESEARCH-2026`)."
when_to_use:
  - "A context-window hygiene architecture and implementation blueprint that keeps always-loaded `CLAUDE.md` / `AGENTS.md` instructions compact while routing project memory and on-demand skills cleanly."
  - "Stuffing every past lesson, schema, and runbook into `CLAUDE.md` consumes 25K+ tokens on turn one and degrades instruction following across every prompt. `claude-clean-context` separates tiny standing rules from on-demand skills and indexed semantic retrieval."
inputs_required:
  - "LOG_LEVEL: Optional diagnostic verbosity control"
quickstart:
  - "ls doctrine/ blueprint/ docs/"
  - "cat doctrine/CLAUDE.md.template"
---

# claude-clean-context — Context-Window Hygiene & Memory Blueprint — Machine-Readable Agent Guide

A context-window hygiene architecture and implementation blueprint that keeps always-loaded `CLAUDE.md` / `AGENTS.md` instructions compact while routing project memory and on-demand skills cleanly.

<problem_patterns>
Stuffing every past lesson, schema, and runbook into `CLAUDE.md` consumes 25K+ tokens on turn one and degrades instruction following across every prompt. `claude-clean-context` separates tiny standing rules from on-demand skills and indexed semantic retrieval.
</problem_patterns>

<architecture_map>
Key modules and entry points in this repository:
  - `README.md & AI-README.md`: Human quickstart and machine-readable adaptation guide
  - `docs/`: PRD, Working-Backwards PR-FAQ, HLD, LLD, and 2026 research notes
</architecture_map>

<inputs_and_configuration>
Every organization-specific value enters through `.env` (copied from `.env.example`) or external adapter files. No source edit is needed to change organization names, endpoints, database URLs, webhook secrets, or thresholds.
</inputs_and_configuration>

<adaptation_playbook>
When a human asks an AI coding agent to deploy or adapt `claude-clean-context` into their stack:
  1. Follow the quickstart in `README.md` (`ls doctrine/ blueprint/ docs/`).
  2. Point your AI coding assistant at `AI-README.md` to tailor configuration to your workspace.
</adaptation_playbook>

<reference_docs>
- Product Requirements: `docs/PRD.md`
- Working-Backwards PR-FAQ: `docs/PR-FAQ.md`
- High-Level Architecture: `docs/HLD.md`
- Low-Level Interfaces & Runbook: `docs/LLD.md`
- Coding Agent Rules: `AGENTS.md`
</reference_docs>
