pce-memory AGENTS.md

Instructions for pce-memory, a memory service that stores project decisions, conventions, preferences, and tasks so they can be recalled across coding sessions. It describes how to recall, record, review, link, and correct that knowledge.

In plain words
What is it for?
Use it to activate relevant project memory, record observations, turn them into lasting knowledge, connect related claims, audit the knowledge graph, or roll back outdated memory.
Why use it?
It reduces repeated explanations and helps an agent use earlier project decisions and rules when starting work, making designs, naming things, or investigating errors.

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/caphtech/pce-memory/agents-md
Clone the repo
git clone --depth 1 https://github.com/CAPHTECH/pce-memory

Made for: Codex, OpenCode.

Per session 3,566 This file is loaded in full into every session.
When invoked 3,566 The same file — it is already loaded in full.
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.03566 $0.03566
Opus 5 $0.01783 $0.01783
Sonnet 5 $0.00713 $0.00713
Haiku 4.5 $0.00357 $0.00357

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

Security

Grade A, and why

pce-memory AGENTS.md 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 yesterday.

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.

AGENTS.md · 367 lines

How it starts

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

pce-memory とは

プロジェクトの知識(設計決定、規約、好み、タスク)を永続化し、セッションを跨いで想起するためのMCPサーバーです。


利用フロー

1. activate     → タスク開始前に intent-aware な想起を行う(topology walk で関連 claim を自動展開)
2. observe      → 会話ログ・作業メモ・機密を raw micro memory として一時記録
3. distill      → raw 観測を durable 候補に蒸留
4. promote      → reviewable candidate を meso/macro memory に昇格
5. feedback     → 想起した知識の有用性をフィードバック
6. rollback     → 無効になった durable memory を append-only で修復(topology-based blast radius 付き)
7. link_claims  → claim 間のリンク作成(supports/extends/contradicts/supersedes/related)
8. graph_audit  → knowledge graph の健全性監査(orphan/cycle/scope hole/hub 検出)

upsertalready-distilled な durable knowledge の escape hatch としてのみ使ってください。通常の raw -> durable 変換経路では使いません。


いつ activate するか

以下の状況で pce_memory_activate を呼び出してください:

  • 新しいタスクを開始するとき - 関連する過去の決定を確認
  • 設計判断が必要なとき - 既存のアーキテクチャ決定を参照
  • 命名や規約を確認したいとき - プロジェクト固有のルールを想起
  • エラーに遭遇したとき - 過去の類似問題の解決策を検索
// 例: API設計前に関連知識を想起
{
  "intent": "design_decision",
  "q": "API 命名規約 RESTful",
  "scope": ["project", "principle"],
  "kind_filter": ["fact", "preference", "policy_hint"],
  "memory_type_filter": ["knowledge", "procedure", "norm"],
  "allow": ["answer:task"],
  "top_k": 10
}

いつ observe するか

以下の情報は pce_memory_observe で記録してください:

  • session スコープの作業文脈 - 「このファイルを編集中」「デバッグ中の仮説」
  • 生ログや一時メモ - チャット断片、ツール出力、HTTPレスポンス、ファイル読み取り結果
  • secret/PII を含む可能性がある内容 - fail-safe に一時保存し、durable claim 化しない
// 例: セッション作業メモを一時記録
{
  "source_type": "chat",
  "content": "Issue #65 の observe 互換経路を削除中"
}

補足:

  • observe は raw-only です。durable claim を inline で作成しません
  • single_claim_v0 のような旧 extraction mode は使いません
  • extract: { \"mode\": \"noop\" } は互換性のために残っていても raw-only のままです
  • durable 化したい場合は distill -> promote を使ってください

いつ upsert するか

以下の情報だけを pce_memory_upsert で記録してください:

  • すでに distill 済みとみなせる durable knowledge
  • project または principle に置くべき確定事項
  • provenance を付けて追跡可能にしたい事実・好み・手順・ポリシー
  • 技術・ファイル・概念の関係が明確な場合は、entities / relations も同じ upsert に含めてください

Read the full file on GitHub · 367 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. yesterday First seen · 367 lines · 3,566 tokens per session scan A a9767c5200bd

Subscribe to this mod's changes

pce-memory AGENTS.md is an instructions file published in the GitHub repository CAPHTECH/pce-memory (3 stars, last pushed 5mo ago), licensed MIT. It adds 3,566 tokens to every session, about $0.0178 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-31.

Related

Other instructions, from other repositories

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,182 tokens

buildNext

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

next.js AGENTS.md

Instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

spec-kit AGENTS.md

Instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,040 tokens

langchain AGENTS.md

Instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,345 tokens