agentleFS
smgglrs-aismgglrs-ai/navra/CLAUDE.md

navra

CLAUDE.md2 starsChanged 5 months agoApache-2.0View on GitHub

Secure agentic AI framework and MCP gateway. Rust workspace. Runs standalone on Linux desktops or in containers at any scale. ONNX Runtime is bundled automatically via the ort crate's download-binaries feature — no system packages required. 24-crate Rust workspace. See DESIGN.md for the full crate table, dependency layering, architecture diagrams, and design decisions. After tests pass for a feature, commit immediately. Never accumulate unstaged changes across multiple features. One feature = one commit. Every agent prompt MUST include this instruction:

The file

We split this CLAUDE.md into the rules it gives an agent

9 rules. About 0 are common, 6 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    After tests pass for a feature, commit immediately.

    line 28
  2. Distinctive:

    Every agent prompt MUST include this instruction:

    line 37
  3. Distinctive:

    When an agent completes in a worktree, merge its branch:

    line 47
  4. Distinctive:

    Do NOT copy files manually — that loses history, misses files, and creates merge conflicts with other agents.

    line 53
  5. Distinctive:

    Same commit: when adding, removing, or changing a feature, update the relevant documentation in the same commit.

    line 70
  6. Distinctive:

    No stale counts: never hardcode counts (tests, proofs, crates) that will drift.

    line 73
  7. Very specific:

    Verify claims against code: before writing that navra "does X", grep for the implementation.

    line 83
  8. Very specific:

    All async tests use #[tokio::test]

    line 159
  9. Very specific:

    Never use pkill — find and kill specific PIDs

    line 178

≈ “Common” is an estimate: at least 1 in 5 of the 29,248 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

navra

Secure agentic AI framework and MCP gateway. Rust workspace. Runs standalone on Linux desktops or in containers at any scale.

Build

ONNX Runtime is bundled automatically via the ort crate's download-binaries feature — no system packages required.

# Build
cargo build

# Run
cargo run -- serve

Workspace

24-crate Rust workspace. See DESIGN.md for the full crate table, dependency layering, architecture diagrams, and design decisions.

Agent Workflow (MANDATORY)

Commit after every verified feature

After tests pass for a feature, commit immediately. Never accumulate unstaged changes across multiple features. One feature = one commit.

git add -A && git commit -s -m "description"

Agents must commit in their worktrees

Every agent prompt MUST include this instruction:

Before finishing, commit all your changes: git add -A && git commit -s -m "your summary"

This ensures the worktree branch survives cleanup. Without a commit, worktree removal destroys all agent work.

Merge agent work via git merge, not file copy

When an agent completes in a worktree, merge its branch:

git merge --no-ff worktree-agent-xxx -m "Merge: feature description"

Do NOT copy files manually — that loses history, misses files, and creates merge conflicts with other agents.

Never let worktrees accumulate

Merge or discard each worktree as soon as the agent completes. Stale worktrees with uncommitted changes will be lost on cleanup.

See AGENTS.md for parallel development rules.

Documentation Maintenance (MANDATORY)

Documentation is a deliverable, not an afterthought. Inaccurate docs are worse than missing docs — they actively mislead users.

Rules

  1. Same commit: when adding, removing, or changing a feature, update the relevant documentation in the same commit. A feature without doc updates is not done.
  2. No stale counts: never hardcode counts (tests, proofs, crates) that will drift. If you must state a count, grep the codebase for the real number — do not copy from memory or another doc.
  3. No duplicate sources of truth: the docs site (docs/content/) is canonical for user-facing content. Root-level markdown files are for developer workflow only. Never duplicate content between them — link instead.
  4. Delete, don't preserve: stale docs, frozen one-time evals, and internal decision logs do not belong in user-facing docs. Git has history. Delete without stubs.
  5. Verify claims against code: before writing that navra "does X", grep for the implementation. If the code doesn't do X, don't document X.

What to update where

  • Crate changes (add/remove/rename): DESIGN.md crate table and dependency graph, crate count in this file, TESTING.md.
  • New tools, hooks, or config fields: docs/content/docs/configuration/_index.md and the relevant section in docs/content/docs/security/_index.md or guides.
  • IFC, auth, or safety changes: docs/content/docs/security/_index.md and docs/content/docs/learn/information-flow-control.md.
  • Proof count changes (Kani/Verus/TLA+): docs/content/docs/architecture/_index.md and docs/content/docs/learn/what-kani-proves.md.
  • Known limitations or security gaps: .lean/items/ work item, not a comment in a design doc.

Conventions

Naming

  • Tool names are prefixed with module name: file_read, git_status
  • Operations are string-based, module-namespaced: "read", "git.commit"
  • Config fields use snake_case in TOML

Error Handling

  • Modules return CallToolResult::error(msg) for user-facing errors
  • Infrastructure errors use anyhow::Result in server code
  • Model loading failures are logged and skipped (graceful degradation)

Testing

2800+ tests. Always use just to run tests — it sets ORT environment variables, serializes navra-server tests one binary at a time, and cleans up leaked server processes between runs.

# All tests (workspace parallel + server serialized)
just test

# Workspace only (excludes navra-server)
just test-workspace

# navra-server only (one binary at a time with cleanup)
just test-server

# Single crate
just test-crate navra-core

NEVER run raw cargo test -p navra-server — it spawns multiple server processes that OOM the machine. The pre-commit hook blocks this, but use just to avoid the issue entirely.

Doc-test convention: use no_run for examples needing cross-crate types, text for illustrative examples. Never use ignore.

Prerequisites:

  • Ollama with any model for 1 e2e test (ollama pull qwen2.5:0.5b)
# Build with OTel trace export
just build
# Then: OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317 navra mcp serve

Conventions:

  • Unit tests live in #[cfg(test)] mod tests at the bottom of each file
  • Integration tests in tests/ directories per crate
  • echo_tool_def() and test_ctx() helpers are defined locally in navra-core/src/server/tests.rs; other crates define their own test_ctx() for constructing CallContext in tests
  • All async tests use #[tokio::test]

See DESIGN.md for adding modules and tools.

Config

Default path: ~/.config/navra/config.toml

Key sections: [server], [modules.*], [models.*], [[agents]], [permissions.*], [[upstream]], discover, [[registry]].

See docs/content/docs/configuration/_index.md for the full config reference, or examples/config.toml for a commented example.

Resource Limits

  • Agents using Ollama: serialize, max one concurrent
  • Single GPU: serialize with high timeouts
  • Background processes: immediately capture PID, verify before using
  • Never use pkill — find and kill specific PIDs
  • Ollama IS available — don't exclude Ollama-dependent tests
  • Kani proof runs: never on this machine — it will OOM. Run them on the designated build machine (large-RAM host, passwordless SSH; see NAVRA-193 notes for the access pattern)

Work Tracking

Work items live in .lean/items/*.yml (source of truth). plan.yml is a generated index — regenerate with bash ~/.claude/lean/scripts/generate-plan.sh.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.