agentleFS
smart-coder-labssmart-coder-labs/nexus-mind/CLAUDE.md

nexus-mind

CLAUDE.md2 starsChanged 5 months agoMITView on GitHub

NexusMind is the single source of truth for this codebase. Before guessing, check it. Before finishing, save to it. This protocol is MANDATORY and ALWAYS ACTIVE in this repository. It is not a suggestion. If you skip it, the next session starts blind. Call these DIRECTLY by full name — no ToolSearch. Call store_memory IMMEDIATELY and WITHOUT BEING ASKED after any of these: Self-check after EVERY task: "Did I make a decision, fix a bug, learn something non-obvious, or establish…

  • Reads credentials

The file

Show its rules and text

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

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Default project for every call: nexus-mind

    line 9
  2. Distinctive:

    Call these DIRECTLY by full name — no ToolSearch.

    line 15
  3. Very specific:

    Call store_memory IMMEDIATELY and WITHOUT BEING ASKED after any of these:

    line 28
  4. Very specific:

    USE topic_key for topics that EVOLVE — saving again with the same key UPDATES the existing memory instead of creating a duplicate.

    line 71
  5. Distinctive:

    Use it when you expect to revise the same decision later

    line 74
  6. Distinctive:

    DO NOT use it for one-shot records (a single bug fix, a single session summary)

    line 75
  7. Distinctive:

    If unsure of the right key, search first — if a similar topic exists, reuse its key.

    line 77
  8. Very specific:

    Call search_memory PROACTIVELY when:

    line 81
  9. Distinctive:

    If unsure whether to search — search.

    line 88
  10. Very specific:

    NEVER pass a bare project/repo name (e.g.

    line 94
  11. Distinctive:

    Before saying "done", "that's it", "finished" (or the equivalent in any language), call:

    line 98
  12. Distinctive:

    If you see a compaction message or "FIRST ACTION REQUIRED":

    line 128
  13. Very specific:

    Call search_memory(query: "nexus-mind") to recover broader context.

    line 131
  14. Distinctive:

    Only THEN continue working.

    line 132
  15. Distinctive:

    Do not skip step 1. Without it, everything done before compaction is lost from memory.

    line 134

≈ “Common” is an estimate: at least 1 in 5 of the 26,980 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

NexusMind — Claude Code MANDATORY PROTOCOL

NexusMind is the single source of truth for this codebase. Before guessing, check it. Before finishing, save to it.

This protocol is MANDATORY and ALWAYS ACTIVE in this repository. It is not a suggestion. If you skip it, the next session starts blind.

In this repository

  • Default project for every call: nexus-mind
  • Alternates for cross-repo work: nexusmind-backend, nexusmind-admin, nexusmind-mcp, nexusmind-landing
  • Default tool: claude-code

Available MCP tools

Call these DIRECTLY by full name — no ToolSearch.

ToolWhen to use
mcp__nexusmind__store_memorySave a decision, bug fix, convention, discovery — PROACTIVELY
mcp__nexusmind__search_memoryFirst action on any prompt that references prior work
mcp__nexusmind__list_memoriesBrowse recent memories (utility)
mcp__nexusmind__get_contextBootstrap a significant session — all team knowledge grouped by type
mcp__nexusmind__get_memoryFetch FULL untruncated content by id (previews are not enough)
mcp__nexusmind__delete_memoryRemove a memory — ONLY when the user explicitly asks

PROACTIVE SAVE TRIGGERS

Call store_memory IMMEDIATELY and WITHOUT BEING ASKED after any of these:

  • Architecture or design decision made
  • Convention documented or established
  • Bug fix completed (include root cause)
  • Feature implemented with non-obvious approach
  • Tool or library choice made with tradeoffs
  • Configuration or environment change
  • Non-obvious discovery about the codebase
  • Gotcha, edge case, or unexpected behavior
  • Pattern established (naming, structure)
  • User preference or constraint learned

Self-check after EVERY task: "Did I make a decision, fix a bug, learn something non-obvious, or establish a convention? If yes, call store_memory NOW."

Required fields on every store_memory call

  • title — verb + what, 5-10 words ("Fixed N+1 in memory listing")
  • type — pick from the glossary below
  • project — always nexus-mind in this repo
  • content — structured: What, Why, Where, Learned
  • topic_key (recommended for evolving topics) — see topic_key section

Type glossary

TypeUse for
architectureSystem design, component relationships, infrastructure decisions
bugfixRoot cause + fix. Always include WHAT broke and WHY
decisionExplicit choices made between alternatives
discoveryNon-obvious findings about code, APIs, or behavior
patternEstablished conventions — naming, structure, approach
configEnvironment setup, tool config, credentials schema
preferenceUser working style, code style, tool preferences
projectGoals, stakeholders, milestones, business context
session_summaryEnd-of-session state — always save before saying "done"
featureImplemented feature with approach and rationale
refactoringWhat changed, why, what to watch for
feedbackCorrections and confirmations from the user
manualAd hoc save not fitting another type

topic_key guidance

USE topic_key for topics that EVOLVE — saving again with the same key UPDATES the existing memory instead of creating a duplicate.

  • Examples: architecture/auth-model, config/deploy-pipeline, pattern/repo-naming, convention/commit-style
  • Use it when you expect to revise the same decision later
  • DO NOT use it for one-shot records (a single bug fix, a single session summary)

If unsure of the right key, search first — if a similar topic exists, reuse its key.

WHEN TO SEARCH

Call search_memory PROACTIVELY when:

  • The user's FIRST message of a session references a project, feature, bug, or module → search BEFORE responding
  • Starting work on something that might have been done before
  • The user uses words like "remember", "recall", "we did", "how did we" — search every time
  • You are about to make a non-trivial decision — check whether one already exists

If unsure whether to search — search.

HOW to search (avoid lazy project-name queries)

  • To load a project's context, use get_context(project=…) or list_memories(project=…) — NOT search_memory.
  • search_memory is a semantic search: pass a query describing the specific thing you need (e.g. "how auth tokens are validated", "deploy pipeline config", "why we chose SQLite").
  • NEVER pass a bare project/repo name (e.g. "nexus-mind") as the search_memory query — a semantic engine returns noise for that, not the project's context. Use get_context/list_memories for whole-project loading.

SESSION CLOSE (MANDATORY)

Before saying "done", "that's it", "finished" (or the equivalent in any language), call:

store_memory({
  type: "session_summary",
  title: "Session: <one-line>",
  project: "nexus-mind",
  content: """
  ## Goal
  <what we were working on>

  ## Accomplished
  - <completed items with key details>

  ## Discoveries
  - <technical findings, gotchas>

  ## Next Steps
  - <what remains>

  ## Relevant Files
  - path/to/file — <what changed>
  """
})

This is NOT optional. If you skip this, the next session starts blind.

AFTER COMPACTION

If you see a compaction message or "FIRST ACTION REQUIRED":

  1. IMMEDIATELY call store_memory with type: "session_summary" and the compacted summary content — this persists what was done before compaction.
  2. Call search_memory(query: "nexus-mind") to recover broader context.
  3. Only THEN continue working.

Do not skip step 1. Without it, everything done before compaction is lost from memory.

Configuration

The repo's .mcp.json uses an environment placeholder ${NEXUSMIND_API_KEY} — set this in your shell before launching Claude Code:

export NEXUSMIND_API_KEY=<your-key>

The MCP server is launched via npx -y @smart-coder-labs/nexusmind-mcp — no local checkout required.


Quick start

# 1. Start the backend
make backend   # or: cd apps/backend && cargo run

# 2. Seed demo data (first time or to reset)
./scripts/reset-demo.sh

# 3. Build the MCP server (only needed for local dev)
make mcp-build

# 4. Set your API key
export NEXUSMIND_API_KEY=<your-key>

# 5. Open Claude Code — the MCP server and hooks connect automatically

Full setup guide: docs/RUNNING.md


Demo keys (after reset-demo.sh)

UserKey
Acme Corp — adminnm_demo_acme_admin
Acme Corp — Sarah Chennm_demo_acme_sarah
TechStartup — adminnm_demo_techstartup_admin

NexusMind is the single source of truth for this codebase. Before guessing, check it. Before finishing, save to it.

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.