Skip to content

.gitignore for ndx projects

ndx writes two kinds of files: durable state that belongs in version control, and transient runtime artifacts that don't. This page explains the difference and provides a copy-pasteable snippet you can drop into any project.

Reference template

A ready-to-use template file lives at packages/core/assistant-assets/ndx.gitignore in the ndx repo. Copy its contents into your project's .gitignore.

What to commit vs. what to ignore

PathCommit?Why
.rex/prd_tree/✅ AlwaysCanonical PRD storage — slug-named folder tree, one index.md per item
.rex/config.jsonProject-level rex configuration
.hench/config.jsonAgent configuration (model, max turns, guard policy)
CLAUDE.md / AGENTS.mdAssistant instruction files generated by ndx init
.n-dx.json⚠️ OptionalProject config overrides; safe to commit if it contains no secrets
.sourcevision/⚠️ OptionalAnalysis output — regenerated by ndx analyze. Commit it so teammates skip a re-analysis pass; gitignore it if you prefer to regenerate locally
.codex/config.toml⚠️ OptionalMCP server definitions for Codex; commit if your team uses Codex
Everything else listed belowEphemeral runtime artifacts, caches, locks, personal settings

Rule of thumb: algorithmic outputs and shared config belong in version control; runtime artifacts, caches, locks, and per-developer settings don't.

Copy-pasteable snippet

Add this block to your project's .gitignore:

gitignore
# n-dx — runtime artifacts and ephemeral state
# Keep: .rex/prd_tree/ .rex/config.json .hench/config.json CLAUDE.md AGENTS.md
# Optional: .sourcevision/ (shared analysis baseline) .n-dx.json (project config)

# Analysis output (regenerated by `ndx analyze`)
.sourcevision/

# Agent runs, locks, and session state
.hench/runs/
.hench/locks/
.hench-commit-msg.txt

# Rex ephemeral state
.rex/.backups/
.rex/.cache/
.rex/prd.json.lock
.rex/pending-proposals.json
.rex/acknowledged-findings.json
.rex/execution-log*.jsonl
.rex/adapters.json
.rex/n-dx_workflow.md

# Server runtime
.n-dx-web.pid
.n-dx-web.port

# Run logs
.run-logs/

# Local config overrides (may contain secrets or API keys)
.n-dx.local.json
*.local.json

# Assistant local settings (personal, not shared)
.claude/settings.local.json

If you want to commit .sourcevision/ as a shared analysis baseline, remove that line from the snippet.

Why each path is transient

PatternWhat it containsWhy ignore
.sourcevision/File inventory, import graph, zone data, findingsFully regenerated by ndx analyze; large binary-adjacent JSON files create noisy diffs
.hench/runs/LLM conversation transcripts, tool call logsPer-run artifacts; large, not useful to teammates
.hench/locks/Concurrency lock filesTransient; leftover locks cause hench to stall
.hench-commit-msg.txtProposed commit message from last agent runTemporary scratch file
.rex/.backups/Timestamped snapshots of prd_tree before reshape/addSafety net only; 10 most-recent retained automatically
.rex/.cache/prd.json derived from the folder tree (web server only)Ephemeral; regenerated on ndx start
.rex/prd.json.lockFile lock for JSON cache writesTransient
.rex/pending-proposals.jsonUnreviewed proposals from ndx planPer-session interactive state
.rex/acknowledged-findings.jsonFindings you've chosen to suppressPersonal triage notes; per-developer
.rex/execution-log*.jsonlAppend-only structured activity logGrows unboundedly; not useful in git
.rex/adapters.jsonRemote sync adapter stateLocal-only integration state
.rex/n-dx_workflow.mdHuman-readable workflow state snapshotDerived display artifact
.n-dx-web.pid / .n-dx-web.portWeb server PID and port filesAuto-managed by ndx start/stop
.run-logs/External run log outputCI/debug artifacts
*.local.jsonLocal environment overridesMay contain API keys or personal paths
.claude/settings.local.jsonClaude Code permission overridesPersonal MCP approvals — not shared
  • Existing Project Onboarding — full onboarding flow that shows when to add the .gitignore block (Step 4, before any ndx commit)
  • PRD Storage Layout — why .rex/prd_tree/ is the only ndx directory that always belongs in git
  • Getting Started — initialize ndx and configure your LLM
  • Skills Reference — the skill files ndx init writes to .claude/skills/ and .agents/skills/ (committed to version control)

Released under the Elastic License 2.0.