observer

A helper agent that detects recurring patterns in an AI coding session and evaluates how reliable those patterns are.

In plain words
What is it for?
Use it with session notes, recent Git history, changed files, tool-use logs, and pattern summaries to produce candidate coding instincts with evidence and confidence scores.
Why use it?
It helps turn repeated observations from past work into possible reusable habits or guidance.

Agent

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 agents/morodomi/dev-crew/observer
Clone the repo
git clone --depth 1 https://github.com/morodomi/dev-crew
Per session 42 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,185 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.00042 $0.01185
Opus 5 $0.00021 $0.00593
Sonnet 5 $0.00008 $0.00237
Haiku 4.5 $0.00004 $0.00119

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

Security

Grade A, and why

observer 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/observer.md · 111 lines

How it starts

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

Observer - パターン検出エージェント

learn スキルから Task tool で呼び出されるサブエージェント。

呼び出し方式

learn スキルが以下の形式で起動:

Task(subagent_type: "dev-crew:observer", model: "sonnet", prompt: "...")

Input

learn スキルから以下の情報を受け取る:

Field Description
cycle_doc 直近の Cycle doc 内容
git_log git log --oneline -20 の出力
changed_files git diff --name-only の出力
user_notes ユーザーからの補足情報
observations ${CLAUDE_PLUGIN_DATA}/observations/log.jsonl のツール使用ログ
tfidf_summary learn が算出した TF-IDF サマリ (term, tf, idf, tfidf, count, sessions)

Output

検出した instinct の JSON 配列:

[
  {
    "trigger": "PHPStan error on array access",
    "action": "Add null check before array access",
    "confidence": 0.7,
    "domain": "php",
    "evidence": ["cycle_doc reference", "git log abc123"]
  }
]

信頼度スコア計算

TF-IDF + COUNT の2軸でスコアリング:

confidence = tfidf_to_base(tfidf_score) * evidence_multiplier(count)

tfidf_to_base: TF-IDF → ベーススコア (パターンの特徴度)

TF-IDF ベーススコア 判定
< 0.2 破棄 baseline 行動 (discard)
0.2 - 0.5 0.5 やや特徴的
0.5 - 1.0 0.7 特徴的
>= 1.0 0.85 非常に特徴的

evidence_multiplier: COUNT → 信頼度係数 (証拠の量)

COUNT 係数 判定
< 3 破棄 証拠不足 (discard)
3 - 10 0.8 限定的な証拠
11 - 30 0.9 中程度の証拠
>= 31 1.0 十分な証拠

tfidf_summary が未提供 (ブートストラップ期間) の場合、以下のフォールバックを使用:

観測回数 confidence 判定
1-2 回 0.3 低信頼 (learn 側で破棄)
3-5 回 0.5 中信頼 (保存)
6-10 回 0.7 高信頼 (保存)
11 回+ 0.85 非常に高信頼 (保存)

observations からのパターン抽出ルール

observations (log.jsonl) の各行は {timestamp, session_id, tool_name, target} 形式。 以下のルールでツール使用ログからパターンを検出する:

パターン 検出条件
繰り返しファイル編集 同一 target への Edit/Write が 3+ 回 設定ファイルの試行錯誤
コマンドシーケンス 同一 session_id 内で tool_name の列が 3+ 回反復 Read→Edit→Bash の繰り返し
ツール選好 特定 tool_name の使用頻度が突出 Grep を多用
セッション横断パターン 異なる session_id で同一 target が出現 同じファイルを毎回修正

Read the full file on GitHub · 111 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 · 111 lines · 42 tokens per session scan A e91086b1a715

Subscribe to this mod's changes

observer is an agent published in the GitHub repository morodomi/dev-crew (1 stars, last pushed 3d ago), licensed MIT. It adds 42 tokens to every session and 1,185 once invoked, about $0.0002 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.