---
title: The AI ran rg, git and npm: how to read the commands behind coding agents
description: Learn what rg, git diff, shell tools and build commands tell you about Claude Code and Codex — and why neither agent is tied to one search command.
date: 2026-11-22
url: https://caminhosolo.com.br/en/2026/11/commands-ai-agents-rg-git-tests/
tags: [ripgrep, rg, git, claude-code, codex, productivity]
---


> **In brief · TL;DR:** `rg` searches text and file paths; `git` shows history and changes; `npm`, `python` and other commands run software; editing tools apply patches. Claude Code and Codex may use similar commands or dedicated tools — there is no universal command assigned to each brand. Understanding the categories makes agent actions easier to supervise.

## 01 — The discovery

You ask an agent to fix a form. The screen fills with `rg --files`, `git diff`, `npm test`. Sometimes there is no visible shell command at all, only a file-search tool or a patch operation.

**The useful skill is not typing faster than an agent. It is understanding what kind of work each action represents.**

The [ripgrep](https://github.com/BurntSushi/ripgrep) project provides the `rg` binary for fast recursive searching that respects ignore rules. OpenAI's published [Codex prompting guide](https://developers.openai.com/cookbook/examples/gpt-5/codex_prompting_guide) also recommends `rg` and `rg --files` when available. So "Claude uses rg, but Codex uses a different search program" is **not a dependable distinction**.

What matters is the **harness, available tools, operating system, project instructions and current task**. One agent might run `rg` in a shell; another might use a specialised file-search tool. Both can search a project without requiring users to know the underlying implementation.

### Read actions by category

| Command or tool | Typical purpose | What to check |
| --- | --- | --- |
| `pwd`, `ls`, `find`, `rg --files` | Location and inventory | Correct directory, ignored files |
| `rg -n "text" .`, `grep` | Content search | Relevant files and line numbers |
| `cat`, `sed`, `Read` | Reading content | Context and selected range |
| `apply_patch`, `Edit` | Changing code | Resulting diff and scope |
| `git status`, `git diff` | Inspecting changes | Unrequested changes |
| `npm test`, `pytest`, `cargo test` | Running tests | Test availability and outcome |
| `npm run build`, `hugo` | Building software | Actual success or failure |
| `curl`, `wget` | Sending requests or downloading | URL, transmitted data, credentials |

These are **examples**, not a guarantee that every command exists on every machine. `npm test` depends on a configured Node project. `pytest` needs a suitable Python environment. `Read` and `Edit` may be agent-specific tools rather than shell programs.

### A subtle detail about rg

By default, ripgrep honours `.gitignore` and related rules, skips hidden files and avoids binary content. This makes searching cleaner. It also means an absent match does **not** necessarily mean an absent file. Check the working directory and ignore rules before declaring that a configuration does not exist. [ripgrep guide](https://ripgrep.dev/docs/guide/).

### Different tools, one evidence trail

Claude Code and Codex expose different capabilities and execution interfaces. An agent with a specialised read or edit tool may use it instead of composing a shell command. [Open Codex harness architecture](https://developers.openai.com/blog/codex-as-a-platform).

The goal is an **evidence trail**: locate a file, understand it, make a bounded change, then check the result. A long transcript of commands is not proof that a bug was fixed.

## 02 — The Solo verdict

**Learn to recognise `rg` and `git diff` before memorising dozens of rarely used commands.** Together they help answer where the agent found something and what it changed.

For risky operations such as deleting, overwriting, publishing or transmitting data, request a clear explanation before authorising execution.

## 03 — The workbench: inspect a project without edits

**Requirements:** a practice Git repository with [ripgrep installed](https://github.com/BurntSushi/ripgrep#installation). Open a shell in the repository directory. These commands read information only:

```bash
pwd
rg --files
rg -n "TODO" .
git status --short
git diff --stat
```

**Expected observations:** the working folder, searchable file paths, `TODO` matches with line numbers, Git status and a summary of unstaged changes. No matches or no changes can produce empty output. Ripgrep returns exit status 1 for no matches; that need not signal a broken installation.

Ask an agent: *"Show the files you searched and justify the search. Distinguish read-only commands from proposed edits. Make no changes."* Compare the explanation with real file paths.

**Next:** configure a code editor in which you can inspect this work.

References: [ripgrep](https://github.com/BurntSushi/ripgrep), [search guide](https://ripgrep.dev/docs/guide/), [Git](https://git-scm.com/docs/git-diff), [Codex prompting](https://developers.openai.com/cookbook/examples/gpt-5/codex_prompting_guide). Guided, read-only exercise.

