Agentic coding for economists

Introduction

This is an opinionated, brief intro to agentic coding for economists. I skip motivation - assuming the reader already has an interest in agentic coding and is convinced of its utility for economics research.

The focus of this introduction is a practical introduction to modern AI, so that the reader reaches a point quickly of being able to make use of these tools for their projects.

A few caveats:

1. What do we mean when we say AI?

AI is a broad term comprising many subconcepts: computer vision, robotics, reinforcement learning, and even philosophy of mind.

When we talk about AI here, we mean something much narrower: applications of large language models (LLMs), the kind of model underneath ChatGPT and Claude. You don't need to know how these models are trained, but it helps to know roughly what one does. An LLM takes some text and predicts what comes next. Give it "The effect of the program was" and it might continue with "positive". It works in small pieces called tokens, each often a word or part of a word: it predicts the next token, adds it to the text, and repeats.

Input
The text so far
Theeffectoftheprogramwas
goes into
Model
LLM

Works out how likely each possible next token is.

outputs
Prediction
A probability for each possible next token
Illustrative distribution: toy numbers, not model output.
  • positive41%
  • smalldrawn22%
  • large12%
  • not8%
  • all other tokens17%
one token is drawn from it
Draw
This time: small

It had a 22% chance. Another run could draw positive instead.

added to the text
Next input
The text, one token longer
Theeffectoftheprogramwassmall
the same step repeats with the longer text
The same step, repeated: a new draw each time
  1. Step 1 The effect of the program was small
  2. Step 2 The effect of the program was small for
  3. Step 3 The effect of the program was small for particip
  4. Step 4 The effect of the program was small for participants
  5. … and so on, one draw at a time. Each box or underline marks one token; a token can be part of a word, as in steps 3 and 4.
Figure 1. Each token is a draw from a probability distribution, so the same input can produce different text.

You reach a model through software, and that software determines much of what the model can do for you. The most familiar is chat interfaces like ChatGPT and Claude: you type a question, perhaps attach a paper, and copy the answer into Overleaf or Stata yourself. Another is the API, where a script sends requests to the model, for example to classify each document in a large set.

You and your computer
Claude chat
You

Type each message and read each reply.

Browser

Shows the chat page. Sends each message and displays each reply.

Script using the API
You

Write and run the script, then check what it saved.

Your script

Sends a request for each document and saves each response.

Internet
Your browser to Anthropic's servers: request Anthropic's servers to your browser: response
Your script to Anthropic's servers: request Anthropic's servers to your script: response
Anthropic's servers
Software
Claude chat service

Turns your conversation into a request to the model.

The chat service to the model: request The model to the chat service: response
Software
Anthropic API

Passes your script's request to the model.

The API to the model: request The model to the API: response
Model
A Claude model

Reads the request and writes the response.

Either route can reach the same model.

Shared: a Claude model on Anthropic's servers, and you directing the work.

Different: you type and read in a chat page, or you write a script that sends requests and saves responses.

The same model can still answer differently by route: the instructions and settings sent with a request can differ.

Figure 2. Chat or script, your request goes to a Claude model on Anthropic's servers.

The third is a coding agent, such as Codex or Claude Code, which is our focus. An agent is software that gives the model tools and lets it keep going: it takes an action, looks at the result, and decides on the next step. With the access you grant, those tools can read and edit the files in a project folder, run code, and pull in material from connected systems such as your email.

You

Give the task and decide what the agent may access.

task, which the agent software passes to the model
Model

an LLM

Agent software

a coding agent: Codex, Claude Code

Tools

files, running code, connected systems: within the access you grant

Step 1
Model requests an action from the agent software
Step 2
Agent software performs the action with the tools
Step 3
Tools return the result to the agent software
Step 4
Agent software passes the result to the model

After step 4, the model either requests another action, back to step 1, or writes its report.

report, which the agent software shows you
You

Read what it reports, and decide what happens next.

Color shows who is acting: You Model Agent software Tools Black arrows and numbers show direction and order only.
Figure 3. The model only requests actions; the agent software is what actually carries them out.

Suppose a table in your paper no longer matches what the code produces. An agent working in the project folder can open the script, run it, compare the output against the draft, and report where the two diverge. You copy nothing between applications, but you still read what it found and decide what to change.

Who does each step? Hypothetical example
Color shows who does the step: You Agent software
You, in both workflows

Ask: "Why does the table in my paper differ from the script's output?"

