# script: context-load **Location:** `scripts/context-load` **Symlinked to:** `~/sbin/context-load` ## Purpose Gathers project context for a Claude Code session by walking from cwd upward, collecting key index files, and outputting structured text suitable for `--append-system-prompt`. ## What it loads (in order) 1. **Paths** to every `CLAUDE.md` found walking up from cwd (not contents — Claude Code loads those natively via `claudeMd`), annotated with `description:` from sibling `ABOUT.md` if present 2. **Paths** to every project `CLAUDE.md` found under each CLAUDE.md directory (depth 2-4) — for project discovery, also annotated with ABOUT.md descriptions 3. Every `CONTEXT.md` found walking up (top-down) — full contents 4. Every `MEMORY.md` found walking up (top-down) — full contents 5. Every `BESTPRACTICES.md` found walking up (top-down) — full contents ## What it does NOT load - CLAUDE.md contents (loaded natively by Claude Code) - Directory trees (Claude can run `tree` on demand for fresh results) - README.md files (human-oriented, read on demand) - git-status-report (moved to `/housekeeping` skill) ## How it works - Uses `discover_upward()` to walk from `$PWD` to `/`, collecting directories - Resolves symlinks via `readlink -f` to deduplicate (e.g., `~/dev/claude/CLAUDE.md` symlink to `claude-foundations/CLAUDE.md`) - Emits each file with a structured header (`=== FILE: ... ===`) for easy parsing - Uses `find` to discover project CLAUDE.md files under each hierarchy directory ## Gotchas - Only walks **upward** from cwd for index files — but scans **downward** for project CLAUDE.md discovery. Launch from within a project directory to get that project's context. - Index files (MEMORY.md, CONTEXT.md, BESTPRACTICES.md) should be thin indexes, not large documents, since they're injected into the system prompt.