Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Claude Codeをdotfiles管理しよう! / Let's Manage Claud...
Search
shuntaka
August 08, 2025
22k
8
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Claude Codeをdotfiles管理しよう! / Let's Manage Claude Code with Dotfiles!
shuntaka
August 08, 2025
More Decks by shuntaka
See All by shuntaka
GitHub Copilot CLI が マッスルに馴染むまで / Until GitHub Copilot CLI Becomes Second Nature
shuntaka
1
15k
Claude Code活用時のつらみと隙間を埋めるツール / Tools to bridge the gaps and pains of using Claude Code
shuntaka
0
15k
CloudFront OAC × Lambda Function URLs で作る認証付き簡易サイト / Simple Authenticated Website Built with CloudFront OAC and Lambda Function URLs
shuntaka
0
4.2k
顧客体験を加速させるチャットボットで始めるAIエージェント入門 / Introduction to AI Agents: Starting with Chatbots to Accelerate Customer Experience
shuntaka
1
4.2k
AI SDKで作るチャットボット開発 / Chatbot Development with AI SDK
shuntaka
0
1.9k
Claude Codeチーム活用の現在地 〜小さな実践と今後の展望〜 / Current State of Claude Code Team Adoption - Small Practices and Future Prospects
shuntaka
2
8.9k
個人プロジェクトをKiroベースに 乗り換えてみた / I Tried Migrating My Personal Project to Kiro-based
shuntaka
0
3k
AI駆動開発がもたらす革新と実践 / Innovation and Practice Brought by AI-Driven Development
shuntaka
2
2.4k
リモートMCP + MCP業務取り組み例 / Remote MCP + MCP Business Initiative Examples
shuntaka
0
2.4k
Featured
See All Featured
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
990
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
560
For a Future-Friendly Web
brad_frost
183
10k
Google's AI Overviews - The New Search
badams
0
1.6k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.2k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
320
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
1
400
RailsConf 2023
tenderlove
30
1.5k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.1k
Fireside Chat
paigeccino
43
4k
The Spectacular Lies of Maps
axbom
PRO
1
990
Transcript
Claude Codeをdotfiles管理しよう! (おすすめの設定を添えて) Claude Code Meetup Japan #2 2025/08/08 shuntaka
shuntaka/髙橋俊⼀ 業務: TypeScript/AWS/Backend 趣味: Go/Rust/Neovim/Nix🔰 所属: クラスメソッド 製造ビジネステクノロジー部 最近はコーディングエージェントやRAG周りを触っています。 詳細はshuntaka.dev/whoへ!
2 自己紹介
‧Claude Codeのバージョンは1.0.71 前提 (8/8早朝リリース) ‧CLAUDE_CONFIG_DIR="$HOME/.config/claude"を設定 ‧資料はSpeakerdeck shuntakaで調べて貰えれば出てきます! ‧github.com/shuntaka9576/dotfiles に今回の内容は基本⼊っています 3
前提 基礎的な内容も多いのでカスタマイズしている⼈は復習くらいに思っ て頂ければ幸いです...🙏
AIコーディングエージェントと設定ファイル 4 単純化 複雑、先鋭化 AIモデルの 進化 コーディングエージェントは⾼機能化 設定ファイルは好みや個⼈最適化の幅が多 く、秘伝のタレ化しそう... ⼈々の
試⾏錯誤
チーム開発で共通コンフィグ テンプレートを⽤意して本体はgitignoreが今は良さそう!試⾏錯誤したい フェーズだよね! ‧MCPはローカルMCPの場合、PC環境設定のバラツキあり。好みも⼤きい。 ‧Slashコマンドは使わない⾃由があり素敵な反⾯、プロジェクト横断汎⽤系は グローバルで育てたい⼀品。 ‧Hooksのblock系は癖が強い。何気ない発⽕がコンテキスト圧迫してしまうこ とも。 5 _人人人人人人人人_
> Hooksが発火! <  ̄Y^Y^Y^Y^Y^Y^Y^ ̄ ⎿ Context low · Run /compact to compact & continue
dotfilesで設定を管理公開しよう! dotfilesはドット(.)で始まる名前のシステム設定ファイル群をリポジトリで管 理すること。 環境構築が簡単になり、複数端末で同じ設定を同期可能。AIツールが多すぎる昨 今で共通設定もそれなりにある。⼀度⼊れて放置、モデルが進化して使うことも ある。 気軽に⾃分の設定を公開でき、正確に早く再現性のある情報を共有できる! ‧settings.json ‧Slash Command
‧Hooks ‧MCP 6
MCPの共通ファイル化 ‧MCPを使うクライアントが多いので設定ファイル地獄になる ‧どんなMCP使っているか共有したいケース ‧意外とシュッと動かないケースもある ‧どうやって設定した? ‧Aツールでは動かないけど、Bツールでは動く... ‧バージョン上げたら云々.. dotfiles化して設定の簡易化、設定共有も簡単に 😊 7
Jsonnetを使った簡易なMCP設定の生成 8 local secrets = import 'secrets.jsonnet'; { mcpServers: {
"github": { "type": "http", "url": "https://api.githubcopilot.com/mcp", "headers": { "Authorization": "Bearer " + secrets.github.token } }, }, } シークレットはignoreする .mcp-general.json json生成 $ jsonnet xx.jsonnet > .mcp-general.json
.codeium/windsurf/mcp_config.json Library/Application Support/Claude/claude_desktop_config.json .kiro/settings/mcp.json Library/Application Support/Windsurf/中略 /settings/cline_mcp_settings.json 生成したjsonにシンボリックリンクを貼る .mcp-general.json Library/Application
Support/Code/中略 /settings/cline_mcp_settings.json 9
ClaudeCodeのグローバルMCP設定は.claude.json グローバルMCP設定は分離されて⼊れていない。プロジェクト全てに .mcp.jsonを設定する必要あり。 10
.mcp-general.json .config/claude/.claude.json .config/claude/.claude.json mcpServersプロパティを削除 jq 'del(.mcpServers) + $$mcp[0]' ~/.config/claude/.claude.json --slurpfile
mcp ~/dotfiles/home-manager/programs/mcp/.mcp-claude-code.json > ~/.config/claude/.claude.json.tmp && mv ~/.config/claude/.claude.json.tmp ~/.config/claude/.claude.json ClaudeCodeは既存設定ファイルをjqで置換 jqで削除と結合 11
Slash Command ‧ディレクトリのシンボリックリンクを作成する ‧カスタマイズの幅⼤きいし、⾃分に最適化できる余地が多い ‧PR作成コマンド ‧テンプレ適⽤, ドラフトPR, アサイン@me指定, gh browse⾃動で開く
12
Claude Hooks ‧意外とゴリゴリ書く必要がある ‧書かない場合はjqでパースで可読性が低い 13
HooksスクリプトをTypeScriptで書く 保守しやすい。nodeもTS実⾏できるようになった。denoで書いているが、node でもいいかも。 denoだとパーミッションコントロールとnode_modulesがないのメリット。 14
Hooksイベントの通知カスタマイズ 15 リポジトリ名 ブランチ名 https://github.com/shuntaka9576/dotfiles/blob/fcc5b2cc8b24c3a3c31c0c2b327461661f2d1281/home-manager/programs/claude/hooks/notify.ts
16 Stop Notification planモードの許可や--dangerously-skip-permissionsかつplanでもmcpの明示許可が必要で漏 れがあった場合などに有効(globパターンも利用不可) イベント 通知
17 "hooks": { "Stop": [ { "matcher": "", "hooks": [
{ "type": "command", "command": "~/dotfiles/home-manager/programs/claude/hooks/notify.ts" } ] } ], "Notification": [ { "matcher": "", "hooks": [ { "type": "command", "command": "~/dotfiles/home-manager/programs/claude/hooks/notify.ts" } ] } ] }, #!/etc/profiles/per-user/shuntaka/bin/denor un --allow-run --allow-env // (中略) if (data.hook_event_name == "Stop") { process = new Deno.Command("osascript", { args: [ "-e", `display notification "Task Completed 🚀" with title "⚡ Claude Code" subtitle "${repoInfo} 📦"`, ], stdout: "piped", stderr: "piped", }); } else if (data.hook_event_name == "Notification") { process = new Deno.Command("osascript", { args: [ "-e", `display notification "Awaiting Confirmation 🔔" with title "⚡ Claude Code" subtitle "${repoInfo} 📦"`, ], stdout: "piped", stderr: "piped", }); } https://github.com/shuntaka9576/dotfiles/blob/ccfb7d237c8d920e7a128cf2128ed0c216e05252/home-manager/programs/claude/hooks/notify.ts https://github.com/shuntaka9576/dotfiles/blob/ccfb7d237c8d920e7a128cf2128ed0c216e05252/home-manager/programs/claude/settings.json
HooksのStopイベントで静的解析をかける 18 実装、修正 静的解析 ① Stopフック ※ PostToolUseを使っていた時期がありました。 → 作業妨害味がある
& コンテキスト圧迫でやめました ② 解析結果を フィードバック
HooksのStopイベントで静的解析結果をフィードバック 19 ‧decision=block, reasonフィールド使う or ‧exit 2, stderrに書き込んで返却 exit 1
stderr stdout exit 1 stdout clippy exit 101 stderr cspell ruff
exit 1以上の結果をexit 2 stderrに書き込み直すラッパーCLIを書いた 20 cspell ruff exit 1 stderr
stdout exit 1 stdout clippy exit 101 stderr $ blocc -s "cspell lint ." { "message": "1 command(s) failed", "results": [ { "command": "cspell lint .", "exitCode": 1, "stderr": "CSpell: …", "stdout": "… Unknown word (oicd)" } ] } ※ brew install shuntaka9576/tap/blocc
21 ① Claude Codeが実装 完了する
22 ② Stop Hook発⽕ 循環複雑度エラーを認識 (gocyclo)
23 ③ ⾃動リファクタへ誘導
24 ③ 自動リファクタへ誘導 $ blocc -n -s "cspell lint ."
-o "perl -nle 'print \$1 if /Unknown word \((\w+)\)/' | sort | uniq" 出⼒データが多くてcontext lowになることも 試⾏錯誤していて、汎⽤的なlinterは--stdout-filterと--stderr-filterで原因の場所だ け取り出すようにして改善させることができそう?
⼩ネタ集 25
[小ネタ] mise(ミーズ)とClaudeCode $ cat ~/.default-npm-packages jwt-cli lighthouse npm-check-updates @biomejs/biome pnpm
@anthropic-ai/
[email protected]
typescript-language-server @benborla29/mcp-server-mysql cspell .node-versionを検知すると消える ので、~/.default-npm-packages設 定。 mise installで⼀通りinstallされる ようになる。 @でバージョン固定可能。envの DISABLE_AUTOUPDATERと併⽤す れば特定のバージョンにロック可 能。 ※ 編集した場合、mise uninstall node --allしないといけ ない 26
[小ネタ] .rgignoreでdotつきファイルを@検索できるようにする プロジェクトで.rgignoreを設定す ると、dotつきファイルも検索対象 にできる 27 https://x.com/upamune/status/1948026029240635668 情報ありがとうございます!!🙇🙇
AIコーディングエージェントの設定を育てよう! 28
以上です!ありがとうございました! 29