| name | description |
|---|---|
ctx |
Show markdown files read in current session |
Show markdown file read coverage in current session.
--all: Show all markdown files in repo (unread files show 0%). Uses--depth 3and--max 30by default--depth N: Directory traversal depth (only with--all, default: 3)--max N: Max files to display (only with--all, default: 30)
/ctx # Only show read files
/ctx --all # Show all md files (depth 3, max 30)
/ctx --all --depth 5 --max 50 # Custom depth and max
Parse user arguments:
show_all: false (set true if--allpresent)max_depth: 3 (only used whenshow_all= true)max_files: 30 (only used whenshow_all= true)
- Get the current working directory (e.g.,
/Users/kk/Documents/main/workspace) - Convert to Claude projects path: replace
/with-, prepend-- Example:
/Users/kk/Documents/main/workspaceβ-Users-kk-Documents-main-workspace
- Example:
- Session directory:
~/.claude/projects/{converted-path}/ - Find the current session JSONL file:
- List all
.jsonlfiles sorted by modification time (newest first) - The current session is typically the most recently modified file
- List all
JSONL line structure:
{message: {content: [{type: "tool_use", name: "Read", input: {file_path, offset?, limit?}}]}}- Skip lines without tool_use content
- Parse the JSONL file and extract all
Readtool calls wherefile_pathends with.md - For each markdown file read:
- Get the file path
- Get offset and limit (if specified)
- If no offset: default to line 1
- If no limit: treat as full file (get actual line count from filesystem)
- Calculate which lines were read
- If a file was read multiple times with different ranges, merge them.
Default mode (show_all = false):
- Only show files that were read in Step 3
All mode (show_all = true):
- Scan repo root for all
.mdfiles up tomax_depthlevels - Exclude:
node_modules/,.git/,vendor/,.cache/,.debug/,.log/,venv/,__pycache__/ - Mark unread files as 0% coverage
- Limit to
max_filestotal (keep all read files first, fill rest with unread)
π Markdown Files Read (3/15 files)
βββββββββββββββββββββββββββββββββββ
workspace/
βββ CLAUDE.md [ββββββββ] L1-139/139 (100%)
βββ README.md [ββββββββ] L1-84/84 (100%)
βββ docs/
β βββ guide.md [ββββββββ] - (0%)
β βββ api.md [ββββββββ] L1-20/100 (20%)
βββ commands/
βββ ctx.md [ββββββββ] L1-60/60 (100%)
Where:
- Title:
(read/total files)in --all mode,(N files)in default mode [ββββββββ]= 100% read[ββββββββ]= 0% (unread, only in --all mode)[ββββββββ]= partial read, heatmap shows actual line positions-= no line info (unread file)- Line range shows min-max of all read lines (e.g., read L1-10 + L50-60 β
L1-60)
Heatmap calculation:
- Divide file into 8 equal segments (by line count)
- Each segment:
βif any line in that range was read,βotherwise - Example: 80-line file read L1-20 β first 2 segments covered β
[ββββββββ]
- Keep output concise - this goes into context
- Tree structure groups files by directory
- Read files always appear before unread files within same directory
- Paths are relative to repo root