Step
Manual chat workflow In this example, the chat application has no access to your project files.
Coding agent Working in your project folder, with the access you grant.
Provide the script

You paste it into the chat.

Agent software opens it.

Run the script and get the output

You run it, then paste the output.

Agent software runs it and reads the output.

Provide the draft table

You paste it into the chat.

Agent software reads it.

either way, you get back a comparison of the output and the draft table
You, in both workflows

Check the comparison, then decide what to change. Neither workflow guarantees it is right.

Figure 4. Same task both ways; with an agent, the copying and pasting is no longer your job.

The agent could only work from what it had actually read: the script, the output, the draft. So the practical question is what information is actually available to the model as it works: the subject of the next section.

2. Tokens, context, and memory

In Section 1, we covered language models, the applications built around them, and how agents use tools to work on a project. In this section, we look at the information a model has available while it works: what enters its context, how that context grows, and what can carry forward into later work. This helps explain why the same agent can respond differently depending on the material it has been given.

The material available for the model's next response is its context. You can think of it as working memory, as long as you keep the analogy loose. The application supplies instructions, along with descriptions of the tools the agent can use. The conversation adds your messages and the assistant's replies. And when the agent uses a tool, what the tool returns is added as well: the contents of a file it read, the results of a search, or the output of a command it ran.

Access is a separate matter. Giving an agent access to a project folder lets it look for and read files. It does not put every file in the folder into context. Suppose the folder holds twenty files, and the agent opens one script and runs it. The script's contents and the output it returned are now in context. The other nineteen files are still only available, like articles on your desk that you have not read yet.

Which of the 20 files are in context? Hypothetical example
Project folder
20 saved files the agent may open
  • 1 script: opened and run
  • 19 files: available, not read

All 20 files stay in the folder. Reading copies a file's contents; it does not move the file.

The agent opens one script and runs it. What comes back is copied into context.
Context
What the model works from for its next response
Instructions and tool descriptions

Supplied by the application.

Conversation

Your messages and the assistant's replies.

Tool results
  • A copy of the script's contents
  • The output from running it

Nothing from the other 19 files is in context.

Figure 5. Access makes a file available; only what the agent reads enters the model's context.

As the work continues, that material accumulates: more messages, more replies, more tool results. The amount that fits into a single model interaction is limited, and this capacity is called the context window. Its size is measured in tokens, the small pieces of text from Section 1.

Text is counted in tokens
One sentence
The draft needs reorganizing.
split into
7 tokens
Thedraftneeds
3 whole words
reorganizing
1 word in 3 parts
.
punctuation

Split checked with one encoding, cl100k_base; other tokenizers divide the sentence differently. The spaces between words belong to tokens and are not drawn.

Everything in context is counted the same way, inside a window of fixed size
  1. Start of a conversationInstructions and tool descriptions are already there.
  2. After some workMessages, replies, and tool results have been added.
  3. After a long sessionMore of each. Little room is left.
Shading shows what is in context: instructions and tool descriptions conversation tool results room left

Schematic: the widths are not real token counts.

Figure 6. Everything in context is counted in tokens, and it accumulates inside a window of fixed size.

Each model has a finite context window, and these windows have grown substantially. Claude reached 100,000 tokens in May 2023, up from 9,000. As of October 2026, the latest Opus and Sonnet models in Claude Code have one-million-token windows, though the window available to you depends on the model and configuration.

To put that in familiar terms, suppose you ask the agent to read a 10,000-word economics paper. At roughly three English words per four tokens, its text would take around 13,000 tokens. Reading ten such papers into the conversation would use roughly 130,000 tokens, or 13% of a million-token window, before adding instructions, your discussion, code, and other tool results. This is a sense of scale, not a measured paper count: equations, tables, and how a PDF is read can change the total.

Claude Code in the desktop app
Expanded Claude Desktop context panel. Messages: 230.7k tokens, 23.1%; system tools: 16.3k, 1.6%; MCP tools: 14.3k, 1.4%; skills: 9.9k, 1.0%; system prompt: 5.8k, 0.6%; MCP server instructions: 3.3k, 0.3%; custom agents: 1.3k, 0.1%; autocompact buffer: 33k, 3.3%; free space: 685.3k, 68.5%. Deferred MCP tools and system tools appear separately with dashes in the percentage column.

Captured October 12, 2026. Example values; capacity depends on the model and configuration.

