Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "#813"
goal_ref: "context-mode MCP を Claude Code に段階的導入し、大出力を扱う read-only 調査補助として運用する"
change_kind: workflowParent Issue
Parent Goal Ref
context-mode MCP を Claude Code に段階的導入し、大出力を扱う read-only 調査補助として運用する(#813)
Current Objective
Claude Code の main profile ではなく実験用 profile に限定して context-mode を導入し、installed version / release provenance / ctx-doctor / registered MCP tools を evidence artifact として記録する。
Background
context-mode は Claude Code plugin として MCP tools / hooks を登録する。Claude Code 公式 docs は MCP server を信頼できる場合のみ利用するよう警告しているため、導入作業は main profile ではなく実験用 profile で行う。
upstream context-mode v1.0.162 は GitHub Releases 上で Latest と表示されているが、実際に導入された package / plugin がその version であることは local evidence で確認する。
Outcome
Claude Code 実験用 profile で context-mode が起動し、version / doctor / registered tools / config diff が artifact 化される。ctx_execute と ctx_fetch_and_index はこの Issue では許可しない。
Current Validated Scope
- 実験用 profile への context-mode 導入確認
- version / provenance / doctor / tools inventory の artifact 化
- main profile 隔離の evidence 確認
Remaining Parent Gaps
- 実装: context-mode deny rule を secret / token / config negative test 付きで fail-closed 化する #825: deny rule negative test(ctx_execute / ctx_fetch_and_index の自己申告禁止)
- 調査: context-mode ctx_execute の worktree cwd 安全性を検証し quarantine 方針を固定する #826: ctx_execute cwd quarantine
- 実装: context-mode ctx_fetch_and_index を CTX_FETCH_STRICT=1 と network negative test で隔離する #827: ctx_fetch_and_index + CTX_FETCH_STRICT=1 negative test
- 実装: context-mode の persistence / purge / ELv2 notice policy を docs 化する #828: persistence / purge / ELv2 notice policy
Required Skills
- Claude Code plugin / MCP server 設定
- artifact 構造化保存と redaction
- profile isolation evidence 採取
In Scope
- Claude Code 実験用 profile 用の context-mode MCP 設定追加
- installed version / release tag / package location / plugin registration の記録
ctx-doctor実行結果の記録- registered MCP tools の一覧化
- main profile からの隔離確認
- evidence artifact 作成
- artifact redaction(home path マスク、token-like value 不在、env dump 不含)の確認
Out of Scope
ctx_executeの許可ctx_fetch_and_indexの許可- deny rule の本実装
- Codex CLI 導入
- build / test / git 操作の context-mode 経由実行
Acceptance Criteria
- AC1: Claude Code 実験用 profile / scope の定義が artifact に保存され、context-mode がその scope で起動する
- AC2: installed version / package location / release tag / package hash / plugin manifest version が
version-provenance.jsonに保存されている - AC3:
ctx-doctorが error なしで完了し、redacted JSON がctx-doctor-result.jsonに保存されている - AC4: registered MCP tools の一覧が
registered-tools.jsonに保存され、期待 tool set(ctx_batch_execute / ctx_execute / ctx_execute_file / ctx_index / ctx_search / ctx_fetch_and_index / ctx_stats / ctx_doctor / ctx_upgrade / ctx_purge / ctx_insight の 11 tools)と一致する - AC5:
ctx_executeとctx_fetch_and_indexは registered されていても permission policy 上 deny であり、permission_policyフィールドにdenyが記録され、実行 evidence がない - AC6: main profile / main settings / production Claude Code profile が変更されていないことが
profile-isolation.jsonに保存されている(main_profile_touched: falseを含む) - AC7: rollback 手順が
docs/dev/agent-ops/context-mode-rollback.mdまたは Issue comment に記録され、plugin disable/remove / MCP server unregister / settings diff revert /CONTEXT_MODE_DIR配下 purge //reload-plugins//mcp再確認の手順を含む
Verification Commands
# AC2
$ test -f .claude/artifacts/context-mode/version-provenance.json
# AC3
# preflight-scope: runtime_only
$ test -s .claude/artifacts/context-mode/ctx-doctor-result.json
# AC4
# preflight-scope: runtime_only
$ test -s .claude/artifacts/context-mode/registered-tools.json
# AC5
# preflight-scope: runtime_only
$ uv run pytest tests/context_mode/test_artifact_schema.py::test_deny_policy -v
# AC6
# preflight-scope: runtime_only
$ test -s .claude/artifacts/context-mode/profile-isolation.json
# preflight-scope: runtime_only
$ uv run pytest tests/context_mode/test_artifact_schema.py::test_profile_isolation -v
# AC1
# preflight-scope: runtime_only
$ uv run pytest tests/context_mode/test_artifact_schema.py -v
# AC7
# preflight-scope: pr_review_only
$ test -f docs/dev/agent-ops/context-mode-rollback.mdAllowed Paths
.claude/settings.json.claude/hooks/**.claude/artifacts/context-mode/**docs/dev/agent-ops/**tests/context_mode/**
Artifact Schema
.claude/artifacts/context-mode/ に保存する JSON は以下の redaction 条件を満たす:
- home directory path はマスク済み
- token-like value は不含
- env dump は不含または allowlisted
- package location は basename + hash に限定
- indexed content DB dump は不含
必須ファイル:
ctx-doctor-result.json—ok: boolフィールドを含むregistered-tools.json—registered_tools: listとpermission_policy: dictを含むversion-provenance.json—installed_version: strを含むprofile-isolation.json—main_profile_touched: boolを含むconfig-diff.jsonrollback.md
Runtime Verification Applicability
decision: immediate
reason: Claude Code plugin 起動、MCP registration、ctx-doctor、profile isolation は実行環境でのみ確認できるため
applicable_acs: AC1, AC3, AC4, AC5, AC6
execution_environment: Claude Code 実験用 profile(local scope、main profile 非影響)
skip_conditions: 実験用 profile セットアップが完了していない場合は VC をスキップし PR に skip 理由を記録する
fallback_policy: runtime artifact が取得できない AC は SKIP 扱いとし、human reviewer が証跡を確認する
artifact_requirements: AC1/AC3/AC4/AC5/AC6 の evidence は .claude/artifacts/context-mode/ に保存し PR に添付する
Stop Conditions
- main profile への設定変更が必要になった場合
ctx-doctorが permission / hook / MCP registration error を出す場合- installed version / package provenance が確認できない場合
ctx_executeまたはctx_fetch_and_indexの許可が必要になった場合- 実装: Claude / Codex hook の stdout policy と compaction 時 loop state 保存・復元 hint を fixture 検証付きで整備する #797 が open のまま
.claude/settings.json/.claude/hooks/**の変更が必要になった場合 - 実験用 profile / scope の機構を公式 docs または local evidence で説明できない場合
- artifact に token-like value / unredacted home path / env dump が含まれる場合
- registered tool と permission policy の区別を artifact 化できない場合
Delivery Rule
- 1 Issue = 1 PR
- Draft PR 既定
- 実装: Claude / Codex hook の stdout policy と compaction 時 loop state 保存・復元 hint を fixture 検証付きで整備する #797 が
.claude/settings.json/ hooks を変更中の場合は merge order を直列化する
Activity
squne121 commentedon Jun 13, 2026
判定: REQUEST_CHANGES
#824 の方向性は妥当です。
ctx_executeとctx_fetch_and_indexをこの段階で禁止し、Claude Code の main profile ではなく実験用 profile に限定し、version / provenance / doctor / tools を artifact 化する設計は、親 #813 のリスク認識と整合しています。#824 自体にコメントはありませんが、親 #813 には REQUEST_CHANGES 相当のレビューコメントがあり、そこで指摘された「deny の自己申告禁止」「#797 との直列化」「provenance evidence 化」の要求を #824 はまだ十分に吸収できていません。良い点
#824 は、親 #813 の child 1 としてスコープを「導入確認・provenance・doctor・tools inventory」に絞っており、
ctx_execute/ctx_fetch_and_index/ Codex CLI / build-test-git 実行を out of scope にしている点は正しいです。context-mode 側の README でも Claude Code plugin はctx_executeやctx_fetch_and_indexを含む 11 MCP tools と hooks を登録するため、最初の Issue で「登録確認」と「利用許可」を分ける必要があります。 ([GitHub]1)また、context-mode upstream は v1.0.162 が Latest と表示されており、#824 が「GitHub Releases 上の表示ではなく、実際に入った package/plugin の version を local evidence で確認する」としている点も妥当です。 ([GitHub]1)
Blockers
1. AC5 の Verification Command が逆に危険
#824 の AC5 は「
ctx_executeとctx_fetch_and_indexが許可されていないこと」ですが、VC は次です。rg -n "ctx_execute|ctx_fetch_and_index" .claude/settings.jsonこれは「文字列が存在すること」を確認するだけです。deny rule として存在しても pass、allow rule として存在しても pass、単なるコメントとして存在しても pass します。つまり AC5 の検証としては破綻しています。
修正方針は、
rgではなく構造化検証にすることです。最低限、artifact にregistered_toolsとpermission_policyを分けて保存し、次を検査してください。かつ、「登録されているが許可されていない」状態を pass と定義するべきです。plugin は仕様上 11 tools を登録するため、
ctx_executeが登録一覧にあること自体を fail にしてはいけません。([GitHub]1)2. 「実験用 profile」が実装上定義されていない
Claude Code 公式 docs が明示している MCP のスコープは local / project / user であり、local は current project only だが
~/.claude.jsonに保存、project は.mcp.jsonとして version control 共有、user は全 project です。#824 の「実験用 profile」は、この公式スコープのどれとも対応が明記されていません。([Claude API Docs]2)このままだと、
.claude/settings.jsonを編集して「実験用 profile」と主張する実装が通ります。しかしそれは repo 側の project 設定を変えるだけで、main profile 隔離の証明にはなりません。#824 は、profile isolation の evidence として以下を要求すべきです。特に plugin-provided MCP servers は plugin 有効化時に自動起動し、通常の
/mcpcommand 管理とは異なるため、単なる.claude/settings.jsondiff だけでは隔離証明になりません。([Claude API Docs]2)3. Runtime Verification Applicability が欠落している
repo の runtime verification policy は、全 Issue に
not_applicable | immediate | deferredの判定を要求しています。#824 は Claude Code plugin 起動、MCP tool registration、ctx-doctor、profile isolation を扱うので静的検証では完結しません。これはimmediateです。#824 には次を追加すべきです。
あわせて AC1 / AC3 / AC4 / AC5 / AC6 には
<!-- runtime-verification: true -->を付与してください。policy 上、immediateなのに runtime tag がない場合は blocker です。4. #797 との競合が Stop Condition 止まりで弱い
#797 は
.claude/settings.json/.claude/hooks/**を対象に、Claude / Codex hook stdout policy と compaction state 復元を fixture 検証付きで整備する Issue です。#824 も同じ.claude/settings.json/.claude/hooks/**を Allowed Paths に含めています。親 #791 は hook stdout / compaction 規律を token/context 浪費削減 parent の一部として扱っており、#797 はその child です。#824 が context-mode hooks や MCP routing を先に入れると、#797 の stdout policy / context injection policy と衝突します。
修正は二択です。
blocked_by: "#797"にする。.claude/settings.json/.claude/hooks/**を触らず、artifact/docs だけに限定する。今の「conflict が発生したら Stop」では、実装者が先に settings/hooks を編集してから止まる可能性があります。
5.
ctx_executeは read-only でも安全ではないupstream #756 は open で、
ctx_executeが session の worktree ではなく MCP server の process cwd、つまり main checkout 側で実行される問題を報告しています。報告ではgit statusや build/lint が wrong tree に対して成功し得るため、読み取り系コマンドでもレビュー判断を壊します。([GitHub]3)さらに context-mode README 自体も、
ctx_executeは subprocess を起動し、gh/aws/gcloud/kubectl/dockerなどが environment variables と config paths を継承すると説明しています。stdout だけが会話に入るとしても、実行環境の credential surface は残ります。([GitHub]1)#824 の out of scope は正しいですが、AC と artifact に「実行していないこと」を残す必要があります。単に settings に deny を書くのではなく、doctor/tools inventory に
invoked_tools: []またはctx_execute_invoked: falseを含めるべきです。6.
ctx_fetch_and_indexは child #827 まで default deny に固定すべきcontext-mode README は、
ctx_fetch_and_indexが URL を fetch して chunk/index し、TTL cache を使うと説明しています。さらに strict mode はCTX_FETCH_STRICT=1で loopback / RFC1918 / ULA を追加ブロックしますが、README 上は hosted/CI/shared service 向けの強化設定です。([GitHub]1) ([GitHub]1)#813 は
ctx_fetch_and_indexを child #827 の strict negative test まで deny としているため、#824 では「未許可」を permission policy と evidence の両方で固定すべきです。7. artifact の schema と redaction 方針がない
#824 は
.claude/artifacts/context-mode/**を許可していますが、artifact が何を含むかが未定義です。context-mode の debug/doctor 系は OS/runtime/config/env/session DB などを集約し得ます。README では一部 redaction があると説明されていますが、repo に保存する artifact については loop-protocol 側の secret policy を通す必要があります。([GitHub]1)最低限、次の artifact を固定してください。
各 JSON は次を満たすべきです。
8. Rollback AC7 が弱い
AC7 は「Issue comment または docs に rollback 手順」とだけ書いています。これでは「plugin を消す」「settings を戻す」「context-mode storage を purge する」「Claude Code を reload/restart する」「main profile 非影響を再確認する」のどこまでが rollback なのか曖昧です。
context-mode には
/context-mode:ctx-purgeがあり、indexed content を削除する機能が説明されています。rollback 手順には、plugin disable/remove、MCP server unregister、settings diff revert、CONTEXT_MODE_DIR配下 purge、/reload-plugins、/mcp再確認まで含めるべきです。([GitHub]1)#824 本文に入れるべき修正案
推奨する検証の方向
#791 系の PR #801 / #802 は、自己申告ではなく strict schema、fixture、machine-readable TEST_VERDICT に寄せています。#824 も同じ品質に寄せるべきです。
最小でも以下を入れてください。
さらに、
registered_toolsとpermission_policyを JSON として検証します。rgだけでは不十分です。最終提案
#824 は「実験用 profile で導入して evidence を採る」という方向なら進めてよいです。ただし、現行の Issue 契約のまま実装に渡すと、
ctx_execute/ctx_fetch_and_indexの未許可確認、main profile 隔離、#797 との競合、artifact redaction がすべて自己申告になります。修正後の merge order は次が安全です。
.claude/settings.json/.claude/hooks/**変更を除外。ctx_executecwd quarantine。ctx_fetch_and_index+CTX_FETCH_STRICT=1negative test。ELv2 については、内部利用・fork・modify・distribute は可能だが、hosted/managed service 化と license notice removal は不可、という整理で十分です。([GitHub]1)
squne121 commentedon Jun 13, 2026
Refinement Loop: Human Escalation Required
The loop has terminated and requires human review. Cause: human judgment required
human_escalationhuman_judgment_requiredBlockers
squne121 commentedon Jun 13, 2026
ClaudeCode作業ログ
squne121 commentedon Jun 13, 2026
Contract Review: BLOCKED (2026-06-13T00:32:00Z)
不足項目
1. VC preflight: human_judgment(VC 形式の不備)
test -s FILEコマンドがcategory: unknown / decision: human_judgmentと分類されました。baseline_vc_preflight.pyはtest -sexit 1 を「ファイル未存在」と確定分類できないため(test -sは「ファイル未存在」または「ファイルが空」のどちらでも exit 1)unknownになります。影響コマンド:
test -s .claude/artifacts/context-mode/version-provenance.json(AC2)test -s .claude/artifacts/context-mode/ctx-doctor-result.json(AC3)test -s .claude/artifacts/context-mode/registered-tools.json(AC4)test -s .claude/artifacts/context-mode/profile-isolation.json(AC6)2. AC マーカー形式不備 → AC_UNKNOWN
全 VC コマンドの AC マーカーが
# AC2 — description形式のため、preflight が# ACNパターンに一致せずAC_UNKNOWNとなっています。AC ⇔ VC 番号照合が不可能な状態です。推奨修正(simple_contract_hygiene_fix 相当)
根拠: AC1/AC3/AC4/AC5/AC6 はいずれも
<!-- runtime-verification: true -->かつRuntime Verification Applicability.applicable_acsに列挙されており、context-mode 実行環境でのみ確認可能。# preflight-scope: runtime_onlyを付与することでclassification: skipped / decision: goとして preflight が通ります。推奨アクション
issue-refinement-loopの起動を推奨します。修正は VC セクションのマーカー形式のみで、AC の意味論変更は不要です(simple_contract_hygiene_fix相当)。squne121 commentedon Jun 13, 2026
Contract Snapshot (2026-06-13T00:37:42Z)
ctx_execute/ctx_fetch_and_indexは許可しない)test -f .claude/artifacts/context-mode/version-provenance.json# preflight-scope: runtime_only(skipped at baseline, verified at runtime)test -f docs/dev/agent-ops/context-mode-rollback.md.claude/settings.json,.claude/hooks/**,.claude/artifacts/context-mode/**,docs/dev/agent-ops/**,tests/context_mode/**.claude/worktrees/issue-824-claude-code-profile-context-mode-versionworktree-issue-824-claude-code-profile-context-mode-versionsqune121 commentedon Jun 13, 2026
implement-issue: 実装完了 (2026-06-13T00:49:53Z)
.claude/worktrees/issue-824-claude-code-profile-context-mode-versionworktree-issue-824-claude-code-profile-context-mode-versionchore: 準備 PR に降格 — null skeleton artifact と mcpServers stub を除去
squne121 commentedon Jun 13, 2026
補足: PR #837 は準備 PR として降格済み
PR #837 は runtime 証跡のない skeleton artifact と無効な MCP stub のみを含む状態だったため、人間レビューコメントを受けて 準備 PR(artifact schema テスト scaffold + rollback docs のみ) に降格しました。
本 PR は #824 をクローズしません。
#824 の残作業
準備 PR #837 の内容
tests/context_mode/test_artifact_schema.py: artifact JSON schema 検証テスト scaffold(context-mode インストール後に有効化)docs/dev/agent-ops/context-mode-rollback.md: rollback 手順書(AC7 PASS)chore: context-mode 導入準備 — artifact schema テスト scaffold と rollback do…
squne121 commentedon Jun 13, 2026
判定: REQUEST_CHANGES
#824 は、旧レビューコメントで出ていた「
ctx_execute/ctx_fetch_and_indexを登録確認と利用許可で分離する」「Runtime Verification を immediate にする」「artifact schema / redaction を明記する」方向をかなり吸収しています。現在の #824 は、Claude Code の main profile ではなく実験用 profile に限定し、version / provenance / doctor / registered tools を artifact 化する child 1 として定義され、AC1〜AC6 に runtime artifact を要求しています。ただし、実装に渡すにはまだ危険です。主な理由は、「実験用 profile」の実装境界、Claude Code plugin の実 tool name、doctor の信頼境界、配布物 integrity、storage isolation がまだ曖昧だからです。
良い点
#824 が #813 の child 1 として、導入確認・provenance・doctor・tools inventory に閉じている点は妥当です。親 #813 は context-mode を「read-only 調査補助」として段階導入し、#824〜#828 に分割して、deny rule、
ctx_executecwd、ctx_fetch_and_indexstrict、persistence / purge / ELv2 を後続 child に切っています。context-mode 側も、Claude Code plugin は
/plugin marketplace add//plugin installで導入し、/context-mode:ctx-doctorで検証し、SessionStart hook と 11 MCP tools を登録すると説明しています。#824 が「登録確認」と「利用許可」を分けているのは正しい設計です。([GitHub]1)v1.0.162 を GitHub Releases 表示だけでなく local evidence で確認する方針も正しいです。v1.0.162 は 2026-06-02 release / Latest として表示されていますが、これだけでは「実際にインストールされた package / plugin がその版か」は証明できません。([GitHub]2)
Blockers
1. 「実験用 profile」がまだ操作可能な仕様に落ちていない
Claude Code 公式 docs の MCP scope は Local / Project / User で、Local は current project only かつ
~/.claude.json保存、Project は.mcp.jsonで version control 共有、User は全 project です。実験用 profile と言うなら、少なくともlocal scopeなのか、plugin marketplace install なのか、MCP-only local install なのかを artifact に固定する必要があります。([Claude API Docs]3)さらに plugin-provided MCP server は、plugin 有効化時に自動起動し、通常の
/mcpcommand ではなく plugin install 経由で管理されます。したがって.claude/settings.jsonの diff だけでは profile isolation の証明になりません。([Claude API Docs]3)修正案:
{ "install_mode": "claude_code_plugin_marketplace | mcp_only_local", "claude_scope_used": "local | project | user | plugin", "is_plugin_provided_mcp_server": true, "config_paths_touched_redacted": [], "tracked_repo_paths_touched": [], "main_profile_touched": false, "project_tracked_settings_touched": false, "rollback_surface": [ "plugin install state", "local MCP config", "CONTEXT_MODE_DIR", "Claude Code reload/restart" ] }2. AC4 の tool inventory は short name だけでは不足
#824 は 11 tools の short name 一致を要求していますが、Claude Code 側で実際に permission policy に使う tool name は plugin / MCP server 名で prefix された解決名になる可能性があります。context-mode README は short name の 11 tools を列挙していますが、Claude docs は plugin MCP tools が manual MCP tools と並んで表示されると説明しています。([GitHub]1)
registered-tools.jsonは、少なくとも次を分けるべきです。{ "expected_short_names": ["ctx_execute", "..."], "observed_full_tool_names": ["mcp__plugin_...__ctx_execute"], "permission_policy_by_full_tool_name": { "mcp__plugin_...__ctx_execute": "deny", "mcp__plugin_...__ctx_fetch_and_index": "deny" }, "permission_policy_by_short_name": { "ctx_execute": "deny", "ctx_fetch_and_index": "deny" }, "unexpected_tools": [] }short name だけで deny を記録すると、実際の Claude permission matcher とずれて fail-open しても見逃します。
3.
ctx-doctor okを security evidence として扱ってはいけない#824 の AC3 は doctor が error なしで完了することを要求していますが、doctor は liveness / registration evidence に留めるべきです。過去の upstream #558 は、marketplace plugin install で security module が欠け、
permissions.denyが silent fail-open になった一方、doctor / integrity check が OK と報告した事例です。([GitHub]4)したがって #824 では次のように分けるべきです。
ctx-doctor-result.json: 起動・hooks・FTS5・plugin registration の liveness evidence。version-provenance.json: package / bundle / manifest integrity evidence。registered-tools.json: registration と permission policy の inventory。.env、SSH、gh、Claude config、token dump、ctx_index -> ctx_search経路の fail-closed 化を担当しています。4. provenance がまだ「version 表示」寄りで、配布物検証として弱い
#824 の AC2 は installed version / package location / release tag / package hash / plugin manifest version を要求しており改善済みです。 ただし、context-mode は marketplace plugin / npm / repository bundle のどれで入ったかにより検証面が変わります。過去に marketplace packaging 起因の fail-open が報告されているため、hash だけでは不足です。([GitHub]4)
version-provenance.jsonは最低限、次を必須にしてください。{ "installed_version": "1.0.162", "upstream_release_tag": "v1.0.162", "upstream_release_commit": "a88cb2a", "install_source": "claude_plugin_marketplace | npm | git", "plugin_manifest_version": "...", "package_manifest_version": "...", "server_bundle_sha256": "...", "cli_bundle_sha256": "...", "doctor_reported_version": "...", "integrity_checks": { "doctor_ok": true, "security_runtime_present_or_bundled": true, "bundle_hashes_recorded": true } }ここで
security_runtime_present_or_bundledは、過去の #558 型の「security module が欠けても doctor OK」を検知するための独立項目です。実装時に上流の現在構造へ合わせて検査名は変えてよいですが、doctor の自己申告とは分離すべきです。5.
ctx_execute/ctx_fetch_and_indexの「未実行 evidence」が曖昧#824 は
ctx_executeとctx_fetch_and_indexを out of scope にし、registered されていても permission policy 上 deny とする設計です。これは正しいです。ただし、#824 ではこの2つを実行して negative test してはいけません。
ctx_executeの cwd 問題は #826、ctx_fetch_and_indexの network strict は #827 の責務です。#826 は Bash とctx_executeの cwd / repo root / branch / HEAD SHA 比較と quarantine 方針を担当し、#827 はCTX_FETCH_STRICT=1と network negative test を担当しています。#824 の AC5 は次の表現に変える方が安全です。
6. storage isolation がまだ弱い
context-mode は
CONTEXT_MODE_DIRを storage root とし、sessions/stats と indexed content を別 subdir に保存します。~は展開されず、absolute writable root が必要です。([GitHub]1)#824 は実験導入なので、default の
~/.claude/context-modeに混ぜるべきではありません。profile-isolation.jsonまたはconfig-diff.jsonに、実験用の disposable absolute path を redacted で記録してください。追加すべき evidence:
{ "context_mode_dir_redacted": "<HOME>/.claude/context-mode-experiments/issue-824", "storage_pre_state": { "sessions_exists": false, "content_exists": false }, "storage_post_state": { "sessions_exists": true, "content_exists": false }, "indexed_content_created": false, "purge_performed": true }ctx_indexを使わないならcontent_exists:false/indexed_content_created:falseが期待値です。ここが曖昧だと、#828 の persistence / purge policy 前に不要な index DB が残ります。#828 は persistence path、purge、secret 混入時対応、ELv2 notice を docs 化する child です。7. #797 / PR #852 との merge-order 証跡が必要
#824 は
.claude/settings.json/.claude/hooks/**を Allowed Paths に含みます。一方、#797 は Claude / Codex hook stdout policy、PreCompact state 保存、payload digest throttle を整備する領域で、関連 PR #852 は closed になっています。#824 の Stop Condition は「#797 が open のまま settings/hooks 変更が必要なら停止」としていますが、実装者向けにはまだ弱いです。次を AC または preflight に追加してください。
context-mode plugin marketplace install は「SessionStart hook が runtime に routing instructions を注入し、project に file を書かない」と説明されています。([GitHub]1) したがって #824 が tracked
.claude/hooks/**を変更するなら、その理由はかなり強く説明されるべきです。原則は tracked settings/hooks を触らず、local/plugin state と artifact/docs に閉じる方が安全です。関連作業ログから見える運用上の赤信号
#824 の impl-review-loop 実行から、技術Issueとは別に運用Issueが大量に派生しています。これは #824 の内容そのものではなく、この種の agent-ops 実装を走らせる前の gate がまだ弱いという証拠です。
特に、Allowed Paths 外変更の pre-commit gate が必要になった #846、PR reviewer SubAgent の投稿先 PR 番号を orchestrator が固定すべきという #847、VC marker 誤記を前倒し lint する #839、
test -sを baseline preflight が誤分類した #840 は、#824 実装時に同じ手戻りを再発させます。さらに #842 は、#824 の PR body 日本語チェックが CI でのみ検出され、push → CI failure → 修正の往復が3回発生したと記録しています。 これは #824 本体の blocker ではありませんが、実装runの前提として pre-push / preflight を補強しないと、また agent loop の無駄が出ます。
修正すべき Issue 本文差分
#824 本文に、最低限これを足してください。
# 追加 Verification Commands uv run pytest tests/context_mode/test_artifact_schema.py::test_tool_inventory_full_names -v uv run pytest tests/context_mode/test_artifact_schema.py::test_permission_policy_uses_full_names -v uv run pytest tests/context_mode/test_artifact_schema.py::test_version_provenance_integrity_fields -v uv run pytest tests/context_mode/test_artifact_schema.py::test_context_mode_dir_is_experiment_scoped -v uv run pytest tests/context_mode/test_artifact_schema.py::test_no_dangerous_tool_invocations_in_issue_824 -v uv run pytest tests/context_mode/test_artifact_schema.py::test_artifact_redaction_report -v最終判断
#824 は方向性としては採用可能です。ただし、現状のまま実装すると「doctor が通った」「11 tools が見えた」「deny と書いた」だけで安全確認したように見える危険があります。Anthropic docs も MCP server は信頼確認が必要で、外部 content を扱う server は prompt injection risk を持つと明記しています。([Claude API Docs]3)
安全な作業順は次です。
ctx_doctor/ inventory / provenance / isolation / rollback だけを実行し、ctx_executeとctx_fetch_and_indexは呼ばない。ctx_executecwd quarantine。ctx_fetch_and_index+CTX_FETCH_STRICT=1negative test。ELv2 については、内部利用・fork・modify・distribute は可能だが、hosted / managed service 化と license notice removal は不可、という扱いで十分です。#824 では配布物を vendoring せず、version / hash / provenance の evidence に留めるべきです。([GitHub]1)
squne121 commentedon Jun 13, 2026
Refinement Loop: Approved
The issue has been approved and is ready for implementation.
approvedsqune121 commentedon Jun 13, 2026
Contract Snapshot (2026-06-13T04:14:54Z)
ctx_execute/ctx_fetch_and_indexは許可しない)test -f .claude/artifacts/context-mode/version-provenance.json# preflight-scope: runtime_only(skipped at baseline, verified at runtime)test -f docs/dev/agent-ops/context-mode-rollback.md(pr_review_only).claude/settings.json,.claude/hooks/**,.claude/artifacts/context-mode/**,docs/dev/agent-ops/**,tests/context_mode/**.claude/worktrees/issue-824-claude-code-profile-context-mode-versionworktree-issue-824-claude-code-profile-context-mode-versionfix: PR #856 レビュー指摘(Blocker 1-6)を修正する (#824)
feat: context-mode を実験用 profile に導入し version / doctor / tools / permi…