gemini-cli icon indicating copy to clipboard operation
gemini-cli copied to clipboard

hooks.disabled is not working despite documented as such

Open simkimsia opened this issue 2 weeks ago • 0 comments

What happened?

This is my ~/.gemini/settings.json

"hooks": {
    "disabled": ["catch-all-debug"],
    "AfterTool": [
      {
        "matcher": "*",
        "hooks": [
          {
            "name": "catch-all-debug",
            "type": "command",
            "command": "/Users/kimsia/.gemini/hooks/catch-all.sh",
            "description": "Log all tool executions",
            "timeout": 10000
          }
        ]
      },
      {
        "matcher": "write_file",
        "hooks": [
          {
            "name": "markdown-lint",
            "type": "command",
            "command": "/Users/kimsia/.gemini/hooks/markdown-lint.sh",
            "description": "Run markdownlint-cli2 --fix on markdown files",
            "timeout": 10000
          }
        ]
      }
    ]
  }

What did you expect to happen?

i expect the catch-all-debug not to run despite documentation at https://geminicli.com/docs/hooks/#disabled-hooks-configuration and https://geminicli.com/docs/get-started/configuration/#hooks

I think hooks is not ready in gemini cli v0.20.* also see https://github.com/google-gemini/gemini-cli/issues/14932#issuecomment-3650147216

Client information

Client Information

Run gemini to enter the interactive CLI, then run the /about command.

> /about
# paste output here
 About Gemini CLI                                                         │
│                                                                          │
│ CLI Version              0.20.2                                          │
│ Git Commit               af894e468                                       │
│ Model                    auto                                            │
│ Sandbox                  no sandbox                                      │
│ OS                       darwin                                          │
│ Auth Method              OAuth                                           

Sorry i am not inclding my email

Login information

see above

i use oauth with my gmail

Anything else we need to know?

my workaround is to comment out and trust that gemini cli's settings.json accept jsonc

"hooks": {
    "disabled": ["catch-all-debug"],
    "AfterTool": [
      // {
      //   "matcher": "*",
      //   "hooks": [
      //     {
      //       "name": "catch-all-debug",
      //       "type": "command",
      //       "command": "/Users/kimsia/.gemini/hooks/catch-all.sh",
      //       "description": "Log all tool executions",
      //       "timeout": 10000
      //     }
      //   ]
      // },
      {
        "matcher": "write_file",
        "hooks": [
          {
            "name": "markdown-lint",
            "type": "command",
            "command": "/Users/kimsia/.gemini/hooks/markdown-lint.sh",
            "description": "Run markdownlint-cli2 --fix on markdown files",
            "timeout": 10000
          }
        ]
      }
    ]
  }

simkimsia avatar Dec 14 '25 03:12 simkimsia