Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

permissionRequest hook: the input payload is not documented

オープン 初心者向け
#46,334 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
1/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
ドキュメント
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
json, markdown
領域
documentation

調査の方向性

不足している内容は hooks-reference.md に追加してください。既存の「Hook event input payloads」セクション(sessionStart から agentStop までを扱う)の隣が適切です。それらのサブセクションの構成を読み、issue に記載された payload フィールドを使って permissionRequest のサブセクションを追加してください。ページに bash と powershell の値を含めて toolName、toolInput、permissionSuggestions が文書化され、動作に関する注記が issue の再現手順と照らし合わせて確認されていれば完了です。

索引モデルが issue の本文から書いたものです。

説明

builder persona content copilot

What is missing

hooks-reference.md has a "Hook event input payloads" section that documents the stdin payload for sessionStart, sessionEnd, userPromptSubmitted, userPromptTransformed, preToolUse, postToolUse, postToolUseFailure and agentStop. permissionRequest is not among them, and it has no payload subsection anywhere else on the page.

Why it matters

permissionRequest is the only hook that can pre-approve a tool call — returning {"behavior":"allow"} short-circuits the permission service. Its decision-control section tells you to return behavior / message / interrupt, but to write a useful hook you need the tool name and the tool input, and neither field is documented. You have to discover them by writing a hook that dumps stdin to a file, which is how I obtained the payload below.

Payload actually received (CLI 1.0.98, Windows; toolName is powershell on Windows and bash on Unix):

{
  "hookName": "permissionRequest",
  "sessionId": "…",
  "timestamp": 1792065216069,
  "cwd": "C:\\src\\my-repo",
  "toolName": "powershell",
  "toolInput": { "command": "git status" },
  "permissionSuggestions": []
}

Suggested addition — a subsection alongside the other events:

permissionRequest
{
  "hookName": "permissionRequest",
  "sessionId": "...",
  "timestamp": 0,
  "cwd": "/path/to/repo",
  "toolName": "bash",
  "toolInput": { "command": "git status" },
  "permissionSuggestions": []
}
  • toolName — the tool being requested (bash on Unix, powershell on Windows).
  • toolInput — the arguments for that tool; for shell tools the command is toolInput.command.
  • permissionSuggestions — the permission rules the CLI would otherwise offer to save.

Two behaviours worth documenting on the same page, if they are not already:

  • permissionRequest does not fire for the read and hook permission kinds.
  • Exit code 2 denies; any other non-zero exit is logged and falls through (fail-open), unlike preToolUse, which is fail-closed. Timeouts are fail-open for every event.

Repro to capture the payload

{
  "hooks": {
    "permissionRequest": [
      { "type": "command", "bash": "cat > /tmp/perm-payload.json" }
    ]
  }
}

Then run any shell tool and read /tmp/perm-payload.json.

主要言語
TypeScript
スター
21k
フォーク
69.1k
平均マージ
10時間 32分
マージ済み PR(30日)
103

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

github/docs のほかの issue

github/docs の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。