README
ΒΆ
peekm
The markdown viewer built for AI-assisted development

Watch your AI write documentation live. See which session created every file. Get toast notifications the instant something changes β no hunting through file trees, no manual refresh, no breaking your flow.
peekm README.md # Install, run, done.
Works beautifully for everyone else, too β zero-config live preview with GitHub styling, directory browsing, and dark/light themes.
Perfect for:
- π€ AI coding workflows β See which AI session created or modified each file, live as it happens
- π€ Multi-session projects β Track which AI conversation touched which files
- π Documentation, writing, PR reviews β Centered layout, live reload, distraction-free
Quick Start β’ AI Session Tracking β’ Comparison
Quick Start
# Install
brew install razvandimescu/tap/peekm
# Start viewing
peekm .
That's it. No config, no runtime dependencies.
Optional: Connect to Claude Code for AI session tracking:
peekm setup claude-code # One-time setup
AI session badges now appear automatically when Claude Code creates or modifies files. Learn more β
AI Session Tracking
peekm automatically tracks which AI session created or modified each file. This works out of the box β the tracking endpoint is always active.
One-time setup to connect your AI coding assistant:
peekm setup claude-code # Configure Claude Code integration
peekm setup claude-code --port 8080 # Use custom port
peekm setup claude-code --remove # Remove integration
The setup command:
- Creates the hook script (
~/.claude/peekm-hook.sh) - Merges PostToolUse hooks into Claude Code's
settings.json - Is idempotent β safe to run multiple times
- Is non-destructive β preserves your existing settings
What you get:
- Toast notifications when AI creates or modifies markdown files
- Session badges showing which AI session touched each file
- Info panel with session ID, operation type, permission mode, and timestamp
- Notification history (bell icon) with the last 10 file changes
peekm vs. The World
| Feature | Glow | grip | VS Code | peekm |
|---|---|---|---|---|
| Best for | Terminal purists | GitHub preview | VS Code users | AI-assisted development |
| Live reload | β Static | β Manual refresh | β | β SSE-based |
| AI session tracking | β | β | β | β Built-in |
| Sidebar + zen mode | β | β | β Persistent only | β Cmd/Ctrl+B toggle |
| Comfortable layout | β Terminal only | β Full-width | β Splits editor | β Centered 900px |
| Directory browser | β TUI list | β Single file | β File explorer | β Web UI tree |
| Works offline | β | β GitHub API | β | β |
| Zero dependencies | β Single binary | β Python runtime | β Needs VS Code | β Single binary |
| Startup time | Fast | ~2s | Editor launch | < 100ms |
Features
VS Code-Style Navigation
Navigate your documentation with a familiar sidebar. Need full-width focus? Hit Cmd/Ctrl+B to hide the sidebar.
- 280px tree view β collapsible folders with indent-based hierarchy
- Smart defaults β auto-opens README.md or most recent file
- Independent scrolling β sidebar and content scroll separately
- Current file highlighting β see your location in the project
- Multi-tab support β Cmd/Ctrl+Click opens files in new tabs
Zero Friction
- Single binary β download and run, nothing to install
- No configuration β works perfectly out of the box
- Instant startup β under 100ms to first render
Live Workflow
- Auto-reload on save β see changes instantly via Server-Sent Events
- Event replay β reconnecting clients catch up on missed events
- Directory navigation β console-like Ξ» button to navigate between directories
- Theme switching β Light/Dark/Auto with localStorage persistence
- HTML export β download self-contained HTML for sharing
- Live editing β edit markdown files directly in browser
Production-Ready
- Secure β whitelist-based file access, CSRF protection, symlink validation, path traversal protection, $HOME boundary enforcement
- Fast β ~8MB memory footprint, embedded resources
- Cross-platform β works on macOS, Linux, and Windows
- GitHub-Flavored Markdown β full GFM support with syntax highlighting
- Graceful shutdown β clean resource cleanup on SIGINT/SIGTERM
Installation
Option 1: Quick Install
# macOS/Linux
curl -L https://github.com/razvandimescu/peekm/releases/latest/download/peekm_$(uname -s)_$(uname -m).tar.gz | tar xz && sudo mv peekm /usr/local/bin/
Option 2: Homebrew
brew install razvandimescu/tap/peekm
Option 3: Go Install
go install github.com/razvandimescu/peekm@latest
Option 4: Download Binary
Download from the releases page for your platform (macOS, Linux, Windows).
Usage
# View a specific file (opens in unified layout with sidebar)
peekm README.md
# Browse a directory
peekm .
peekm ../docs
# Custom port
peekm -port 8080 .
# Don't auto-open browser
peekm -browser=false .
# Setup AI session tracking
peekm setup claude-code
Options
| Flag | Default | Description |
|---|---|---|
-port |
6419 |
Port to serve on |
-browser |
true |
Automatically open browser |
-version |
false |
Show version information |
-show-ignored |
false |
Show all excluded directories and exit |
-no-ai-tracking |
false |
Disable AI session tracking endpoint |
Subcommands
| Command | Description |
|---|---|
setup claude-code |
Configure Claude Code integration (one-time) |
setup claude-code --remove |
Remove Claude Code integration |
setup claude-code --port PORT |
Configure with custom port |
Ignoring Directories
peekm automatically excludes common directories:
.*(hidden directories like.git,.vscodeβ except.claude)node_modules,vendor,dist,venv,env,virtualenv
To add custom exclusions, create .peekmignore in your project root:
# .peekmignore - Project-specific exclusions
target
_site
out
*.tmp
*.cache
Syntax: One pattern per line. Simple paths, wildcards (*.tmp, test_*), and comments (#).
peekm --show-ignored # See all exclusions
peekm --show-ignored ~/myapp # Check exclusions for a directory
When You Need peekm
AI-Assisted Development
peekm .
# Ask Claude Code: "Create API docs in docs/api.md"
# β Toast notification appears instantly
# β Click to view the new file
# β Watch live as AI writes
Onboarding to a New Project
git clone github.com/awesome/project && cd project
peekm docs/ # Browse all documentation with a visual tree
Writing Documentation
peekm README.md # Edit in your favorite editor, preview updates instantly
Code Review
git checkout feature-branch
peekm CHANGELOG.md # Beautiful rendering, auto-reloads on branch switch
How It Works
- Parse β Converts markdown to HTML using goldmark
- Serve β Starts a local HTTP server with graceful shutdown
- Watch β Monitors file changes using fsnotify
- Reload β Sends live updates via Server-Sent Events (SSE) with event replay
- Track β Receives AI session metadata and correlates with file changes
- Render β Applies GitHub styling with embedded CSS (zero runtime dependencies)
Development
Requirements
- Go 1.21 or higher
Building
go build -o peekm
go test -race ./...
Project Structure
peekm/
βββ main.go # Single-file Go implementation with embedded resources
βββ theme/ # Embedded resources (loaded at build time)
βββ github-markdown.css # Official GitHub markdown CSS
βββ theme-overrides.css # Theme switching CSS
βββ theme-manager.js # Shared theme management logic
βββ navigation.js # SPA navigation, notifications, search
βββ editor.js # Markdown editing functionality
βββ file-browser.html # Unified template (browser + file views)
βββ session-info-panel.html # AI session metadata panel
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT License β see LICENSE file for details.
Acknowledgments
- goldmark β Markdown parser
- fsnotify β Cross-platform file watching
- chroma β Syntax highlighting
Related Projects
- glow β Terminal markdown renderer (21k+ stars)
- grip β GitHub-flavored markdown preview (6.7k stars)
- VS Code Markdown Preview β Built-in editor preview
Documentation
ΒΆ
There is no documentation for this package.