# Loci Guard

> Persistent project memory, security shielding, and risk forecasting for AI coding agents.

Loci Guard is a paid AI agent skill pack (several skills in one listing) on Agensi by Dib68, in LLM Ops. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $3 (one-time purchase)
- Creator: [Dib68](https://www.agensi.io/creators/dib68)
- Category: [LLM Ops](https://www.agensi.io/skills/llm-ops)
- Version: 1.0
- Last updated: 2026-11-24
- Security: scan passed (2026-11-24); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/loci-guard
- Tags: llm-ops, python, mcp-server, security-gate, coding-assistant

## About this skill

AI coding agents often forget local project rules, repeat past mistakes, and accidentally commit secrets or vulnerable code. Loci Guard provides a persistent memory layer and security gate that stays with your repository across sessions and different agents.

### What it does

- **Persistent memory** stores architectural decisions, project rules, and lessons learned in a `.loci/` folder.
- **Security shielding** scans code for secrets, PII leaks, SQL injection, and debug leftovers before they reach your files.
- **Foresight forecasting** uses persona-based simulations to predict potential issues with wide-ranging or risky changes.
- **Context injection** automatically feeds relevant folder-specific rules to the agent as it navigates the codebase.
- **Task intentions** tracks location-aware to-dos that trigger when the agent enters specific directories.

### How it works

1. Run `loci-guard setup` to initialize the memory store in your current repository.
2. Use `loci-guard context` at the start of a session to load relevant rules and pending intentions.
3. Use `loci-guard constrain` or `remember` to save new decisions or bug root causes as they occur.
4. Run `loci-guard check` on code snippets or `loci-guard gate` on staged changes to block security violations.

### Frameworks & tools

Requires Python 3.10 or higher. It operates as a CLI tool or an MCP server. It includes specific hooks for Claude Code and works with any agent capable of using shell tools or MCP.

### Why this beats prompting it yourself

Manual prompts are lost when a session ends or context windows are cleared. This tool persists project-specific constraints in the repo itself, ensuring every subagent and future session follows the same security standards and architectural patterns without manual re-entry.

### Use cases

- Enforcing specific API patterns or library choices across a large team.
- Preventing the accidental commit of hardcoded credentials or PII.
- Onboarding new agents to a complex codebase with "lessons learned" from past bugs.
- Simulating the impact of major refactors using the foresight swarm.

### Known limitations

Requires the `loci-guard` Python package to be installed in the environment. Foresight forecasts require additional subagent capacity.

## Requires

- Python
- Git

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Loci Guard skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### How does Loci Guard prevent an AI agent from repeating the same coding mistakes?

Loci Guard acts as a persistent memory layer and security firewall that lives inside your repository. It prevents agents from repeating past bugs, forgetting project-specific architectural rules, or accidentally committing sensitive data like API keys.

### Which AI coding agents and IDEs are compatible with Loci Guard?

Loci Guard is compatible with any AI agent that supports shell commands or the Model Context Protocol (MCP), including Claude Code, Windsurf, and Cursor. It functions as a bridge that carries context between different sessions and even different agent tools.

### How difficult is the initial setup and do I need to re-configure it for every new session?

Setup is a one-time process: simply install the Python package via pip and run `loci-guard setup` in your repository root. This creates a local `.loci/` directory that stores your project’s unique constraints and security rules without cluttering your main codebase.

### What is "Foresight Forecasting" and how does it protect my codebase during major refactors?

The Foresight Forecasting feature uses a persona-based simulation to analyze proposed code changes. It identifies how a refactor in one directory might break dependencies or violate architectural patterns in another, providing a risk report before you apply the changes.

### What exactly is included with the Loci Guard skill purchase?

You receive the full `loci-guard` Python package, the MCP server integration, and a set of pre-configured security hooks. Your purchase also includes access to future updates as we add new security signatures and agent integrations.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
