Skip to content

Copilot CLI hooks are not working at all after resuming a session #782

@DonJayamanne

Description

@DonJayamanne

I am using this hooks.json:

{
	"version": 1,
	"hooks": {
		"sessionStart": [
			{
				"type": "command",
				"bash": "touch /tmp/.worktree-sessionStart"
			}
		],
		"sessionEnd": [
			{
				"type": "command",
				"bash": "touch /tmp/.worktree-sessionEnd"
			}
		],
		"agentStop": [
			{
				"type": "command",
				"bash": "touch /tmp/.worktree-agentStop"
			}
		],
		"userPromptSubmitted": [
			{
				"type": "command",
				"bash": "touch /tmp/.worktree-userPromptSubmitted"
			}
		],
		"preToolUse": [
			{
				"type": "command",
				"bash": ""
			}
		],
		"postToolUse": [
			{
				"type": "command",
				"bash": ""
			}
		]
	}
}

I see 3 files created on session start. Then I delete the 3 files and continue in the session. None of the files is created. I would have expected:

  • userPromptSubmitted
  • agentStop

Originally reported here microsoft/vscode#300193

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions