Creates MEMORY.md index and 10 memory files documenting: - Scripts: context-load, start-claude, install-hooks, setup-formatters, git-status-report - Skills: /log, /reflect-logs, /reflect, /distill-best-practices, /linter Each file covers purpose, usage, how it works, and gotchas. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1.4 KiB
1.4 KiB
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)
- Every
CLAUDE.mdfound walking up from cwd (top-down order) + directory tree (depth 3) from each - Every
CONTEXT.mdfound walking up (top-down) - Every
MEMORY.mdfound walking up (top-down) - Every
BESTPRACTICES.mdfound walking up (top-down) - All
*.mdfiles in cwd (deduped against already-emitted files) git-status-reportoutput from the highest-level CLAUDE.md directory
How it works
- Uses
discover_upward()to walk from$PWDto/, collecting directories - Resolves symlinks via
readlink -fto deduplicate (e.g.,~/dev/claude/CLAUDE.mdsymlink toclaude-foundations/CLAUDE.md) - Emits each file with a structured header (
=== FILE: ... ===) for easy parsing - Tree output uses
treewith fallback tofind - ANSI codes are stripped from git-status-report output
Gotchas
- Only walks upward from cwd — does not descend into subdirectories. 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.