Документация доступна только на английском языке.

Memory

How Nib loads its own instruction file, CLAUDE.md, AGENTS.md and rules files, in what order, how to structure them, and the notes the agent keeps itself.

Memory is the set of instruction files Nib loads into every session: how to build and test the project, conventions to follow, things to avoid. You write them once and every session, in every surface and with every model, starts with them.

Nib reads the instruction files of other agents too, so a repository that already has a CLAUDE.md or an AGENTS.md works without changes.

File names

At each directory level, Nib looks for these files and loads every one that exists, in this order:

OrderFileWhat it is
1AGENTS.mdThe shared convention many agents read
2GEMINI.mdAnother agent's instruction file
3CLAUDE.mdAnother agent's instruction file
4.claude/CLAUDE.mdThe same, in that agent's folder
5NIB.mdNib's own
6.nib/NIB.mdNib's own, in its folder

Import your setup lists which agents use which files.

Later files carry more weight. When two files give conflicting guidance, the one loaded later wins, so NIB.md overrides CLAUDE.md, which overrides AGENTS.md.

If you are starting fresh, write a NIB.md, or run /init and let Nib draft one. If your team also uses other agents, keep the shared guidance in AGENTS.md and put anything Nib-specific in NIB.md.

Where Nib looks

Instructions load from several scopes, broadest first:

  1. Managed. Organization-wide files set by an administrator:

    PlatformPaths
    macOS/Library/Application Support/ClaudeCode/CLAUDE.md, /Library/Application Support/Nib/NIB.md
    WindowsC:\Program Files\ClaudeCode\CLAUDE.md, C:\Program Files\Nib\NIB.md
    Linux/etc/claude-code/CLAUDE.md, /etc/nib/NIB.md
  2. User. Your personal preferences, for every project: ~/.claude/CLAUDE.md, ~/.codex/AGENTS.md, ~/.gemini/GEMINI.md and ~/.nib/NIB.md, plus rules in ~/.claude/rules/ and ~/.nib/rules/.

  3. Project. Every directory from the filesystem root down to your working directory, root first, so the instructions closest to where you work come last. Plus rules in .claude/rules/ and .nib/rules/ at the project root.

  4. Local. CLAUDE.local.md and NIB.local.md: personal notes for this project that you don't commit. Add them to .gitignore. They load at every directory level, right after that level's shared files.

Nested directories

Instruction files in subdirectories below your working directory load lazily. When the agent first reads or edits a file in packages/api/, Nib loads packages/api/NIB.md (or AGENTS.md, CLAUDE.md, …) at that moment. In a monorepo, this keeps each package's guidance out of context until it's relevant.

Rules

Rules are small instruction files in a rules/ directory, one topic per file. A rule without frontmatter loads at session start like any other instruction file.

A rule with paths: loads only when the agent touches a matching file:

.nib/rules/migrations.md
---
paths:
  - "db/migrations/**"
  - "**/*.sql"
---

Migrations are append-only. Never edit a migration that has been merged; add a new one.
Run `bun run db:check` after writing a migration.

This is the best place for guidance that matters for one area of the codebase and would be noise everywhere else.

Imports

An instruction file can pull in another file with @path:

NIB.md
# Project guide

See @docs/architecture.md for the module layout.
Coding conventions: @docs/conventions.md
  • Paths are relative to the file that contains the import. ~/ paths work too.
  • A project's files import only files inside the project, plus Markdown notes in your own ~/.claude/ folder (or Nib's in your home folder), so a repository can't pull other files on your computer into the prompt. Anything else is skipped with a warning, and so is an instruction file in the project that is a link to a file outside it. Your own instruction files, in your home folder, import from anywhere.
  • Imports can nest up to 4 levels deep. Cycles are detected and skipped.
  • @path inside code blocks and inline code is ignored, so examples don't trigger imports.

What gets stripped

  • Block HTML comments (<!-- … -->) are removed before the content reaches the model. Use them for notes to human maintainers.
  • YAML frontmatter on rules is removed after Nib reads paths:.
  • Files larger than 4 MiB are skipped with a warning.

Excluding files

If a file shouldn't load, for example a vendored package's AGENTS.md written for a different project, exclude it in settings:

.nib/settings.json
{
  "claudeMdExcludes": ["vendor/**", "third_party/**/AGENTS.md"]
}

Managed files can't be excluded.

Auto memory

Besides the files you write, the agent keeps its own notes about a repository between sessions: build quirks, decisions, where things are. They live in a folder per repository on this computer, shared by its worktrees, not in the repository itself. The first 200 lines of its MEMORY.md index open every main session, and the agent reads the notes it links when it needs them. The agent writes in that folder without asking; subagents don't load it.

Turn it off with autoMemoryEnabled: false in your settings or NIB_DISABLE_AUTO_MEMORY=1, and move it with autoMemoryDirectory in your user settings (see Configuration). Because the agent writes there without asking, a repository's settings can't move it, and a folder that is or holds your home folder or a secret store, or is a protected path, is refused, which leaves auto memory off. Cloud sessions don't keep auto memory.

Writing good instructions

Instruction files cost context in every session, so keep them short and concrete.

  • Lead with commands. How to install, build, run tests, lint and typecheck. These are what the agent needs most often.
  • State conventions as rules. "Use zod for validation; never hand-write type guards for API input" beats a paragraph on philosophy.
  • Name the gotchas. The flaky test, the generated file nobody should edit, the environment variable that must be set.
  • Point, don't paste. Link to architecture docs with @path instead of copying them in.
  • Move area-specific guidance into path-scoped rules.

A useful NIB.md is often under 100 lines.

The /init command

/init asks the agent to analyze the codebase and write a NIB.md at the repository root covering build, test and lint commands, an architecture overview, key conventions and gotchas. If NIB.md, AGENTS.md or CLAUDE.md already exists, it improves that file instead of starting over. Review the result like any other change.

На этой странице