npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

llm-codebase-context

v1.0.2

Published

A command-line tool to prepare your codebase for submission to Large Language Models (LLMs) like ChatGPT or Claude. It creates a formatted context file that includes your source code while intelligently filtering out binary files, large files, and commonl

Readme

LLM Codebase Context

A command-line tool to prepare your codebase for submission to Large Language Models (LLMs) like ChatGPT or Claude. It creates a formatted context file that includes your source code while intelligently filtering out binary files, large files, and commonly ignored directories.

Why Use This?

  • Quickly create LLM-ready snapshots of your codebase
  • Smart filtering removes irrelevant files (node_modules, binaries, build artifacts)
  • Avoids common issues like token limits by excluding overly large files
  • Structured XML output format is ideal for LLM context

Installation

# Install globally
npm install -g llm-codebase-context

# Or run with npx without installing
npx llm-codebase-context <project_root>

Usage

Basic Usage

# Process the current directory and output to structure.txt
codebase-context .

# Process a specific project and specify output file
codebase-context /path/to/project output.txt

# Process only a subdirectory of your project
codebase-context /path/to/project output.txt src

Advanced Usage

# Add custom ignore patterns
codebase-context . output.txt . "tests,fixtures,*.json"

# Process a specific subdirectory with custom ignores
codebase-context /path/to/project output.txt src "*.test.js,*.spec.js,__tests__"

Configuration

The tool comes with sensible defaults that work for most projects:

Default Limits

  • Maximum file size: 1MB
  • Maximum line count: 5000 lines

Default Ignore Patterns

The tool automatically ignores common patterns including:

  • Package management: node_modules, package-lock.json, etc.
  • Version control: .git, .gitignore
  • Build outputs: dist, build, .next, etc.
  • System files: .DS_Store, Thumbs.db
  • Environment/secrets: .env files, .pem, .key
  • Logs and temp files: logs, *.log, temp, tmp
  • Language-specific: __pycache__, *.class, etc.
  • Binary files: Images, videos, archives, executables

Output Format

The tool produces an XML-formatted file with each source file enclosed in <file> tags:

<file path="src/index.js">
// File content goes here
</file>

<file path="src/utils/helpers.js">
// Another file's content
</file>

This format is optimized for use with LLMs as it clearly delineates file boundaries and preserves path information.

Use Cases

  • Get help with bugs by providing full context to an LLM
  • Ask for architecture recommendations with full codebase knowledge
  • Generate documentation based on your entire project
  • Request refactoring suggestions with proper context

Contributing

Contributions are welcome! Feel free to submit issues or pull requests.

License

ISC