agent-memory-mcp / rules
AGENTS.md4 starsChanged 9 days agoMITView on GitHub
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,843 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repositoryOne other file it gives its agents.
- agent-memorySkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
13 rules. About 0 are common, 1 is distinctive, and 12 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
12
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 5
Run project-scoped tools (check_memory_status, save_project_memory, search_project_memory, etc.) with an absolute project_path.
- Distinctive: line 7
If there is no active workspace, or if the user asks a standalone question / reviews tooling outside a project codebase, skip project …
- Very specific: line 10
If the SessionStart hook already injected [AGENT-MEMORY AUTO-HYDRATED] for the active workspace, do NOT redundantly re-run …
- Very specific: line 14
If check_memory_status (or the SessionStart message) reports UNINITIALIZED on a real project workspace, pause the user's request and map …
- Very specific: line 18
Atomic Batch Save: Call save_project_memory once using the entries array to save all 3 foundational nodes atomically:
- Very specific: line 25
Use search_project_memory (FTS5 ranked search across titles, tags, files, and summaries) and read_memory_node (ids: [...] batch supported, …
- Very specific: line 26
Before modifying any core utility, hook, or shared component, call get_file_memories with the target file_paths to surface anchored …
- Very specific: line 27
When adopting a library or diagnosing third-party framework quirks, search machine-wide memory via search_global_knowledge with the tech …
- Very specific: line 28
If read_memory_node emits a [STALE WARNING], verify the note against current code on disk and update it if needed.
- Very specific: line 32
When a project-specific solution or architectural pattern proves broadly reusable across projects, promote it to the machine-wide global …
- Very specific: line 37
Before retrying a compiler error, test failure, or unexpected runtime bug, call check_dead_ends with the error pattern or file path.
- Very specific: line 45
If external dependencies, platform versions, or requirements change such that a previous dead-end is now viable, call reopen_dead_end with …
- Very specific: line 48
Before completing a project coding task or implementation plan (ask the user if unsure whether the task is complete), call …
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.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.
Files
Rule: Universal Project Memory & Bootstrapping (v3.1)
You act as the persistent intelligence for the active project workspace and cross-project knowledge via agent-memory-mcp.
- Workspace Guard & Global Scoping:
- Run project-scoped tools (
check_memory_status,save_project_memory,search_project_memory, etc.) with an absoluteproject_path. - Global knowledge tools (
search_global_knowledge,save_global_knowledge,get_token_metrics) do not require a project path and query the machine-wide~/.ag-memory-mcp/global.db. - If there is no active workspace, or if the user asks a standalone question / reviews tooling outside a project codebase, skip project memory calls completely.
- Run project-scoped tools (
- Startup Check & Zero-Turn Auto-Hydration:
- If the
SessionStarthook already injected[AGENT-MEMORY AUTO-HYDRATED]for the active workspace, do NOT redundantly re-runcheck_memory_statusorget_session_timeline—proceed directly to task-specific retrieval. - Otherwise, run
check_memory_statuswith the absoluteproject_path(which hydrates initialization status, core architecture index, dead-end count, and the top 5 recent session timeline entries in a single call).
- If the
- Universal Auto-Bootstrapping (If
UNINITIALIZED):- If
check_memory_status(or theSessionStartmessage) reportsUNINITIALIZEDon a real project workspace, pause the user's request and map the project architecture first:- Identify Ecosystem: Scan the root folder for package managers and config files (e.g.,
package.json,requirements.txt,go.mod,Cargo.toml,pom.xml,docker-compose.yml). - Find Entry Points: Locate primary source directories (
src/,cmd/,app/,lib/) and main execution files. - Analyze Architecture: Determine project type (REST API, Frontend SPA, CLI tool, Monolith, Microservice) and key patterns (routing, ORM, state management).
- Atomic Batch Save: Call
save_project_memoryonce using theentriesarray to save all 3 foundational nodes atomically:"Tech Stack & Ecosystem"(slug: "tech-stack",category: "architecture")"Project Structure & Architecture"(slug: "project-structure",category: "architecture")"Build & Run Instructions"(slug: "build-run",category: "architecture")
- Notify User: Output
"I have initialized the project memory for this [insert tech stack] project,"then proceed with their task.
- Identify Ecosystem: Scan the root folder for package managers and config files (e.g.,
- If
- Task & File-Anchored Retrieval:
- Use
search_project_memory(FTS5 ranked search across titles, tags, files, and summaries) andread_memory_node(ids: [...]batch supported, including"g-..."global IDs) to load relevant context before modifying code. - Before modifying any core utility, hook, or shared component, call
get_file_memorieswith the targetfile_pathsto surface anchored architectural invariants and past dead-ends. - When adopting a library or diagnosing third-party framework quirks, search machine-wide memory via
search_global_knowledgewith the tech stack name. - If
read_memory_nodeemits a[STALE WARNING], verify the note against current code on disk and update it if needed.
- Use
- Continuous Learning & Global Promotion:
- When you implement a new architectural pattern, add a database table, integrate/replace a core library, or change build steps, update the existing node via
save_project_memory(using itsidor canonicalslug) orupdate_memory_node—never leave contradictory duplicate architectural nodes behind. Usedelete_memory_nodeto archive obsolete notes. - When a project-specific solution or architectural pattern proves broadly reusable across projects, promote it to the machine-wide global knowledge graph via
promote_to_global.
- When you implement a new architectural pattern, add a database table, integrate/replace a core library, or change build steps, update the existing node via
Rule: Session Timelines & Anti-Looping (v3.1)
- Anti-Loop Dead-End Checks & Taxonomy:
- Review the recent session timeline and active dead-ends at task start so you never repeat completed tasks or re-attempt failed fixes.
- Before retrying a compiler error, test failure, or unexpected runtime bug, call
check_dead_endswith the error pattern or file path. - Whenever an attempted fix fails (and especially before stopping on the 3-Strike Rule), call
record_dead_endwith:error_pattern: The exact compiler error, test failure, or symptom.attempted_solution: What was tried and failed.root_cause: Why it failed.files: Workspace-relative paths involved.kind:"error_loop"for code/test bug fixes, or"architectural"for intentional architectural constraints / rejected trade-offs.constraints: Invariants or preconditions forbidding this approach.
- If external dependencies, platform versions, or requirements change such that a previous dead-end is now viable, call
reopen_dead_endwith the record ID and reason.
- End of Task / Implementation Plan Session Log:
- Before completing a project coding task or implementation plan (ask the user if unsure whether the task is complete), call
save_project_memorywith:title:"Session Log: [Task Name]"category:"session"tags:["changelog", "session"]files: workspace-relative paths of key files added, modified, or removedsummary: A concise bulleted summary of changes made and any gotchas discovered.
- Before completing a project coding task or implementation plan (ask the user if unsure whether the task is complete), call
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
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.

