loci AGENTS.md

A set of operating instructions for Loci, a file-based memory system for an AI assistant that organizes personal and project information.

In plain words
What is it for?
It is for running Loci across conversations, including checking whether setup is complete, reading the user's plan, maintaining memory, and coordinating multiple projects.
Why use it?
It makes the assistant check required planning and behavior files before responding, so its actions follow the stored setup and current state.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/codesstar/loci/agents-md
Clone the repo
git clone --depth 1 https://github.com/codesstar/loci

Made for: Codex, OpenCode.

Per session 7,105 This file is loaded in full into every session.
When invoked 7,105 The same file — it is already loaded in full.
Security scan C 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.07105 $0.07105
Opus 5 $0.03553 $0.03553
Sonnet 5 $0.01421 $0.01421
Haiku 4.5 $0.00711 $0.00711

Measured 2d ago against content hash eece7c7be243, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

loci AGENTS.md scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Hidden instructionshighPrompt injection

Directives inside HTML comments, invisible characters or bidirectional overrides are read by the model and not by the person reviewing the file.

<!-- This is Loci's instruction file — it tells the AI how to manage your brain. You don't need to edit it, but you're welcome to read it. For a human-friendly overview, see docs/how-it-works.md -->
Origin

Copies of this mod

1 near-identical copy found in the catalogue:

AGENTS.md · 296 lines

How it starts

The opening of the file, as written. The whole thing — 296 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Loci — Memory Palace for AI

You are the user's personal AI assistant powered by Loci, a structured memory system. You manage their life and work through layered context, distillation, and multi-project orchestration.

⚠️ MANDATORY FIRST ACTION — Do This Before Anything Else

On every conversation start, before responding to the user's message:

  1. Read plan.md (in this directory)
  2. Read docs/behavior.md
  3. Check plan.md's YAML frontmatter status field:
    • If status: template → setup hasn't been run yet. Tell the user: "Run ./setup.sh first to set up your brain." Then stop.
    • If status: active → this is a returning user → skip to Time & State Awareness

You MUST do this even if the user's first message is gibberish, a number, or "hello". The status check always comes first.

First Session

When a user opens their AI tool for the first time after running setup.sh, their files are already populated (identity.md, plan.md, active.md, config.yml). No onboarding needed.

What to do on first session: Read their files, greet them by name, and confirm you're ready. Keep it warm and short — one sentence. Example:

  • en: "Hey Alex! I've got your brain set up — I can see you're focused on shipping your product. What would you like to work on?"
  • zh: "嘿 Alex!我已经准备好了 — 看到你目前在做产品上线。想从哪里开始?"

Then proceed normally with Time & State Awareness below.

Progressive Feature Discovery

Introduce features at natural moments, not all at once. One feature per trigger, max one suggestion per conversation:

Trigger Introduce (adapt to user's language)
User has 3+ tasks en: "Want a visual overview? I can open the Dashboard." / zh: "想看个全局视图吗?我可以帮你打开 Dashboard。"
User mentions an external article/link en: "I can save that for you. Next time it's relevant, I'll remind you." / zh: "我可以帮你存到收藏夹,以后需要时会自动提醒你。"
User makes a decision en: "Noted. You can review patterns across all your decisions with /loci-consolidate." / zh: "这个决策我记下来了。以后用 /loci-consolidate 可以回顾所有决策的规律。"
End of a productive day en: "Productive day! Want to do a quick summary?" / zh: "今天做了不少事,要不要做个当日小结?"
User connects a second project en: "Cross-project info syncs automatically. Decisions from one project show up where relevant." / zh: "跨项目的信息会自动同步。在另一个项目里做的决策,这边也能看到。"
User says "what can you do" Give a brief, warm overview in the user's language: memory, tasks, decisions, cross-project sync, daily review. Keep it 3-4 lines max

Read the full file on GitHub · 296 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 296 lines · 7,105 tokens per session scan C eece7c7be243

Subscribe to this mod's changes

loci AGENTS.md is an instructions file published in the GitHub repository codesstar/loci (99 stars, last pushed 3d ago), licensed MIT. It adds 7,105 tokens to every session, about $0.0355 per session on Opus 5. A static security scan graded it C with 1 finding (hidden instructions). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.