ニャアアアアン 🐈 日記

#golang

All tags

Claude Codeとの会話をmarkdownに変換し、Obsidian保管庫の所定のフォルダにコピーする

Claude Codeとの会話履歴を読みやすいシンプルなmarkdownに変換するツールを作った。homebrewでインストールできる。

brew install capybara-translation/tap/ccrec

さらに、これを下記のように~/.claude/settings.jsonのhooksイベント(自分の場合はStop/SessionEndを使っている)に仕掛け、markdownへの変換、Obsidian保管庫へのコピーを自動化する仕組みも作った。

{
  "hooks": {
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "/path/to/ccrec hook -dir ~/Documents/obsidian/vault/projects"
          }
        ]
      }
    ],
    "SessionEnd": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "/path/to/ccrec hook -dir ~/Documents/obsidian/vault/projects"
          }
        ]
      }
    ]
  }
}

Claude Codeちゃんとの大切な思い出、失いたくないからね…。