CTX CLAUDE.md

CTX is an automatic context-injection system for Claude Code, using hooks to add memories, documents, code-search hints, and reminders to conversations.

In plain words
What is it for?
Use it when configuring or troubleshooting Claude Code hooks for conversation memory, document search, code search fallback, or decision recording.
Why use it?
It helps the agent recover relevant past decisions and project information without requiring the user to find and paste it manually.

Instructions file

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/pluto2060/ctx/claude-md
Clone the repo
git clone --depth 1 https://github.com/pluto2060/CTX
Per session 3,854 This file is loaded in full into every session.
When invoked 3,854 The same file — it is already loaded in full.
Security scan B 1 finding. 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.03854 $0.03854
Opus 5 $0.01927 $0.01927
Sonnet 5 $0.00771 $0.00771
Haiku 4.5 $0.00385 $0.00385

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

Security

Grade B, and why

CTX CLAUDE.md scanned grade B 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 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

**single source of truth = `~/.claude/settings.json`의 `hooks` 블록.** 아래 표는 2026-04-19 시점에서 그 파일로부터 검증한 실제 wired hook만 기재.
CLAUDE.md · 246 lines

How it starts

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

CTX — Context Bootstrapper for Claude Code (updated 2026-04-19)

새 CTX 정의 — 실제 production 구성 (settings.json 기준)

CTX = Claude Code의 자동 context 주입 시스템. single source of truth = ~/.claude/settings.jsonhooks 블록. 아래 표는 2026-04-19 시점에서 그 파일로부터 검증한 실제 wired hook만 기재.

현재 wired hooks (production)

Hook 파일 Event 역할 현재 상태
chat-memory ~/.claude/hooks/chat-memory.py UserPromptSubmit CM: vault.db FTS5 + vec0 hybrid (α=0.5 cosine + 0.5 bm25) — 과거 대화 회상 ✅ hybrid 작동 (vec-daemon 필요); 대체 fallback = BM25-only + ⚠ vec-daemon down 표시
bm25-memory ~/.claude/hooks/bm25-memory.py UserPromptSubmit (--rich) G1 (의사결정) + G2-DOCS (docs/research/.md + CLAUDE/MEMORY) + G2-PREFETCH (codebase-memory-mcp) + G2-HOOKS (~/.claude/hooks/.py BM25 검색) — 단일 hook에 통합 ✅ 프로덕션. pure BM25 (semantic rerank 없음). git-memory.py + g2-augment.py 대체
memory-keyword-trigger ~/.claude/hooks/memory-keyword-trigger.py UserPromptSubmit 결정 키워드(제외/kill/중단/데드라인 등) 감지 → MEMORY.md 즉시 기록 유도 ✅ 프로덕션. 저장은 Claude가 수행
g2-fallback ~/.claude/hooks/g2-fallback.py PostToolUse (Grep) Grep 실패/빈약 결과 감지 → mcp__code-search__search_code 힌트 주입 ✅ 프로덕션
vec-daemon startup guard ~/.claude/settings.json SessionStart SessionStart vec-daemon 실 연결 probe → 죽어있으면 rm stale socket + 재시작 (2026-04-17 수정) ✅ 프로덕션

은퇴한 / 아카이브 hooks (wired 아님, 실행 안 됨)

파일 상태 은퇴 근거
git-memory.py retiredbm25-memory.py에 의해 대체 (bm25-memory.py docstring 자체가 "Replaces git-memory.py"로 명시) recall 0.169 proactive → BM25 reactive로 성능 개선
g2-augment.py retiredbm25-memory.py G2-PREFETCH 블록에 흡수 동일
auto-index.py wired 아님 — settings.json에 없음. 코드는 존재하나 Claude Code가 invoke 안 함 codebase-memory-mcp는 auto-index 없이 stale-on-demand로 관리

2026-04-17 세션 주의: 이번 세션의 iter 1-15 작업 대부분은 git-memory.pyauto-index.py에 대한 편집이었으나, 두 파일 모두 production에 wired 되어 있지 않음 → 해당 편집은 파일에 남아있지만 실제로 실행되지 않음. 진짜 production 영향이 있는 편집은 chat-memory.py(iter 2 ⚠ 표시, iter 15 telemetry) 뿐.

Read the full file on GitHub · 246 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 · 246 lines · 3,854 tokens per session scan B b7468f3b56a9

Subscribe to this mod's changes

CTX CLAUDE.md is an instructions file published in the GitHub repository pluto2060/CTX (9 stars, last pushed 3mo ago), licensed MIT. It adds 3,854 tokens to every session, about $0.0193 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). 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