Skip to content

claude.aiのコネクタの読み込みを監査に加える - #1

Merged
BoxPistols merged 1 commit into
mainfrom
feat/connector-check
Sep 27, 2026
Merged

BoxPistols merged 1 commit into
mainfrom
feat/connector-check

Conversation

@BoxPistols

@BoxPistols BoxPistols commented Sep 27, 2026 •

Copy link
Copy Markdown
Owner

何を良くするか

claude.aiのコネクタのツール名一覧は、コネクタを使わないセッションでも毎回読み込まれます。実測で入力トークンの約3割を占めた例があったので、切っていない場合に情報として示し、切り方と注意点を添えます。

確かめたこと

  • python3 -m unittest discover -s testsが通る
  • プラグインの中身を変えたので、plugin.jsonのversionを0.1.1に上げた
  • 個人や勤務先・顧客の実名、非公開のURL、トークンの実値を入れていない

追加したテストは、変更を外すと落ちることを確かめています。

監査の結果

変わった行は次の2つです。

変更前: 該当行なし

変更後: | 情報 | 読み込み量 | claude.aiのコネクタ | claude.aiに接続したコネクタのツール名一覧が毎セッション読み込まれる。…

あわせて、最終行の表記を「要確認 0件」から「要確認は0件」に直しています。

Summary by CodeRabbit

  • 新機能
    • 環境監査でClaude.aiコネクタの読み込み状況を確認できるようになりました。設定で無効化されている場合は「OK」、有効な場合は毎セッション読み込まれる情報として報告されます。
  • 改善
    • 監査結果の要確認件数が、より分かりやすい表記になりました。
  • その他
    • プラグインのバージョンを更新しました。

コネクタのツール名一覧は、使わないセッションでも毎回読み込まれ、実測で入力の約3割を占めた例がある。切っていなければ情報として示し、切り方と注意点を添える。出力の「要確認 N件」の和欧間スペースも直す
@coderabbitai

coderabbitai Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 26978d3e-b4ac-406b-8c5e-a63c38fd2698

📥 Commits

Reviewing files that changed from the base of the PR and between aa3c844 and c552574.

📒 Files selected for processing (3)
  • plugins/env-kit/.claude-plugin/plugin.json
  • plugins/env-kit/skills/env-audit/claude-env-audit.py
  • tests/test_env_kit.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📜 Recent review details
⏰ Context from checks skipped due to timeout. (3)
  • GitHub Check: Amazon Q Developer
  • GitHub Check: test (ubuntu-latest)
  • GitHub Check: test (macos-latest)
🧰 Additional context used
🪛 ast-grep (0.45.3)
tests/test_env_kit.py

[info] 74-74: use jsonify instead of json.dumps for JSON output
Context: json.dumps({})
Note: [CWE-116] Improper Encoding or Escaping of Output.

(use-jsonify)


[info] 76-76: use jsonify instead of json.dumps for JSON output
Context: json.dumps({'disableClaudeAiConnectors': True})
Note: [CWE-116] Improper Encoding or Escaping of Output.

(use-jsonify)

🪛 Ruff (0.16.6)
plugins/env-kit/skills/env-audit/claude-env-audit.py

[warning] 139-139: String contains ambiguous ( (FULLWIDTH LEFT PARENTHESIS). Did you mean ( (LEFT PARENTHESIS)?

(RUF001)


[warning] 139-139: String contains ambiguous ) (FULLWIDTH RIGHT PARENTHESIS). Did you mean ) (RIGHT PARENTHESIS)?

(RUF001)


📝 Walkthrough

Walkthrough

Claude.aiコネクタの有効状態を環境監査に追加しました。ユーザー設定またはプロジェクト設定に基づいて結果を報告し、該当するテストを追加しました。通常出力の要確認件数の表記とプラグインのバージョンも変更しました。

Changes

環境監査の更新

Layer / File(s) Summary
コネクタ監査と関連更新
plugins/env-kit/skills/env-audit/claude-env-audit.py, tests/test_env_kit.py, plugins/env-kit/.claude-plugin/plugin.json
disableClaudeAiConnectors が真の場合は「OK」、そうでない場合は「情報」としてClaude.aiコネクタの状態を報告します。プロジェクト設定とローカル設定を統合して監査に渡し、両方の報告結果をテストします。要確認件数の表記を「要確認はN件」に変更し、プラグインのバージョンを 0.1.1 に更新しました。

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Merge Risk: ⚪ Minimal · up to c5525

監査結果への実測例の重複掲載は必須ではなく、例はガイドに記載されています。ユーザー設定の優先順位も正しく反映されており、確認された変更起因の問題はありません。

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 2 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed タイトルは、claude.aiのコネクタを監査項目に追加する主要な変更を簡潔に示しています。
Description check ✅ Passed 説明には、改善内容、確認項目、テスト結果、バージョン更新、監査結果が記載されています。テンプレートの必須情報を満たしています。
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 2 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

うさぎは設定を見に行った
コネクタの状態をたしかめた
無効なら「OK」と知らせた
有効なら情報を伝えた
テストもそばで見届けた
新しい版に耳を揺らした

Comment @coderabbitai help to get the list of available commands.

@amazon-q-developer amazon-q-developer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR successfully adds auditing for claude.ai connector token usage and provides clear guidance for users to optimize their token consumption. The implementation follows existing code patterns, includes comprehensive test coverage, and addresses a real performance concern where connectors can consume up to 30% of input tokens even when unused.

The changes are well-structured with proper version bumping and consistent error handling. No blocking issues identified.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

@BoxPistols
BoxPistols merged commit 242bee0 into main Sep 27, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant