loci-settings

A command for configuring Loci, a project-memory system that stores notes about a code repository and summarizes selected notes in an index. It lets you choose whether memory is enabled and which kinds of information are summarized.

In plain words
What is it for?
Use it to connect a repository to local Loci memory and configure summaries for lessons, milestones, decisions, architecture, or custom tags.
Why use it?
It prevents project memory from being enabled or summarized without your choices. It also shows existing settings before asking what to change.

Command

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 commands/codesstar/loci/loci-settings
Clone the repo
git clone --depth 1 https://github.com/codesstar/loci
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 719 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00000 $0.00719
Opus 5 $0.00000 $0.00360
Sonnet 5 $0.00000 $0.00144
Haiku 4.5 $0.00000 $0.00072

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

Security

Grade A, and why

loci-settings scanned grade A with 0 findings 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

templates/commands/loci-settings.md · 61 lines

What it actually says

Configure how this connected project writes local memory and what gets summarized in the Loci brain index.

Steps:

  1. Check connection: Check for .loci/memory.md in current directory. If not found, offer once at the end of the exchange: "这个项目还没有本地记忆。要不要我帮你在这里留个记忆?" If the user says yes, follow the "Connecting a serious project" rule in the main instructions.

  2. Check existing config: Read .loci/config.json if it exists. If it does, show current settings and ask what to change. If not, proceed with fresh setup.

  3. Collect settings using AskUserQuestion tool. Three questions, one at a time:

    Q1: "Enable Loci project memory for this repo?"

    • Yes (default) — Write project memory locally in this repo
    • No — Pause project memory updates for this repo

    Q2: "What should be summarized in the brain index? (toggle items)" Show defaults and let user toggle:

    • insight — lessons learned, non-obvious findings (default: ON)
    • milestone — shipped features, completed phases (default: ON)
    • decision — only if promoted to brain-level significance (default: OFF)
    • architecture — only if it affects other projects (default: OFF) User can add custom tags too (e.g. "meeting-notes", "user-feedback").

    Q3: "Any rules about what should NEVER sync? (e.g. 'never sync client names', 'skip internal jokes'). Say 'no' to skip." → Free text, optional. Stored as a note in config for the AI to respect.

    Note at the end: "The project's full memory stays in this repo. Env variables, secrets, debug logs, and dependency updates are never summarized into the brain."

  4. Save config: Write .loci/config.json in current directory:

    {
      "version": 1,
      "brain": "<path from .loci/memory.md frontmatter>",
      "project_memory": {
        "enabled": true,
        "index_tags": ["insight", "milestone"],
        "local_tags": ["local", "debug", "wip"],
        "auto_index": true
      }
    }
    
    • brain path is read from .loci/memory.md frontmatter
    • index_tags and local_tags are derived from the user's answers in Q2
    • If user provided exclusion rules in Q3, add "exclusions": ["..."] to the config
  5. Apply rules: If the project has a CLAUDE.md, update the <!-- loci:project:start v1 --> block. If no CLAUDE.md exists, create one with templates/project-claude-block.md.

  6. Confirm with summary:

    Settings saved to .loci/config.json
    
    Brain: <brain path>
    Local memory: enabled
    Brain index summaries: insight, milestone
    Local tags: local, debug, wip
    Exclusions: [if any]
    Full memory owner: this repo
    Never indexed: env/secrets, debug logs, deps
    
    You can re-run /loci-settings anytime to change these.
    
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 · 61 lines · 0 tokens per session scan A c773f33339f0

Subscribe to this mod's changes

loci-settings is a command published in the GitHub repository codesstar/loci (99 stars, last pushed 2d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 719 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.