<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/how-i-use-the-same-git-work-log-with-codex-and-chatgpt-dncckvdht" -->

---
title: How I use the same Git work log with Codex and ChatGPT
description: A workflow for keeping a unified plain-text work log across multiple AI coding agents (Cursor, Codex, ChatGPT desktop) using a native Git post-commit hook. The...
canonical: https://daily.dev/posts/how-i-use-the-same-git-work-log-with-codex-and-chatgpt-dncckvdht
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: How I use the same Git work log with Codex and ChatGPT | daily.dev
og:description: A workflow for keeping a unified plain-text work log across multiple AI coding agents (Cursor, Codex, ChatGPT desktop) using a native Git post-commit hook. The...
og:url: https://daily.dev/posts/how-i-use-the-same-git-work-log-with-codex-and-chatgpt-dncckvdht
og:image: https://api.daily.dev/og/posts/DNcCKVdHT.png
og:image:alt: How I use the same Git work log with Codex and ChatGPT
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How I use the same Git work log with Codex and ChatGPT

**[Flavio Copes](https://daily.dev/sources/flaviocopes)** · 4 min read · 0 upvotes · 0 comments

## Summary

A workflow for keeping a unified plain-text work log across multiple AI coding agents (Cursor, Codex, ChatGPT desktop) using a native Git post-commit hook. The setup uses a Codex PreToolUse hook in ~/.codex/hooks.json to install the Git hook before the first commit in any repository. The approach is agent-agnostic since Git itself fires the logger after every commit, capturing agent commits, manual commits, and GUI commits alike. Existing post-commit hooks are preserved via a wrapper script, and a shared state file prevents duplicate log entries.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://flaviocopes.com/log-codex-chatgpt-git-commits>

## Questions this post answers

### How do I make Codex install a Git post-commit hook automatically before the first commit in a repo?

Add a PreToolUse hook in ~/.codex/hooks.json that matches the Bash tool and runs an installer script before commands execute. The script checks whether the command contains git commit, and if so installs .git/hooks/post-commit in the current repository before the commit runs, so Git calls it after the commit succeeds. Using PreToolUse instead of PostToolUse avoids missing the very first commit in a new repository.

_Developers wiring up agent hooks and automation can compare Codex and Cursor workflows on daily.dev._

### How can I avoid overwriting an existing .git/hooks/post-commit script when adding a new one?

Move the existing post-commit hook to a backup file such as .git/hooks/post-commit.before-work-log, then create a new wrapper script that calls the backed-up hook first, captures its exit status, runs the new logic afterward, and finally exits with the original status. This preserves prior hook behavior while adding new functionality.

_Anyone chaining Git hooks safely can find similar setup patterns curated on daily.dev._

### How do I check whether Codex supports lifecycle hooks like PreToolUse?

Run codex features list in the terminal and look for a line reading 'hooks stable true' in the output. Current Codex versions include stable lifecycle hooks, and the ChatGPT desktop app shares the same local Codex configuration stored under ~/.codex/.

_Developers configuring Codex tooling can track agent feature support on daily.dev._

## Similar posts on daily.dev

- [How I log every Git commit to a plain text file](https://daily.dev/posts/how-i-log-every-git-commit-to-a-plain-text-file-tkytafsgi) · Flavio Copes · 0 upvotes · 0 comments
- [My Codex Workflow So Far and How It Keeps Me Focused](https://daily.dev/posts/my-codex-workflow-so-far-and-how-it-keeps-me-focused-oxhykk3m8) · Atomic Spin · 0 upvotes · 0 comments
- [Put Your Own Logic Inside the Codex Agentic Loop](https://daily.dev/posts/put-your-own-logic-inside-the-codex-agentic-loop-jowjgysff) · Towards Data Science · 1 upvotes · 0 comments
- [How to Use Codex in VS Code: From First Task to Reliable Agent Workflow](https://daily.dev/posts/how-to-use-codex-in-vs-code-from-first-task-to-reliable-agent-workflow-rw0nbdzwj) · Medium · 1 upvotes · 1 comments

---

Tags: [#git](https://daily.dev/tags/git), [#chatgpt](https://daily.dev/tags/chatgpt), [#openai-codex](https://daily.dev/tags/openai-codex)

[View this post on daily.dev](https://daily.dev/posts/how-i-use-the-same-git-work-log-with-codex-and-chatgpt-dncckvdht)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"How I use the same Git work log with Codex and ChatGPT","url":"https://daily.dev/posts/how-i-use-the-same-git-work-log-with-codex-and-chatgpt-dncckvdht","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/how-i-use-the-same-git-work-log-with-codex-and-chatgpt-dncckvdht"},"datePublished":"2026-07-13T17:45:35.423Z","dateModified":"2026-09-14T06:24:27.828Z","description":"A workflow for keeping a unified plain-text work log across multiple AI coding agents (Cursor, Codex, ChatGPT desktop) using a native Git post-commit hook. The...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/907c6c028f107fad7d0379f1571dde35?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/907c6c028f107fad7d0379f1571dde35?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Flavio Copes","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Flavio Copes","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/1f2dbd275797411bbd37bfdaaf0951a9","url":"https://daily.dev/sources/flaviocopes"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/how-i-use-the-same-git-work-log-with-codex-and-chatgpt-dncckvdht","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"git,chatgpt,openai-codex","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Flavio Copes","item":"https://daily.dev/sources/flaviocopes"},{"@type":"ListItem","position":3,"name":"How I use the same Git work log with Codex and ChatGPT"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/how-i-use-the-same-git-work-log-with-codex-and-chatgpt-dncckvdht#faq","mainEntity":[{"@type":"Question","name":"How do I make Codex install a Git post-commit hook automatically before the first commit in a repo?","acceptedAnswer":{"@type":"Answer","text":"Add a PreToolUse hook in ~/.codex/hooks.json that matches the Bash tool and runs an installer script before commands execute. The script checks whether the command contains git commit, and if so installs .git/hooks/post-commit in the current repository before the commit runs, so Git calls it after the commit succeeds. Using PreToolUse instead of PostToolUse avoids missing the very first commit in a new repository. Developers wiring up agent hooks and automation can compare Codex and Cursor workflows on daily.dev."}},{"@type":"Question","name":"How can I avoid overwriting an existing .git/hooks/post-commit script when adding a new one?","acceptedAnswer":{"@type":"Answer","text":"Move the existing post-commit hook to a backup file such as .git/hooks/post-commit.before-work-log, then create a new wrapper script that calls the backed-up hook first, captures its exit status, runs the new logic afterward, and finally exits with the original status. This preserves prior hook behavior while adding new functionality. Anyone chaining Git hooks safely can find similar setup patterns curated on daily.dev."}},{"@type":"Question","name":"How do I check whether Codex supports lifecycle hooks like PreToolUse?","acceptedAnswer":{"@type":"Answer","text":"Run codex features list in the terminal and look for a line reading 'hooks stable true' in the output. Current Codex versions include stable lifecycle hooks, and the ChatGPT desktop app shares the same local Codex configuration stored under ~/.codex/. Developers configuring Codex tooling can track agent feature support on daily.dev."}}]}
```

