Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

GNU GLOBAL

$ global Foundation Low Risk
GNU · Files & Search · GPL-3.0-or-later · macos / linux / windows

GNU GLOBAL indexes symbol definitions and call-site references (gtags) so global can look up definitions (-x), references (-r), and symbol occurrences (-s) across C, C++, Java, PHP, and assembly codebases. Outputs structured line formats (--result=grep / ctags-x), though it lacks JSON.

FCRS-1.0 Score
77 /100
Good
Medium Confidence
Zero-Friction Install
brew install global
CLI vs MCP Decision CLI Only

Fast local symbol-tag index queries run directly on disk; no MCP wrapper is needed for global -x/-r.

Agent-Readiness Checklist

— JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
✓ Read-Only Mode
— NO_COLOR Clean
— Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 16 / 25

Non-interactive symbol queries with machine-friendly --result=grep output, but lacks --json and requires running gtags beforehand.

  • Supports --result=grep and --result=ctags-x structured line formats
  • No --json output and requires prebuilt GTAGS database
Trust & Safety 22 / 25

global queries are strictly read-only; gtags writes GTAGS/GRTAGS/GPATH index files locally without altering source code.

  • Never modifies source files; index files are isolated
Setup & Portability 12 / 15

Packaged via brew install global and Linux distros, though non-C languages rely on external universal-ctags or Pygments parser plugins.

  • Built-in C/C++/Java/PHP/yacc parsers; extra languages require gtags.conf plugin setup
Utility & Efficiency 11 / 15

Indexes both definitions and references (-r), which plain ctags lacks, making C/kernel navigation fast.

  • Supports both -x definitions and -r cross-references
Maintenance & Lineage 8 / 10

Long-standing GNU Project package maintained by Shigio Yamaguchi under GPL-3.0-or-later.

  • Official GNU GLOBAL project
Docs & Verifiability 8 / 10

Thorough GNU manual and man pages for global(1) and gtags(1).

  • Official manual at gnu.org/software/global/manual

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

None required; reads/writes local GTAGS, GRTAGS, and GPATH index files.

Side Effects
Read-Only Local Write
Cost & Quotas

100% free, offline, and open-source (GPL-3.0-or-later).

Copyable Guardrail for CLAUDE.md / AGENTS.md
# GNU GLOBAL Agent Rules
- Run `gtags` (or `global -u`) first when `GTAGS` is missing or stale; keep `GTAGS`/`GRTAGS`/`GPATH` out of Git commits.
- Prefer `--result=grep` for consistent `path:line:content` parsing across definitions (`-x`) and references (`-r`).

Agent-Ready Command Recipes

Safe Read-Only Queries

Look up symbol definitions with file and line info
global -x --result=grep main

Queries GTAGS for definitions of main in file:line:text format without modifying files.

Find cross-references to a symbol
global -r --result=grep parseConfig

Queries GRTAGS for all call sites and references to parseConfig.

Controlled Writes & Previews

Generate local GTAGS/GRTAGS symbol index
gtags

Indexes the repository into GTAGS, GRTAGS, and GPATH files in the current directory.

Strengths for Agents

  • + Tracks both symbol definitions (-x) and cross-references (-r) offline.
  • + --result=grep emits clean path:line:code records.

Caveats & Pitfalls

  • ! Lacks --json output and requires running gtags to generate GTAGS/GRTAGS in the repo root.
  • ! Built-in parser support outside C/C++/Java/PHP needs universal-ctags or Pygments configuration.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI