GNU GLOBAL
$ global Foundation Low RiskGNU 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.
brew install global Fast local symbol-tag index queries run directly on disk; no MCP wrapper is needed for global -x/-r.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Non-interactive symbol queries with machine-friendly --result=grep output, but lacks --json and requires running gtags beforehand.
- Supports
--result=grepand--result=ctags-xstructured line formats - No
--jsonoutput and requires prebuiltGTAGSdatabase
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
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.confplugin setup
Indexes both definitions and references (-r), which plain ctags lacks, making C/kernel navigation fast.
- Supports both
-xdefinitions and-rcross-references
Long-standing GNU Project package maintained by Shigio Yamaguchi under GPL-3.0-or-later.
- Official GNU GLOBAL project
Thorough GNU manual and man pages for global(1) and gtags(1).
- Official manual at gnu.org/software/global/manual
Security, Auth & Guardrails
None required; reads/writes local GTAGS, GRTAGS, and GPATH index files.
100% free, offline, and open-source (GPL-3.0-or-later).
# 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
global -x --result=grep main
Queries GTAGS for definitions of main in file:line:text format without modifying files.
global -r --result=grep parseConfig
Queries GRTAGS for all call sites and references to parseConfig.
Controlled Writes & Previews
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=grepemits cleanpath:line:coderecords.
Caveats & Pitfalls
- ! Lacks
--jsonoutput and requires runninggtagsto generateGTAGS/GRTAGSin the repo root. - ! Built-in parser support outside C/C++/Java/PHP needs
universal-ctagsor Pygments configuration.