<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>watashi-kabu</author_name>
  <author_url>https://blog.hatena.ne.jp/watashi-kabu/</author_url>
  <blog_title>わたしとカブのスープ</blog_title>
  <blog_url>https://watashi-kabu.hatenablog.com/</blog_url>
  <categories>
    <anon>Claude</anon>
    <anon>Linux</anon>
    <anon>Python</anon>
    <anon>git</anon>
  </categories>
  <description>はじめに チームでClaudeCodeを使い始めました。仕様駆動開発などを行っていますが、チームのリポジトリなので自動でgit pushされたら事故*1につながります。そこで、ClaudeCodeのhooksを使って自動git pushを防止する設定を行いました。 Hooksを設定する ~/.claude/settings.jsonにhooks.PreToolUseを追加、bashの呼び出しごとにPythonコード（後述）を実行する。 { &quot;hooks&quot;: { &quot;PreToolUse&quot;: [ { &quot;matcher&quot;: &quot;Bash&quot;, &quot;hooks&quot;: [ { &quot;type&quot;: &quot;command&quot;…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwatashi-kabu.hatenablog.com%2Fentry%2F2026%2F10%2F19%2F225500&quot; title=&quot;ClaudeCodeで自動git pushを防止する - わたしとカブのスープ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2026-10-19 22:55:00</published>
  <title>ClaudeCodeで自動git pushを防止する</title>
  <type>rich</type>
  <url>https://watashi-kabu.hatenablog.com/entry/2026/10/19/225500</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