Open the full-size breakdown
Figure 7. Claude reports that 28% of this conversation’s one-million-token window is occupied. Messages take most of that space, but instructions, tool descriptions, and skills count too. The rest is divided between free space and a buffer reserved for compaction.

A growing context can create problems even before it fills up because models tend to perform worse as the context gets longer, as is demonstrated by the below figure.

Line chart titled Long context retrieval, MRCR v2, 8-needle. Vertical axis: mean match ratio in percent, 0 to 100. Horizontal axis: input tokens, 128K to 1M. Opus 4.6: 91.9 at 256K, 78.3 at 1M. Sonnet 4.6: 90.6 at 256K, 65.1 at 1M. GPT-5.4: 79.3 as a bin average across 128K to 256K, 36.6 at 1M. Gemini 3.1 Pro: 71.9 at 128K, 59.1 at 256K, 39.4 at 512K, 25.9 at 1M. Sonnet 4.5 is lowest and rises: 10.8 at 256K, 18.5 at 1M. Footnote: Gemini numbers measured by Context Arena on the same MRCR v2 benchmark, not Google's self-report. OpenAI's score represents a bin average across 128K to 256K rather than a single context length.

Source: Anthropic, March 13, 2026, claude.com/resources/articles/1m-context-ga. Benchmark: MRCR v2, 8-needle. A historical benchmark illustration, not a current model ranking.

Open the full-size chart
Figure 8. Each line represents a model. Moving right means more input tokens; higher scores mean better retrieval on this test. Most models shown retrieve less reliably as the input grows. Material can fit in the context window without the model reliably finding what it needs.

When the context window nears its limit, applications can automatically trigger a process called compaction. A model summarizes the relevant parts of the conversation, such as the goal, the current state of the work, and the main decisions. That summary is carried forward in place of the earlier messages and tool results, while some context, including the application's instructions, stays as it was. The window is no larger, but much of it is free again for new work, and you continue in the same conversation. The summary is a selection, not a complete record.

Compaction makes room, and the same conversation continues Illustrative example

This example assumes a window that holds 1 million tokens (k = 1,000 tokens). The point at which compaction starts and the size of the summary vary in practice.

Read the bars for proportions. The boxes list what is in context; their sizes do not represent token counts.

Before compaction
The window is nearly full
Instructions and tool descriptionssupplied by the application30k
Earlier work in this conversation
  • Your messages80k
  • The assistant's replies220k
  • Contents of files it read400k
  • Output from tools it ran220k
Little room left50k
30k + 80k + 220k + 400k + 220k= 950k occupied
950k occupied (95%)50k available (5%)
950k + 50k = 1,000k capacity
Compaction: a model summarizes the earlier work
After compaction
Same conversation, same window, more room
Instructions and tool descriptionsstill in context30k
Summary of the earlier workA shorter account, not every detail.20k
Room for new workavailable again950k
30k + 20k= 50k occupied
50k occupied (5%)950k available (95%)
50k + 950k = 1,000k capacity
In the windows and meters: occupied available

Both are the same window with the same capacity. Applications differ in what else they keep, and compaction does not change the files saved in your project.

Figure 9. In this illustrative example, the window holds 1 million tokens and 950k are occupied before compaction. Afterward the instructions (30k) and a summary (20k) occupy 50k, which leaves 950k of the same window free for the same conversation to continue.

That shorter account can lose distinctions you care about. Suppose that during a long session you decided to leave out the survey years before 2010, because the survey question was reworded that year, and you left one robustness check open. "Discussed dropping the early years" leaves open whether you agreed, declined, or postponed the decision. Even an accurate "drop the years before 2010" omits the reason and the open check. The reason matters if the agent later suggests adding those years back to enlarge the sample.

What can a shorter account lose? Illustrative wording, not model output
In context before compaction
A long exchange that settled three things
Decision
Leave out the survey years before 2010.
Reason
The survey question was reworded in 2010.
Still open
One robustness check.
Compaction replaces the exchange with a shorter account
In context after compaction
The shorter account is what the model now works from. It might read:

"Discussed dropping the early years."

  • Decisionunclearagreed, declined, or postponed?
  • Reasonmissing
  • Still openmissing
or it might read

"Drop the years before 2010."

  • Decisionkept
  • Reasonmissing
  • Still openmissing

Some systems keep a compressed form you cannot read, so there may be no summary to inspect.

