agent-context-system

A persistent local memory system for coding agents using two Markdown files: one shared project guide and one private, ignored scratchpad.

In plain words
What is it for?
Use it to record architecture, commands, boundaries, session learnings, and patterns that may later be promoted into the shared project guide.
Why use it?
It prevents agents from starting every session without the project’s conventions, past discoveries, and unresolved notes.

Skill for Claude CodeCodex

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 skills/andreagriffiths11/agent-context-system/github-copilot
Any agent
npx skills add AndreaGriffiths11/agent-context-system --skill github-copilot
Clone the repo
git clone --depth 1 https://github.com/AndreaGriffiths11/agent-context-system

Made for: Claude Code, Codex.

Per session 53 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,054 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.00053 $0.01054
Opus 5 $0.00026 $0.00527
Sonnet 5 $0.00011 $0.00211
Haiku 4.5 $0.00005 $0.00105

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

Security

Grade A, and why

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

github-copilot/SKILL.md · 81 lines

How it starts

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

Agent Context System

Agents start from zero every session. This skill solves that with two markdown files: one committed (AGENTS.md), one gitignored (.agents.local.md). You read both at session start, update the scratchpad at session end, and promote stable patterns over time.

The Two-File System

  • AGENTS.md — Project source of truth. Committed and shared. Under 120 lines. Contains compressed project knowledge (patterns, boundaries, gotchas, commands, architecture).
  • .agents.local.md — Personal scratchpad. Gitignored. Grows over time as you log what you learn each session. Session notes, dead ends, preferences, patterns waiting for promotion.

Workflow

1. Initialize

Run ./scripts/init-agent-context.sh to create .agents.local.md from template, ensure it's gitignored, and wire up agent tool configs.

2. Work

Read both files at session start. AGENTS.md gives compressed project knowledge. .agents.local.md gives accumulated learnings from past sessions.

3. Grow

At session end, append to the scratchpad's Session Log: what changed, what worked, what didn't, decisions made, patterns learned.

4. Compress

When the scratchpad hits 300 lines, compress: deduplicate, merge related entries, keep it tight.

5. Promote

During compression, if a pattern recurs across 3+ sessions, flag it in the scratchpad's "Ready to Promote" section. The human decides when to move it into AGENTS.md.

Get Started

When a user asks about setting up agent context:

  1. Check if AGENTS.md exists. If not, they need to copy it from this template or create from scratch. Read the template at the root of this repo for reference.

  2. Check if .agents.local.md exists. If not, run ./scripts/init-agent-context.sh to set it up from template.

  3. Check if .agents.local.md is gitignored. If not, add .agents.local.md to .gitignore.

  4. Ask which agents they use. The init script can wire up Claude Code (CLAUDE.md symlink), Cursor (.cursorrules), Windsurf (.windsurfrules), or Copilot (copilot-instructions.md).

Read the full file on GitHub · 81 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 · 81 lines · 53 tokens per session scan A 4dd04862c08b

Subscribe to this mod's changes

agent-context-system is a skill published in the GitHub repository AndreaGriffiths11/agent-context-system (24 stars, last pushed 1mo ago), licensed MIT. It adds 53 tokens to every session and 1,054 once invoked, about $0.0003 per session on Opus 5. 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.