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 🙏

© 2026 – Pkg Stats / Ryan Hefner

github2claude

v1.0.5

Published

Generate LLM-optimized markdown documentation from GitHub repositories for use with Claude AI

Readme

GitHub to Claude Code Mapper

A Node.js tool that downloads GitHub repositories and generates LLM-optimized markdown documentation for easy code understanding with Claude and other AI assistants.

Overview

This tool is designed to:

  1. Clone GitHub repositories
  2. Analyze the codebase structure and relationships
  3. Generate a comprehensive markdown document optimized for Large Language Models
  4. Package the code in a format that's ideal for uploading to Claude conversations

Features

  • 🔍 Automatic code analysis and structure mapping
  • 📊 Dependency relationship tracking
  • 🗺️ Visual directory structure representation
  • 💡 Intelligent component identification
  • 🔗 Data flow visualization
  • 📝 LLM-optimized markdown output
  • 🎯 Special XML-style tags for better AI comprehension

Installation

# Clone the repository
git clone https://github.com/SurfSolana/github2claude.git

# Enter the directory
cd github2claude

# Install dependencies
pnpm i

# global usage
npm link

Usage

To use the tool, provide the GitHub repository URL as a command line argument:

npx github2claude https://github.com/username/repository 

The tool will:

  1. Clone the specified repository to a temporary directory
  2. Analyze its structure
  3. Generate markdown files in a g2c__username-repository/version directory in your current working directory

For example, running npx github2claude https://github.com/SurfSolana/github2claude will generate a documentation directory named something like g2c__SurfSolana-github2claude/1.0.0.

Output Format

The generated markdown includes:

  • Repository metadata
  • Project structure overview
  • Directory tree
  • Architecture analysis
  • Component relationships
  • Detailed code sections with analysis

Each section is wrapped in special tags for better AI comprehension:

<codebase_metadata>
Repository information
</codebase_metadata>

<project_structure>
Directory and component organization
</project_structure>

<architecture_analysis>
System design and relationships
</architecture_analysis>

<component_analysis>
Individual file analysis
</component_analysis>

Supported File Types

  • JavaScript (.js, .jsx)
  • TypeScript (.ts, .tsx)
  • HTML/CSS
  • Markdown
  • YAML/JSON
  • And many other text-based file formats

Configuration

The tool can be configured by modifying the config object in index.js:

const config = {
    tempDir: 'temp',
    outputDir: 'output',
    textFileExtensions: [...],
    excludePatterns: [...]
};

Error Handling

The tool includes robust error handling for:

  • Repository access issues
  • File parsing errors
  • TypeScript/JavaScript analysis
  • Dependency resolution
  • File system operations

Requirements

  • Node.js >=16
  • NPM or Yarn
  • Git installed on your system

Dependencies

  • @babel/parser: Code parsing
  • @babel/traverse: AST traversal
  • @typescript-eslint/parser: TypeScript parsing
  • simple-git: Git operations
  • chalk: Terminal coloring

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - feel free to use this in your own projects!

Acknowledgments

This tool is designed specifically for use with Anthropic's Claude AI assistant, but can be used with other AI systems that process markdown.

Common Issues

TypeScript Version Warning

If you see TypeScript version warnings, you can install a compatible version:

npm install typescript@~5.3.3

Parsing Errors

Some TypeScript files might show parsing warnings. These are handled gracefully and won't affect the overall output.

Future Improvements

  • [ ] Support for more programming languages
  • [ ] Enhanced relationship mapping
  • [ ] Custom tag system for different AI models
  • [ ] Interactive mode
  • [ ] Configuration file support
  • [ ] Plugin system for custom analyzers