agent-context-system

agent-context-system is a skill for Claude Code, Codex from LeoYeAI/openclaw-master-skills. It costs 90 tokens per session (3,591 once invoked), scanned C, original, MIT.

A persistent local memory system for coding agents using a shared AGENTS.md file and a private .agents.local.md scratchpad. The shared file records project rules, while the scratchpad records personal session discoveries.

In plain words
What is it for?
Use it across coding sessions with tools such as Claude Code, Cursor, Copilot, or Windsurf to retain project patterns, commands, architecture notes, and lessons learned.
Why use it?
It reduces the cold start at the beginning of each coding session, when an agent would otherwise need the same project explanation again. The files provide context without plugins or background services.

Skill for Claude CodeCodex

Which agent this was written for is unclear — built for openclaw. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions subagents.

Good fit Use it across coding sessions with tools such as Claude Code, Cursor, Copilot, or Windsurf to retain project patterns, commands, architecture notes, and lessons learned.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/leoyeai/openclaw-master-skills/agent-context-system
About the project

OpenClaw Master Skills is a curated, regularly updated collection of skills that extends an AI personal assistant platform with capabilities such as research, browser automation, presentation creation, and prompt work. It is intended for people using OpenClaw or MyClaw.ai to give their agents additional tasks and workflows. The catalogue contains many skills and agents from this collection.

LeoYeAI/openclaw-master-skills · 2,229 stars · on GitHub · myclaw.ai

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.

Any agent
npx skills add LeoYeAI/openclaw-master-skills --skill agent-context-system
Clone the repo
git clone --depth 1 https://github.com/LeoYeAI/openclaw-master-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for agent-context-system

README.md
[![agentmods](https://agentmods.dev/badge/skills/leoyeai/openclaw-master-skills/agent-context-system/github.svg)](https://agentmods.dev/skills/leoyeai/openclaw-master-skills/agent-context-system)
Your own site
<a href="https://agentmods.dev/skills/leoyeai/openclaw-master-skills/agent-context-system"><img src="https://agentmods.dev/badge/skills/leoyeai/openclaw-master-skills/agent-context-system/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for agent-context-system

Your own site · 80×15
<a href="https://agentmods.dev/skills/leoyeai/openclaw-master-skills/agent-context-system"><img src="https://agentmods.dev/badge/skills/leoyeai/openclaw-master-skills/agent-context-system.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 90 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,591 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00090 $0.03591
Opus 5.5 $0.00036 $0.01436
Sonnet 5.5 $0.00018 $0.00718
Haiku 4.5 $0.00009 $0.00359

Measured 1mo ago against content hash d32a1ea4c8cf, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade C, and why

agent-context-system 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 1mo ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/init-agent-context.sh, scripts/publish-template.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf /tmp/acs
Origin

Copies of this mod

1 near-identical copy found in the catalogue:

skills/agent-context-system/SKILL.md · 313 lines

How it starts

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

Agent Context System

The Problem

Agents start from zero every session. You spend an hour getting your coding agent up to speed on a project, close the session, and start from zero the next day. The agent forgot everything. Every session is a cold start.

This isn't a limitation of the model. It's a context delivery problem. The agents have the capacity to remember — they just don't have the right inputs at the right time in the right format.

The Solution

Two markdown files. One committed, one gitignored. The agent reads both at the start of every session and updates the local one at the end.

  • AGENTS.md — Your project's source of truth. Committed and shared. Always in the agent's prompt. Under 120 lines. Contains compressed project knowledge: patterns, boundaries, gotchas, commands, architecture.

  • .agents.local.md — Your personal scratchpad. Gitignored. Grows over time as the agent logs what it learns each session. Session notes, dead ends, preferences, patterns that haven't been promoted yet.

That's it. No plugins, no infrastructure, no background processes. The convention lives inside the files themselves, and the agent follows it.

How It Works

1. Setup

Run the init script. It creates .agents.local.md from a template, ensures it's gitignored, and wires up your agent tool's config (CLAUDE.md symlink for Claude Code, .cursorrules for Cursor, .windsurfrules for Windsurf, copilot-instructions.md for Copilot).

# If you cloned the template repo:
./scripts/init-agent-context.sh

# If you installed as a skill (npx skills add):
bash .agents/skills/agent-context-system/scripts/init-agent-context.sh

Then edit AGENTS.md with your project specifics: name, stack, commands, actual patterns and gotchas from your codebase. This is the highest-leverage edit you'll make.

2. During Sessions

The agent reads both files at session start. AGENTS.md gives it compressed project knowledge. .agents.local.md gives it accumulated learnings from past sessions. The agent now has context that persists across sessions.

Read the full file on GitHub · 313 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. 1mo ago First seen · 313 lines · 90 tokens per session scan C d32a1ea4c8cf

Subscribe to this mod's changes

agent-context-system is a skill published in the GitHub repository LeoYeAI/openclaw-master-skills (2,229 stars, last pushed 9d ago), licensed MIT. It adds 90 tokens to every session and 3,591 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-31.

Related

agent-context-system compared with skills from other repositories

agent-context-system next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
agent-context-systemLeoYeAI/openclaw-master-skillsSkill2.2k9d agoMITC90Claude Code, Codex
openclaw-auto-dreamLeoYeAI/openclaw-auto-dreamSkill5502mo agoMITA79Claude Code, Codex
context-degradationagent-skills-hub/agent-skills-hubSkill1382mo agoMITA21Claude Code, Codex
context-compressionagent-skills-hub/agent-skills-hubSkill1382mo agoMITA13Claude Code, Codex
context-optimizationagent-skills-hub/agent-skills-hubSkill1382mo agoMITA13Claude Code, Codex
openclaw-test-heap-leaksSafeAI-Lab-X/ClawKeeperSkill1.0kyesterdaynoneA104Codex
openclaw-memory-docsdavidtoby/agent-skillsSkill1111d agoMITA27Claude Code, Codex