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

Ninja

$ ninja Community Low Risk
Ninja · Code & DevOps · Apache-2.0 · macos / linux / windows

Ninja (ninja) is a minimal C++ build executor focused on maximum incremental build speed for build.ninja manifests generated by CMake, Meson, or GN. It supports -n (--dry-run), -t query, -t targets, and -t compdb (compile_commands.json export), though regular build logs are unstructured text.

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

ninja executes parallel local compile/link DAGs directly from build.ninja on disk; MCP is inapplicable.

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 18 / 25

Supports -n (--dry-run), --quiet, -C <dir>, -t targets/query, and JSON output via -t compdb, though compiler stdout/stderr remains plain text.

  • ninja -n provides exact build dry-run command output
  • ninja -t compdb generates compile_commands.json
Trust & Safety 21 / 25

Local-only build execution scoped to the -C build directory, with -n dry-run and -t clean tools.

  • ninja -n verifies exact commands before executing
Setup & Portability 14 / 15

Tiny standalone C++ binary available via Homebrew, PyPI, apt, and GitHub releases across macOS, Linux, and Windows.

  • Zero-dependency static binary across macOS, Linux, and Windows
Utility & Efficiency 13 / 15

Unmatched no-op / incremental stat speed on large C/C++ build graphs, far faster than GNU Make.

  • Sub-second no-op rebuild checks on large codebases
Maintenance & Lineage 8 / 10

Widely deployed ninja-build/ninja project under Apache-2.0 license.

  • Official ninja-build/ninja repository
Docs & Verifiability 7 / 10

Concise manual at ninja-build.org/manual.html and clear -h / -t list help.

  • Single-page reference manual at ninja-build.org/manual.html

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

No authentication required; build state is stored locally in .ninja_log and .ninja_deps inside the build directory.

Side Effects
Read-Only Local Write
Cost & Quotas

Apache-2.0 open-source CLI; free to use.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# Ninja (ninja) Agent Rules
- Always preview stale targets with `ninja -C build -n` when checking if a build is clean.
- Use `ninja -C build -t compdb` to inspect exact compiler flags and `--quiet` during builds to save context tokens.

Agent-Ready Command Recipes

Safe Read-Only Queries

Preview pending build commands with dry-run
ninja -C build -n

Prints the exact compile/link commands that would execute without running any tools.

Export clang compilation database as JSON
ninja -C build -t compdb

Outputs compile_commands.json entries for all build rules to stdout.

Controlled Writes & Previews

Run incremental build with quiet status
ninja -C build --quiet

Rebuilds out-of-date targets in parallel while suppressing [N/M] progress lines unless errors occur.

Strengths for Agents

  • + ninja -n gives agents an exact dry-run of every command Ninja would execute.
  • + ninja -t compdb emits JSON compilation databases for static analysis tools.
  • + Blazingly fast parallel execution and near-instant no-op rebuild verification.

Caveats & Pitfalls

  • ! Requires a higher-level generator (CMake, Meson, GN) to author build.ninja.
  • ! Build diagnostics from underlying compilers (clang/gcc) are emitted as unstructured text.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI