Skip to content

Fixed a configuration error in the hooks Chinese guide#77

Open
ytche wants to merge 1 commit intoluongnv89:mainfrom
ytche:main
Open

Fixed a configuration error in the hooks Chinese guide#77
ytche wants to merge 1 commit intoluongnv89:mainfrom
ytche:main

Conversation

@ytche
Copy link
Copy Markdown

@ytche ytche commented Apr 15, 2026

Description

Fixed a configuration error in the hooks Chinese guide (zh/06-hooks/README.md). The hooks field was incorrectly defined as a string array instead of an object array,
causing Claude Code to throw an error when users applied this configuration.

Type of Change

  • New example or template
  • Documentation improvement
  • Bug fix
  • Feature guide
  • Other (please describe)

Related Issues

Changes Made

  • Changed hooks field from string array to object array in PreToolUse example
  • Fixed configuration structure to match the schema: hooks: [{ type, command}]

What to Review

  • The hooks field now contains proper object structure
  • Is the Chinese guide outdated compared to the English version?(Need help?)
  • No other similar type errors exist in the Chinese guide

Files Changed

  • zh/06-hooks/README.md

Testing

How have you tested this?

  • Tested locally with Claude Code
  • Verified examples work
  • Checked links and references
  • Reviewed for typos and clarity

Checklist

  • Follows project structure and conventions
  • Includes clear documentation/examples
  • Code/examples are copy-paste ready
  • All links are verified and working
  • No sensitive information included (keys, tokens, credentials)
  • Updated relevant README files
  • Commit message follows conventional commit format
  • No large files (>1MB) added

Screenshots or Examples

Before (incorrect):

{
"PreToolUse": [{
      "matcher": "Write",
      "hooks": ["~/.claude/hooks/format-code.sh"]
    }]
}

After (correct)

{
"PreToolUse": [
      {
        "matcher": "Write",
        "hooks": [
          {
            "type": "command",
            "command": "~/.claude/hooks/format-code.sh"
          }
        ]
      }
    ]
}

Breaking Changes

Does this change any existing content or behavior?

  • No breaking changes
  • Yes, and it's documented below

If yes, please describe:

Additional Notes

Thanks for your open source spirit!

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