globset

A Rust crate for matching one or more glob patterns against a path simultaneously

Library
Cargo
v0.4.20
68,658 stars
MIT OR Unlicense

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
85 /100 Excellent
Development Activity 76
Maintenance 96
Community 68
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
81 /100 Excellent
Architecture 84
Code Quality 85
Innovation 75
Learning Curve 78

globset is a cross-platform Rust crate for glob pattern matching, distinguished by its ability to match many glob patterns against a single path simultaneously rather than testing each pattern one at a time. It works by compiling glob patterns into regular expressions and executing them through the regex crate, which lets it match large sets of patterns (as in a .gitignore-style ignore list) far faster than iterating over each glob individually. Maintained as part of Andrew Gallant’s (BurntSushi) ripgrep monorepo, globset is the pattern-matching engine underneath ripgrep’s own file filtering and the ignore crate’s directory-walking logic, and by download volume it is the more widely used of the two.

What You Get

  • Glob/GlobBuilder for compiling a single glob pattern into a matcher, with configuration for case sensitivity and literal path-separator semantics
  • GlobSet/GlobSetBuilder for combining many glob patterns into one matcher that tests a path against all of them simultaneously and returns which ones matched
  • Support for alternate ‘or’ globs (e.g. *.{foo,bar}), unlike Rust’s standard glob crate
  • Correct matching against non-UTF-8 file paths, important for cross-platform tools that must handle arbitrary filesystem bytes
  • An optional serde1 feature for (de)serializing Glob values, useful for loading glob patterns from configuration files

Common Use Cases

  • Implementing .gitignore-style ignore-pattern matching where many patterns must be checked against each candidate path efficiently
  • Building a file-search or linting tool that needs to filter files by one or more include/exclude glob patterns
  • Replacing per-pattern sequential glob matching (as with the glob crate) with a single combined matcher when checking many patterns against the same path repeatedly
  • Matching glob patterns loaded from a configuration file, using the serde1 feature to deserialize Glob values directly

Under The Hood

Architecture crates/globset/src/glob.rs (1,686 lines) implements the glob-to-regex compiler: it parses glob syntax (wildcards, character classes, brace alternation, literal separators) into an internal AST-like token sequence, then renders that into a regex-crate pattern string. crates/globset/src/lib.rs (1,307 lines) builds on that to provide the public Glob/GlobMatcher (single-pattern) and GlobSet/GlobSetBuilder (multi-pattern) types; GlobSet specifically concatenates many compiled glob-regexes into one RegexSet so a single execution pass can report every matching pattern’s index, which is the crate’s core performance idea. pathutil.rs handles path-normalization helpers needed for consistent cross-platform matching, fnv.rs provides a fast non-cryptographic hasher used internally, and serde_impl.rs implements the optional Serde (de)serialization support behind the serde1 feature. Tech Stack Pure Rust (edition 2024) with regex/regex-syntax and aho-corasick as its core matching dependencies, plus bstr for correct non-UTF-8 path handling; serde and log are optional, feature-gated dependencies rather than defaults. Benchmarks live in a separate benches directory using the bencher-style harness visible in the crate’s README performance numbers. Code Quality The crate has 27 inline #[test] functions across its five source files (13 in lib.rs alone, covering GlobSet construction and matching edge cases; 6 in glob.rs covering pattern-compilation correctness; 5 in serde_impl.rs), plus a benchmark suite that doubles as a performance regression check; CI runs through the shared ripgrep monorepo GitHub Actions workflow. As one of the older, most heavily downloaded crates in the ripgrep monorepo, its code has had years of production hardening across ripgrep, the ignore crate, and countless third-party consumers. API Design The single-glob API (Glob::new(pattern)?.compile_matcher()) is minimal and requires almost no setup for the common case; GlobSetBuilder follows the same builder pattern used throughout Rust’s ecosystem (.add() then .build()), so the multi-pattern API is a natural extension of the single-pattern one rather than a separate mental model, and the README’s direct performance comparisons against the glob crate make the tradeoffs explicit for users deciding between them.

Used by 18 apps in this directory

Rust
95%
MIT

claw-code

AI Agents · AI Code Assistants

195,291

A Rust-built CLI agent harness for Claude AI with persistent sessions, MCP tool integration, plugin hooks, and multi-provider support — designed to run autonomous coding workflows without human babysitting.

View details
51
Repo Health
71
Technical
77
Dependency
Built with
Rust 95%
Updated 1 months ago
Rust
95%
MIT

claw-code

AI Agents · AI Code Assistants

195,291

A Rust-built CLI agent harness for Claude AI with persistent sessions, MCP tool integration, plugin hooks, and multi-provider support — designed to run autonomous coding workflows without human babysitting.

View details
51
Repo Health
71
Technical
77
Dependency
Built with
Rust 95%
Updated 1 months ago
Rust
52%
Apache 2.0

cocoindex

AI Development · Data Engineering

11,607

An incremental data indexing engine that keeps AI agent context perpetually fresh by reprocessing only what changed.

View details
87
Repo Health
85
Technical
65
Dependency
Built with
Rust 52%
Python 48%
Updated 4 days ago
TypeScript
84%
Apache 2.0

Continue

AI Code Assistants · AI Development · Automation

36,049

Open-source coding agent for VS Code, JetBrains, and CLI with support for 30+ LLM providers.

View details
73
Repo Health
88
Technical
62
Dependency
Built with
TypeScript 84%
Updated 5 days ago
Rust
88%
GPL 2.0

Fresh

Code Editors · Developer Tools

9,052

A zero-configuration terminal text editor with familiar keybindings, full mouse support, LSP-powered IDE features, and a built-in orchestrator for running multiple coding agents in parallel worktrees.

View details
86
Repo Health
88
Technical
71
Dependency
Built with
Rust 88%
Updated 5 days ago
Rust
65%
Other

GitButler

AI Development · Developer Tools · Devops

21,726

Git, but better — a modern version control client with stacked branches, parallel workflows, unlimited undo, and first-class support for AI-powered development.

View details
89
Repo Health
84
Technical
66
Dependency
Built with
Rust 65%
TypeScript 22%
Svelte 10%
Updated 4 days ago
Rust
56%
Apache 2.0

Magnitude

AI Development · Developer Tools

5,285

An open source inference engine that profiles your hardware, recommends the best local models, and tunes them for the coding agent you already use.

View details
78
Repo Health
83
Technical
71
Dependency
Built with
Rust 56%
TypeScript 18%
Python 11%
Updated 4 days ago
Python
75%
AGPL 3.0

OpenViking

AI Development · AI Memory · Databases

38,819

An open-source context database that gives AI agents a unified filesystem for memory, resources, and skills with hierarchical tiered retrieval.

View details
85
Repo Health
75
Technical
64
Dependency
Built with
Python 75%
Rust 12%
Updated 4 days ago
Python
75%
AGPL 3.0

OpenViking

AI Development · AI Memory · Databases

38,819

An open-source context database that gives AI agents a unified filesystem for memory, resources, and skills with hierarchical tiered retrieval.

View details
85
Repo Health
75
Technical
64
Dependency
Built with
Python 75%
Rust 12%
Updated 4 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers