
Security News
/Research
Fake Corepack Site Distributes Infostealer and Proxyware to Developers
A fake corepack.org site is impersonating the Node.js tool and delivers an infostealer and proxyware to developers who download it.
pi-read-map
Advanced tools

This pi extension augments the built-in read tool with structural file maps. When you open a file larger than 2,000 lines or 50 KB, the extension generates a map of every symbol and its line range. You navigate large codebases precisely instead of scanning sequentially.
The problem: pi sees only the first 2,000 lines of a 50,000-line source file. Ask "how does the type checker handle unions?" and the model either hallucinates or burns tokens re-reading until it finds the answer.
The trade-off: pi-read-map spends ~2,000–10,000 tokens upfront to generate a map of the entire file. The extension triggers only for files exceeding the truncation limit (>2,000 lines and >50 KB); smaller files pass through unchanged.
The payoff: The map stays in context. Ask "show me the merge implementation," "compare error handling in these three functions," or "what symbols exist after line 40,000?" without re-reading. The investment pays for itself when you analyze a large file beyond a single summary.
See pi-read-map in action analyzing the TypeScript compiler's 54,000-line type checker:
https://github.com/user-attachments/assets/4408f37b-b669-453f-a588-336a5332ae90
# Global install
pi install https://github.com/Whamp/pi-read-map
# Global install
pi install npm:pi-read-map
# Project-local install
pi install npm:pi-read-map -l
# Clone and install globally
pi install ./path/to/pi-read-map
# Or project-local
pi install ./path/to/pi-read-map -l
Try the extension without installing:
pi -e https://github.com/Whamp/pi-read-map
pi -e npm:pi-read-map
pi -e ./path/to/pi-read-map
Start pi or run /reload. Then read a large file:
read path/to/large-file.ts
Output includes the truncated content followed by:
[Truncated: showing first 2000 lines of 10,247 (50 KB of 412 KB)]
───────────────────────────────────────
File Map: path/to/large-file.ts
10,247 lines │ 412 KB │ TypeScript
───────────────────────────────────────
class ProcessorConfig: [18-32]
class BatchProcessor: [34-890]
constructor(config: ProcessorConfig): [40-65]
async run(items: List<Item>): [67-180]
...
───────────────────────────────────────
Use read(path, offset=LINE, limit=N) for targeted reads.
───────────────────────────────────────
npm run typecheck # Type checking
npm run lint # Linting with oxlint
npm run lint:fix # Auto-fix lint issues
npm run format # Format with oxfmt
npm run format:check # Check formatting
npm run validate # Run all checks
npm run test # Unit tests
npm run test:watch # Watch mode
npm run test:integration # Integration tests
npm run test:e2e # End-to-end tests
npm run bench # Benchmarks
src/
├── index.ts # Extension entry: tool registration, caching, messages
├── mapper.ts # Dispatcher: routes files to language mappers
├── formatter.ts # Budget-aware formatting with detail reduction
├── language-detect.ts # Maps file extensions to languages
├── types.ts # Shared interfaces (FileMap, FileSymbol)
├── enums.ts # SymbolKind, DetailLevel
├── constants.ts # Thresholds (2,000 lines, 50 KB, 20 KB budget)
└── mappers/ # Language-specific parsers
├── typescript.ts # ts-morph for TS/JS
├── python.ts # Python AST via subprocess
├── go.ts # Go AST via subprocess
├── rust.ts # tree-sitter
├── cpp.ts # tree-sitter for C/C++
├── clojure.ts # tree-sitter for Clojure/ClojureScript/EDN
├── c.ts # Regex patterns
├── sql.ts # Regex
├── json.ts # jq subprocess
├── jsonl.ts # Streaming parser
├── yaml.ts # Regex
├── toml.ts # Regex
├── csv.ts # In-process parser
├── markdown.ts # Regex
├── ctags.ts # universal-ctags fallback
└── fallback.ts # Grep-based final fallback
scripts/
├── python_outline.py # Python AST extraction
└── go_outline.go # Go AST extraction (compiles on first use)
tests/
├── unit/ # Mapper and utility tests
├── integration/ # Dispatcher, caching, budget enforcement
├── e2e/ # Real pi sessions via tmux
└── fixtures/ # Sample files per language
The extension intercepts read calls and decides:
file-map message after tool_resultnpm packages:
ts-morph - TypeScript AST analysistree-sitter - Parser frameworktree-sitter-cpp - C/C++ parsingtree-sitter-rust - Rust parsingtree-sitter-clojure - Clojure parsingSystem tools (optional):
python3 - Python mappergo - Go mapperjq - JSON mapperuniversal-ctags - Language fallbackThis project was inspired by and built upon the foundation of codemap by kcosr. Check out the original project for the ideas that made this possible.
MIT
FAQs
Pi extension that adds structural file maps for large files
The npm package pi-read-map receives a total of 133 weekly downloads. As such, pi-read-map popularity was classified as not popular.
We found that pi-read-map demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
/Research
A fake corepack.org site is impersonating the Node.js tool and delivers an infostealer and proxyware to developers who download it.

Research
/Security News
A large-scale campaign abused GitHub Actions in compromised repositories to exploit CVE-2026-41940 in cPanel and WHM and steal server credentials.

Security News
Five frontier LLMs generated the same nonexistent package names, leaving 53 available for potential slopsquatting across PyPI and npm.