Zigzag LogoZigZagDocs

Introduction

ZigZag - a blazing-fast code analytics tool that converts source code into comprehensive Markdown, JSON, and HTML reports.

Welcome to ZigZag

ZigZag is a blazing-fast code analytics tool that recursively scans your source code directories and produces comprehensive Markdown, JSON, and HTML reports — optimized for modern developer workflows and LLM-powered tooling.

Why ZigZag?

Modern development workflows increasingly rely on feeding code context to LLMs, generating documentation, and integrating code analysis into CI/CD pipelines. ZigZag was built to solve these problems with a single, fast tool:

  • Give LLMs full project context — Generate optimized reports that fit your entire codebase into an LLM context window
  • Create interactive code dashboards — Browse your codebase in a self-contained HTML file with syntax highlighting, search, and analytics
  • Automate documentation — Keep machine-readable reports up-to-date with watch mode and CI integration
  • Analyze your codebase — Get instant insights into languages, file sizes, and project structure

Key Features

  • High-performance file reading with automatic strategy selection based on file size
  • Intelligent binary file detection to keep outputs clean and human-readable
  • Parallel processing across worker pools for fast execution on large codebases
  • Persistent caching so subsequent runs only process changed files
  • Real-time watch mode that rebuilds reports instantly on file changes
  • Interactive HTML dashboard with syntax highlighting, virtual scrolling, and dark mode
  • LLM-optimized reports designed for feeding context to AI tools
  • Cross-platform support for Linux, macOS, and Windows
  • JSON output for integration with CI dashboards and analysis pipelines
  • Flexible ignore patterns with wildcards, extensions, and exact matches

How It Works

ZigZag follows a simple pipeline:

  1. Scan — Recursively walk the directories you specify
  2. Filter — Apply ignore patterns and detect binary files automatically
  3. Cache — Skip unchanged files using smart metadata-based caching
  4. Process — Read files in parallel using optimal I/O strategies
  5. Report — Generate Markdown, JSON, and/or HTML output

Quick Example

# Initialize a config file
zigzag init

# Generate reports for your source directory
zigzag run --path ./src --html --json

# Watch for changes and regenerate automatically
zigzag run --path ./src --watch --html

Ready to get started? Head to the Getting Started guide.

On this page