Write instructions Claude Code can use
A CLAUDE.md file holds instructions and rules you write. Claude Code reads it at the start of each session, but treats its contents as context rather than enforced configuration. Claude Code memory documentation recommends instructions concrete enough to verify.
For a project, place the file at ./CLAUDE.md or ./.claude/CLAUDE.md. Claude Code can also use AGENTS.md as project instructions, so a repository configured for another coding agent can work without adding CLAUDE.md. See the Claude Code documentation.
Keep rules focused and easy to check
Aim for fewer than 200 lines in each CLAUDE.md; longer files use more context and may reduce adherence. Put rules that apply only to part of the codebase in path-scoped rules under .claude/rules/. Claude Code documents both approaches.
You can import reference files with @path/to/import. Imported content loads alongside the CLAUDE.md that references it, and nested imports can go up to four hops. Wrap a path in backticks when you want to mention it without importing it. Read the import guidance.
Use auto memory for learnings
Claude Code starts each session with a fresh context window. Auto memory is enabled by default in local sessions and can retain learnings and patterns across conversations, while CLAUDE.md is for instructions and rules you write. Claude Code explains the difference.
Auto memory stores a MEMORY.md index and separate topic files. The first 200 lines or 25KB of MEMORY.md, whichever comes first, load at conversation start. Topic files load on demand. Use /memory to browse or edit memory files. See the memory file details.
Check what loaded
Run /context all and look under Memory files to confirm a CLAUDE.md file loaded. Run /init to generate a starting file from the codebase; if one already exists, /init suggests improvements instead of overwriting it. These checks are documented by Claude Code.
If instructions may be outdated or conflict, /doctor prompt-audit reports findings and proposed edits without changing files. Claude Code documentation describes the audit.
Connect KnowMan for saved articles
KnowMan's MCP server runs locally with npx -y @knowman/mcp and as a hosted server at https://api.knowman.io/mcp with OAuth sign-in or an API key. Its tools include kb_search for finding saved items, kb_get_item for reading one item, kb_ask for answers with citations, and kb_save for saving a URL with an optional note. Learn how a knowledge base MCP server works.
For Claude Code setup, see the Claude Code knowledge base guide. The server uses @knowman/mcp; its documented setup requires Node 22 or newer and a KnowMan API key. Read the KnowMan MCP guide. Explore ways to give an AI your context.
Where KnowMan fits
Use CLAUDE.md for project rules, auto memory for learnings, and KnowMan for articles and links you save. KnowMan can answer questions with citations and keep saved claims, decisions, and playbooks. See the Claude knowledge base guide.
KnowMan's MCP server runs locally with npx -y @knowman/mcp and as a hosted server at https://api.knowman.io/mcp, so Claude Code can use the local server or connect to the hosted one with OAuth sign-in or an API key. Read the KnowMan MCP guide.
Use the hosted KnowMan server in Claude Code
KnowMan also runs as a hosted remote MCP server at https://api.knowman.io/mcp. Add that URL in Claude Code and sign in with OAuth: Claude Code opens the KnowMan consent page, where you approve the knowman.read scope for search, read, and ask, and the knowman.write scope for saving links. Access tokens last one hour and refresh automatically.
You can also connect with an API key created in KnowMan settings, sent as an Authorization: Bearer header. Run: claude mcp add --transport http knowman https://api.knowman.io/mcp --header "Authorization: Bearer <key>". Then ask Claude Code to search or save, for example "search my KnowMan for ..." or "save this URL".
To disconnect Claude Code later, delete its "OAuth: Claude Code" entry in your KnowMan API-keys list. The open-source local client at knowman-mcp is still there if you prefer to run npx -y @knowman/mcp yourself.
Questions people ask
Does Claude Code remember instructions between sessions?
Claude Code reads CLAUDE.md files at the start of every session, and auto memory can carry learnings across conversations. Each session begins with a fresh context window. Claude Code documents both memory types.
Where should I put project instructions?
A project CLAUDE.md can go at ./CLAUDE.md or ./.claude/CLAUDE.md. Claude Code can also read AGENTS.md as project instructions. See the Claude Code documentation.
Can Claude Code read my saved articles with KnowMan?
The KnowMan MCP package includes kb_search and kb_get_item for searching saved items and reading one item. It also includes kb_ask for answers with citations. Read the KnowMan MCP guide.
Can I make a CLAUDE.md rule impossible to ignore?
No. Claude Code treats CLAUDE.md instructions as context, not enforced configuration. For an action that must be blocked regardless of Claude’s decision, Claude Code documentation recommends a PreToolUse hook. See the memory documentation.