Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By Mao-ov0.12.4MITIn 1 marketplace
セッション開始時にリポジトリを分析し、スタック/スクリプト/env キー/ドメイン型のファクトバンドルを Markdown で注入する hook。SessionStart と SubagentStart(Explore/Plan) で発火
Claude loads one when your task matches it, or you run it by name.
No risk signals detected
Nothing flagged in this plugin's hooks, MCP servers or commands. Other components are not analyzed.
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
session-start, subagent-start, context-injection, repo-facts, markdown, hooks, detectors, collectors
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
セッション開始時にリポジトリを分析し、スタック・スクリプト・env キー・ドメイン型などの コンパクトなファクトバンドル を Markdown で生成してエージェントのコンテキストに注入する hook。
| タイミング | 用途 | コマンド差分 |
|---|---|---|
SessionStart | 本体セッション開始時に 1 回だけ注入 | --no-recent-commits 付き |
SubagentStart (matcher: Explore) | 探索系サブエージェント起動時に注入 | --emit subagent-json 付き |
SubagentStart (matcher: Plan) | 設計系サブエージェント起動時に注入 | --emit subagent-json 付き |
ベースコマンド (timeout は各 hook で 15 秒):
python3 "${CLAUDE_PLUGIN_ROOT}/hooks/session-facts" --format markdown --include-domain-types
SessionStart の --no-recent-commits — Claude Code CLI 本体が main セッションの
system prompt に gitStatus (current branch / 直近 commit / status) を常時注入するため、
recent_commits を重ねると同一事実の二重ソースになる (実セッションで重複を確認済み)。
この注入は hook 機構ではなく system prompt 構築の一部のため hooks ドキュメントには
載っていない。gitStatus 注入が無い環境で使う場合は hooks.json から
--no-recent-commits を外せば従来出力に戻る (CLI 単体のデフォルトは出力する側)。SubagentStart の --emit subagent-json — SubagentStart では plain stdout が
モデルに届かない (公式仕様: plain stdout の自動注入は SessionStart のみ)。
hookSpecificOutput.additionalContext JSON に包んで注入する。subagent には
gitStatus が注入されないため、こちらの recent_commits は維持する。同梱の SubagentStart hook は matcher: "Explore" / matcher: "Plan" の 2 つに固定
されている。他のカスタム subagent (.claude/agents/ 配下に自作したもの) の起動時にも
同じ facts 注入を効かせたい場合、公式の matcher はビルトイン名だけでなくカスタム
subagent の frontmatter name フィールドの値にもマッチできる (ファイル名ではない)。
~/.claude/settings.json (または project の .claude/settings.json) に自分で
同じコマンドを登録すればよい。例えば name: MyAgent という agent なら:
{
"hooks": {
"SubagentStart": [
{
"matcher": "MyAgent",
"hooks": [
{
"type": "command",
"command": "python3 /absolute/path/to/plugins/session-facts/hooks/session-facts --format markdown --include-domain-types --emit subagent-json",
"timeout": 15
}
]
}
]
}
}
${CLAUDE_PLUGIN_ROOT} は plugin 同梱の hooks.json 内でこの plugin 用に解決される
変数なので、settings.json に直接書く場合は展開に頼らず絶対パスを使う (自動注入された
- more: 行に出る invoked_as の絶対パスがそのまま使える)。--emit subagent-json は
SubagentStart で plain stdout がモデルに届かないための必須フラグ (前述の理由を参照)。
/plugin marketplace add Mao-o/cc-mp-worktools
/plugin install session-facts@mao-worktools
有効化すると SessionStart と SubagentStart(Explore|Plan) の hook が自動登録される。
settings.json を手で編集する必要はない。
開発時はローカルパスを直接ロードする方が速い:
claude --plugin-dir /path/to/cc-mp-worktools/plugins/session-facts
同梱 hooks/hooks.json の SessionStart は "matcher": "startup|clear|compact" で、
resume / fork (--resume / --continue / /resume / /fork) では発火しない。
再開されたセッションには最初の注入が transcript に残っており、同じ 80〜180 行を
もう一度注入しても二重化するだけのため。compact は文脈が失われた後の再注入として
有用なので残す。Codex 向け hooks/codex-hooks.json は Codex 側の source 値の違いに
合わせて startup|resume のままにしている。
起動時に以下のパイプラインを実行し、Markdown 文字列を stdout に出力する。
git ls-files (fallback: filesystem walk) で tracked files 一覧を取得description → pyproject [project] / [tool.poetry] description → pubspec / Cargo.toml / composer.json description → README の最初の散文行。HTML ブロック・バッジ/リンク行・記号や絵文字で始まる行は飛ばす。どれも無ければ field ごと省略)出力例 (抜粋):
## Project Facts
- purpose: a monorepo of web apps and shared packages
- repo_root: /absolute/path/to/repo
- stack: typescript, next, python, monorepo
- workspaces: apps/web (pnpm: nextjs, react), packages/core (python: fastapi)
- major_dependencies: [email protected], [email protected], [email protected]
- branch: feat/login (ahead 3, behind 1 vs origin/main)
- recent_commits:
- a1b2c3d feat(auth): add login flow (8 hours ago)
- d4e5f6g fix(api): handle empty payload (1 day ago)
## Structure (dirs only, depth=4)
├── apps/web/src/
└── packages/
├── core/
└── ui/
## Service Entry Points
- apps/web/src/api/users/route.ts
- apps/web/src/services/userService.ts
## Test Snapshot
- code_files: 38
- test_files: 8
- test_to_code_ratio: 0.21
- test_dir: packages/*/tests
各 Collector が出すセクション粒度は --max-* 引数で制限可能。
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub mao-o/cc-mp-worktools --plugin session-factsPlugins from other owners that cover similar ground