Later in the work: the agent suggests adding the early years back to enlarge the sample. Neither shorter account says why they were left out.
Figure 10. A shorter account can keep a decision and still lose its reason and what remained open.

Because LLMs have limited context windows and hit these compaction events, a common practice is to keep a record of the state of your work on your file system. This could just be a progress log of tasks being done. Or, before starting a big project, you could use the agentic coding tool to create a document in your project folder that records what you're brainstorming and planning.

That document stays on your file system through a compaction event. The tool can then tell its future self in the summary, "Take a look at this file where we're writing out the brainstorm." By reading the file, it can pick up the details of what you were working on, even if those details are no longer in the conversation's context.

Project folder

saved files

Context

what the model works from

This conversation

You settle a decision, its reason, and what is still open.

Step 1
Agent software writes them into a note in the project folder
Step 2
the note You read the note and correct it

The conversation ends. The note stays in the folder.

Later: a new conversation, with a new context
A later conversation

Already here: instructions, tool descriptions, your new message, perhaps selected memory. The note's contents are not.

Step 3
You point to the note; Agent software reads it, and a copy of its contents enters context

The note is still in the folder.

The decision, its reason, and the open question are in context again.

Color shows who acts: You Agent software Black arrows show where content is written or copied. Numbers show order.
Figure 11. A checked note carries a decision forward once the later conversation reads it.

In these first two sections, we've explained at a basic level what is going on with coding agents like Claude Code and Codex. In the next section, we'll get you set up to actually begin working with them.

3. Setup

In this section, let's get practical. Which agentic coding tool should you use? How much should you pay for it? What are some of the basics you need to understand in order to use it?

Claude Code vs Codex

I could say a lot here, but as a practical suggestion: you can use either tool - they're both great. Ideally, you'd have both, but you should just start with one.

I prefer Codex, because its desktop app is much better than Claude's, but Opus 5.5 seems to currently be the best value (as of Oct 13, 2026).

CLI vs VS Code vs Desktop App

There are many interfaces through which to use coding agents, but the three most common options are the command line interface, as a VS Code extension, or within the coding agent's desktop app.

Claude Code in the desktop app, VS Code, and the terminal

Desktop app
Claude Code desktop session titled RSI paper summary slides, with the conversation on the left and its HTML slide preview in a Browser pane on the right.
Existing research-paper session, captured October 13, 2026. The conversation is on the left; the HTML slides it produced are open beside it. The desktop app lets you discuss the work and inspect its output in the same window. Open the full-size screenshot
VS Code
Screenshot pending · review note VS Code with the Claude Code extension panel open beside the editor, on the same sample folder and request as the desktop shot.
CLI
Screenshot pending · review note A terminal running claude in the same sample folder, showing the same request and its reply. Not the older /context terminal capture.
Claude Code can be used through the desktop app, a VS Code extension, or the terminal. You can sign in with the same account; available features and models can differ by interface.

I recommend you use coding agents from within the desktop app. OpenAI and Anthropic continually improve their apps with useful features only available in the apps. Some examples:

And many other useful features. Use the app!

Subscriptions: what do you need, and how much should you pay?

ChatGPT and Claude both come on $20, $100, and $200 per month plans. ChatGPT now has a $500 per month plan, but that's basically irrelevant for you all, because it comes with far more usage than 99% of economists will be able to make use of.

Some of you may have an EDU plan. Generally, I don't recommend depending on the EDU plan because the amount of usage provided by it is pretty minimal.

Start with a $20 per month plan if you're very budget constrained. Quickly, you'll have to move up to a $100 per month plan, and for some people that will be enough. But for a fair number of people, you'll find yourself eventually needing to move to the $200 per month plan.

Organizing your Work

Each project should have its own folder. The data, code, references, etc for that project should sit in its folder.

Typically, then - when you want to work on some project - you open a new chat in that folder.

Then, when you ask something, the agentic coding tool "knows" to search first within the context of that folder to find answers.

Ideally, you should have both your paper and your code in your project folder. Each provides context which is important for the other.

You may also want to have literature in the folder, important emails, data, and random research notes. Anything the coding agent might find useful to help you in the future.

How should you organize all of this? Ask the coding agent!

Suggested prompt: I'm working on a research project where <describe project at length>.

Here are some of the types of things which probably make sense to be inside the folder: <describe them>.

Help me figure out how to create a folder structure for this project.

Model Selection

