RepoLens: Interactive Local Codebase Packer and Token Optimizer (TUI/CLI) in Go

RepoLens is a new open-source, zero-dependency Go tool that packs a local codebase into a single file optimized for LLM context windows. It features an Elm-architecture TUI built on Charm's Bubble Tea, along with several smart context-optimization mechanisms.
Key Features
- Interactive File Explorer (TUI): Select files and folders recursively with the spacebar. Expand/collapse nested folders visually.
- Live Tiktoken Counter: A dynamic progress bar estimates context limit consumption (GPT-4o encoding) in real time as you select files.
- Smart Comment Stripping: Automatically removes comments and docstrings for Go, Python, TypeScript, JavaScript, Shell, HTML, and CSS, while keeping executable shebangs (
#!/bin/bash). Benchmark on thespf13/cobrarepo: prompt size shrunk from 621 KB to 518 KB (17.2% token savings). - Token-based File Splitting: If your codebase exceeds a token threshold (e.g.,
--max-tokens 50000), RepoLens splits output into sequential parts, automatically prepending the tree layout diagram to every part. - Local Secret Scanner: Flags potential AWS keys, OpenAI keys, Slack webhooks, and generic passwords. In TUI mode, blinks a yellow
⚠️ [SECRET!]warning next to the file. - Robust XML Formatting: Safely wraps code payloads inside
<![CDATA[ ... ]]>blocks and escapes nested brackets to prevent prompt formatting breakdown.
Quick Start
Install via Go:
go install github.com/catball912/repolens@latestOr run in direct CLI mode:
repolens -n -d . -i "*_test.go,*.log" -o output.mdWho It's For
Developers who need to feed a local codebase into an LLM (e.g., for code review, refactoring, or documentation generation) without uploading files to a third-party service, and who want a lightweight, compiled tool with no runtime dependencies.
📖 Read the full source: r/openclaw
👀 See Also
xAI TTS Integration for Home Assistant Built with Claude — Full Repo
A developer used Claude to build a custom Home Assistant integration for xAI's TTS API (Eve voice) with full UI config, five voices, and speech tags.

Claudetop: Real-Time Cost Monitoring for Claude Code Sessions
Claudetop is an htop-like tool that shows real-time spending, cache efficiency, and model comparisons for Claude Code sessions. It provides slash commands like /claudetop:stats and smart alerts for cost milestones and efficiency issues.

Claude Code's Tool API Details Revealed
A Reddit user extracted details about Claude Code's tool API, including file system operations, bash execution, web search, and how tool calls are structured using XML-like blocks.

Claude Code as a Compiler: A Practical Reframe for AI Development
A Reddit post argues Claude Code functions as a compiler translating English to working software, drawing parallels to historical computing breakthroughs like Grace Hopper's A-0 and FORTRAN. The author describes generating 400 lines across 6 files from a 3-paragraph English description, catching two issues in 25 minutes.