causal-memory CLAUDE.md

causal-memory CLAUDE.md is an instructions file for Claude Code from JingxuanC/causal-memory. It costs 680 tokens per session, scanned A, original, Apache-2.0.

A set of instructions for connecting coding agents to causal memory, a system that records past decisions and what happened afterward.

In plain words
What is it for?
It helps search past decisions, assess risks, and save whether an architecture, debugging, library, or deployment choice led to a particular result.
Why use it?
It encourages agents to look up relevant lessons before difficult decisions and record outcomes afterward, reducing repeated mistakes across sessions.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md; mentions AGENTS.md.

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/jingxuanc/causal-memory/claude-md
Clone the repo
git clone --depth 1 https://github.com/JingxuanC/causal-memory

Made for: Claude Code.

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 causal-memory CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/jingxuanc/causal-memory/claude-md.svg)](https://agentmods.dev/instructions/jingxuanc/causal-memory/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/jingxuanc/causal-memory/claude-md"><img src="https://agentmods.dev/badge/instructions/jingxuanc/causal-memory/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 680 This file is loaded in full into every session.
When invoked 680 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.1 $0.00680 $0.00680
Opus 5 $0.00340 $0.00340
Sonnet 5 $0.00136 $0.00136
Haiku 4.5 $0.00068 $0.00068

Measured yesterday against content hash 35c266b58309, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

causal-memory CLAUDE.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.

CLAUDE.md · 67 lines

How it starts

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

Causal Memory MCP Integration

Paste this into your CLAUDE.md / AGENTS.md / system prompt to activate causal memory.

Per insights/13 §1.3: agents don't proactively call memory tools without instruction. This prompt forces proactive use.

Causal Memory Integration

You have access to a causal memory layer via MCP tools. This records your past decisions and their outcomes, so you can learn from experience across sessions.

Before any non-trivial decision (architecture choice, debugging approach,

library selection, deployment strategy):

  1. Call search_memory with your query — it searches facts AND causal lessons at once (RRF-fused). If you know you need causal lessons specifically, call search_causal with the relevant task_tag
  2. For risky or irreversible actions, also call intervention_query to see what outcomes similar past actions caused (safe / warning / danger)
  3. When choosing between two concrete options, call counterfactual_query with both option texts — it compares recorded outcomes, shows same-context branches (natural experiments) when they exist, and logs a falsifiable prediction that resolves automatically when either option is later recorded
  4. If past experience is relevant, incorporate it into your approach

After acting on a decision and observing the result:

  1. Call record_decision with:
    • decision: what you decided
    • outcome: what actually happened
    • relation: caused / enabled / prevented / no_effect
    • task_tag: the task category
    • confidence_source: temporal / rule / llm_inferred / user_feedback
    • context (important): a short description of the situation the decision was made in (environment, constraints, key parameters). Decisions with the same task_tag + context become comparable branches — this is what powers same-context counterfactual evidence. If you weighed multiple options at this decision point, ALWAYS record the context.

When you learn a stable fact (preference, tech stack, config):

Read the full file on GitHub · 67 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 Changed · +14 lines · +169 tokens per session 35c266b58309
  2. 6d ago First seen · 53 lines · 511 tokens per session scan A 2f7e24fe192e

Subscribe to this mod's changes

causal-memory CLAUDE.md is an instructions file published in the GitHub repository JingxuanC/causal-memory (67 stars, last pushed 3d ago), licensed Apache-2.0. It adds 680 tokens to every session, about $0.0034 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.

Related

Other instructions, from other repositories

task-passport AGENTS.md

Instructions for dongsheng123132/task-passport, covering task-passport / taskpack — 开机文档, 这是什么, 最原创的那一条(别改掉它), 常用命令 and 当前状态摘要(详细版在护照里,以护照为准).

dongsheng123132/task-passport · 1,414 tokens

dsh-plugin-coaligne AGENTS.md

AGENTS.md instructions for dataelement/dsh-plugin-coaligne: This repository is a standalone DeepSeek Harness plugin that connects DSH to CoAligne shared project context. It follows the omdsh-dev/plugin-template contract.

dataelement/dsh-plugin-coaligne · 278 tokens

dsh-config-manager AGENTS.md

AGENTS.md instructions for xiajiajun516/dsh-config-manager, covering agents.md — dsh config manager 仓库协作指南, 🌐 语言, 📦 概览, 🗂️ 结构与分层 and ui 分层铁律.

xiajiajun516/dsh-config-manager · 4,292 tokens

dsh-industry-research AGENTS.md

AGENTS.md instructions for PerryLink/dsh-industry-research, covering agents.md, layout, hard rules applied here, checks and release.

PerryLink/dsh-industry-research · 1,388 tokens

dsh-checkpoint-rewind AGENTS.md

AGENTS.md instructions for PerryLink/dsh-checkpoint-rewind, covering agents.md, 仓库布局:发布面 / 本地工程面, 命令, 提交纪律 and dsh 插件约束(红线).

PerryLink/dsh-checkpoint-rewind · 2,213 tokens

star-dsh-desktop AGENTS.md

AGENTS.md instructions for dabaicai001/star-dsh-desktop, covering agents.md — starhub 协作指引, 项目是什么, 架构一句话, 目录结构 and 技术栈速查.

dabaicai001/star-dsh-desktop · 3,139 tokens