When you're using Claude Code or Codex, you'll have an option to choose a model and an effort level.

Suggestions on both:

Permission Levels

A coding agent can read files, edit files, and run commands on your computer. The permission level decides which of those it may do on its own and which it has to ask you about first.

The tradeoff is between interruptions and autonomy. At the most cautious setting, the agent asks before each edit or command. At the most permissive setting, "bypass permissions", the coding agent does everything without asking for permission.

If you're starting out, I recommend the option in between that both apps now offer: an automatic review mode, where a separate reviewer model checks the actions that would otherwise need your approval and blocks the ones that look wrong. In Claude Code this is Auto. In Codex it is Approve for me.

Keeping Track of Changes

A problem you're likely to encounter early on with agentic coding tools is that they're capable of changing many files at once.

How do you safely allow agentic coding tools to work at full power without overwriting critical work?

This leads us to the next section: git

4. Git: keeping track of what changes

Git is a version control tool. It is software which helps you keep track of the precise changes made in your project. Most economists have heard of Git, and most don't use it. With coding agents, it becomes both much more important to use git and much easier to use it.

  1. Slide 1 of 1: What Git is

    • Project folder — The files you already work in
    • paper.tex draft text; analysis.do analysis script; tables/table1.tex generated table; figures/mobility.png generated figure
    • .git/ — hidden history layer inside the project
    • git status: modified analysis.do; modified tables/table1.tex
    • git diff: - old estimate note in table; + updated estimate note in table
    • Commit — A named checkpoint you can return to
    • c2 Update robustness table — HEAD -> main — The project state is saved with a name, time, and exact diff.
    • c1 Baseline analysis works — The previous good version remains in history.
Figure 12. What Git adds to a project folder. A slide from my workshops; file names and commits are schematic examples.

For four reasons, Git becomes more important with agentic coding tools:

  1. Slide 1 of 4: Benefit 1: Lineage

    • Project folder — One result depends on many files
    • paper.tex main draft; analysis.do estimation script; make_tables.py table pipeline; tables/table1.tex generated output; figures/mobility.png figure output
    • Claude Code edits across files
    • edited: paper.tex, analysis.do, tables/table1.tex
    • Without Git — Lineage turns into guesswork
    • analysis_final.do; analysis_final_REVISION_v3.do; paper_new_new.tex; tables_old/; Dropbox conflicted copy/
    • Which change produced this result?
    • With Git — The agent leaves a reviewable trail
    • main + claude/robustness-table
    • git status --short: M paper.tex; M analysis.do; M tables/table1.tex
    • git diff main...claude/robustness-table: - baseline controls only; + add robustness controls and updated table note; + regenerate Table 1 from the same script
    • c1 commit checkpoint — agent updated robustness table — exact files, exact lines, named checkpoint
  2. Slide 2 of 4: Benefit 2: Memory

    • Git history — A project remembers how it got here
    • git log --oneline --graph
    • c3 Regenerate outputs — HEAD -> main — figure and table outputs are updated from the scripts.
    • c2 Add controls — paper.tex and table notes change together.
    • c1 Create baseline table — analysis.do produces tables/table1.tex for the first draft.
    • Claude Code
    • Relational structure — Which files fit together? — History shows that scripts, generated tables, figures, and the draft changed as one unit.
    • PI / Director updates — What changed since last time? — Claude Code can summarize the commit history into precise project updates for people who are not deep in the code.
    • Debugging — When did the error enter? — If a table or test breaks, history narrows the search to the change where the problem appeared.
  3. Slide 3 of 4: Benefit 3: Effective code review

    • 1. Branch — Start from main — Protect the stable version before asking an agent to make changes.
    • 2. Work — Change a branch — Claude Code edits papers, code, tables, and generated outputs on the branch.
    • 3. Pull request — Compare to main — Git points review at the files and lines that actually changed.
    • Pull request diff — The reviewer starts from what changed
    • main vs claude/event-study-cleanup
    • git diff --name-status main...claude/event-study-cleanup: M analysis/event_study.do; M tables/event_study.tex; M paper/results.tex
    • line-level diff the agent can inspect: @@ analysis/event_study.do: 84-87 @@; - controls = [baseline]; + controls = [baseline, cohort, sector]; + cluster = worker_id; @@ paper/results.tex: 31-33 @@; - we estimate a baseline specification.; + we report robustness controls in Table 1.
    • Agentic review loop — Configured reviewers, used when relevant
    • PR ready for review — review hooks fire
    • Subagent 1 — Figure Standard Checker — Checks whether charts follow your conventions: titles, labels, colors, notes, and paper/table consistency.
    • Subagent 2 — Mover Design Reviewer — Reviews mover-design logic: sample construction, timing, identifying variation, and interpretation.
    • Subagent 3 — Python Best Practices Reviewer — Checks Python changes for reproducible paths, clean data pipelines, readable pandas, and maintainable plotting code.
    • 4. Merge — Only after review — The reviewed change becomes the new project history.
  4. Slide 4 of 4: Benefit 4 (conditional): Paper-code consistency

    • Without doing this — Paper is outside the project
    • repo: analysis/ estimation scripts; figures/ generated figures; tables/ generated tables
    • not one context
    • elsewhere: paper.tex draft lives in Overleaf
    • Problem 1 — Claims drift from outputs — A table or figure changes, but the paper text can quietly keep the old claim.
    • Problem 2 — Claude Code sees code, not the argument — The agent has less context about the research question, model, notation, and intended empirical object.
    • With doing this — One inspectable project boundary
    • one repo Claude Code can inspect: paper/ draft, claims, model; analysis/ estimation scripts; figures/ generated figures; tables/ generated tables
    • Shared context — The paper explains the code — Claude Code can use the draft to understand what the scripts estimate and why the outputs matter.
    • Consistency check — Claims, tables, and figures stay closer — A reviewer can compare paper text against generated outputs, which makes inconsistencies easier to catch.
    • Writing code — The code has the paper as context — When Claude Code revises code, it can see the research question and intended empirical object.
