📐 docs: Make CLAUDE.md Portable and Restore AGENTS.md Parity (#15046)

CLAUDE.md pointed at /home/danny/agentus for the @librechat/agents source.
That path resolves on one machine, so for every other contributor the line
occupies context on every turn while pointing nowhere. Replaced with the
public repository URL.

AGENTS.md opens with "See CLAUDE.md", which makes CLAUDE.md the source of
truth, but it carried an auth cache invalidation rule that appears nowhere
in CLAUDE.md. Claude Code reads CLAUDE.md and not AGENTS.md, so contributors
using it never received a rule about serving stale req.user.

Moved that rule into a Backend Rules section in CLAUDE.md, mirroring the
existing Frontend Rules section, and left AGENTS.md pointing at it the same
way its theming paragraph already does.

Closes #15045
This commit is contained in:
Alexandre Beguel 2026-08-20 23:28:49 +02:00 committed by GitHub
parent 868cfbb343
commit 6baeff801c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 17 additions and 2 deletions

View file

@ -10,4 +10,8 @@ instead of copying classes into a feature. Keep genuine layout and behavior loca
why any new custom CSS cannot be expressed by the shared system. See the detailed policy in
`CLAUDE.md` under “Theming and styling.”
When adding or changing code that mutates user documents, invalidate the auth user document cache for affected users. This includes single-user updates and bulk role/user mutations; otherwise OpenID JWT request burst caching can serve a stale `req.user` until its TTL expires.
## Backend auth cache
When adding or changing code that mutates user documents, invalidate the auth user document cache
for affected users, including bulk role and user mutations. See the detailed policy in `CLAUDE.md`
under “Auth cache invalidation”.

View file

@ -13,7 +13,8 @@ LibreChat is a monorepo with the following key workspaces:
| `/client` | TypeScript/React | Frontend | `packages/data-provider`, `packages/client` | Frontend SPA |
| `/packages/client` | TypeScript | Frontend | `packages/data-provider` | Shared frontend utilities |
The source code for `@librechat/agents` (major backend dependency, same team) is at `/home/danny/agentus`.
The source code for `@librechat/agents` (major backend dependency, same team) lives at
<https://github.com/danny-avila/agents>.
---
@ -170,6 +171,16 @@ Multi-line imports count total character length across all lines. Consolidate va
---
## Backend Rules (`api/**`, `packages/api/**`)
### Auth cache invalidation
When adding or changing code that mutates user documents, invalidate the auth user document cache
for the affected users. This covers single-user updates as well as bulk role and user mutations.
Without it, OpenID JWT request burst caching can serve a stale `req.user` until its TTL expires.
---
## Development Commands
| Command | Purpose |