Figure 13. Four benefits of Git when an agent edits your project; the fourth depends on keeping the paper in the same repository. Workshop slides; file names, commits and reviewers are schematic examples, and Codex handles the same work as Claude Code.

At the same time, Git becomes a lot easier to use with agentic coding tools because you can use the agentic coding tool to manage a lot of the Git operations. In the slides below, I map out different Git commands in terms of things that you already know.

  1. Slide 1 of 2: Git concepts in terms of what you already know

    • Create a folder for a new project — init / repo: start tracking this project — Git begins inside the project folder; Dropbox does not need to be involved.
    • Put the project in Dropbox / turn on sync — GitHub remote / push / pull: make the project syncable and shared — Like Dropbox, but nothing syncs on its own: you push and pull commits.
    • Make final_v2 / revised copies — commit: save a named checkpoint — A checkpoint with a message instead of meaning hidden in filenames.
    • Copy the folder before trying something risky — branch: try a connected separate version — A separate history in the same folder, not a second copy; it still knows where main is.
    • Ask someone to look at your version — pull request: make a structured review packet — This is the new concept: it shows exactly what changed against main.
    • Replace the shared version after review — merge: accept the reviewed version — Bring approved changes from the branch back into the main project history.
  2. Slide 2 of 2: You still say the Git words

    • Git word; What you tell Claude Code; What Claude Code handles; Commands you may see
    • init — Set this project up with Git. — Initialize history, suggest .gitignore, and optionally set up GitHub. — git init, git add, gh repo create
    • commit — All right, commit the work. — Inspect the diff, stage the right files, and save a named checkpoint. — git status, git diff, git commit
    • branch — Check out a new branch for this. — Create a safe experiment lane without disturbing main. — git switch -c, git branch
    • PR / merge — Open a PR, review the changes, and open it in Chrome for me to check when done. — Compare the branch to main, surface the diff, and merge after your approval. — gh pr create, gh pr merge, git merge
Figure 14. Git words, the familiar habits behind them, and what to say to the agent. Workshop slides; the commands are there to recognise, not to memorise.

In practice, what you need to tell Claude Code or Codex is just what you see in the "What you tell Claude Code" column in Figure 14.

When you're starting a new project, a useful practice is to simply ask something like this:

Suggested prompt: Set this project up with Git.

As we work, commit each coherent piece of work with a clear description.

A meta instruction like that is useful to have. Both tools also have project instruction files: AGENTS.md in Codex and CLAUDE.md in Claude Code. Ask the agent to put the instruction to commit your work as you go into the appropriate file in your project folder.

Each time you start a new conversation in that project, the contents of the AGENTS.md or CLAUDE.md files are read into the context window automatically. So the agent should do this basic Git operation of committing your work regularly without you needing to repeat the instruction in every chat.