What Tools Do AI Coding Assistants Actually Use? (Claude Code, Codex CLI, Aider)

What Tools Do AI Coding Assistants Actually Use?

How Claude Code, Codex CLI, and Aider read files, search codebases, run tests, and commit code — under the hood


AI coding assistants feel like magic. You type "add a login form to the dashboard," and the tool finds the right files, writes the component, checks that it compiles, runs your tests, and shows you a git diff. But there’s no magic involved — just a loop calling the same Unix shell tools that have been on your machine for decades.

This guide breaks down exactly which programs run when an AI coding assistant does its job, why it matters for performance and security, and what you need to know if you ever want to build one yourself.


How AI Coding Assistants Work: The Core Loop

Every major coding assistant — Claude Code, OpenAI Codex CLI, Aider, Cline, Cursor — follows the same fundamental agent loop:

1. receive your prompt
2. think: what context do I need?
3. call tools (rg, cat, git, npm...)
4. observe the output
5. think: what is the next step?
6. repeat until the task is complete

The LLM is the brain. The shell tools are the hands. The assistant is not doing anything you couldn’t do manually in a terminal — it’s just doing it faster and without being asked for each step.

Understanding the tools demystifies the whole system.


1. Search Tools: How the AI Reads Your Codebase

Before an AI coding assistant writes a single line, it needs to understand the existing code. It does this with the same search tools developers use every day.

ripgrep (rg) — the primary search tool

Ripgrep is the single most-called tool in most coding assistants. It’s fast, .gitignore-aware, and handles large codebases without slowing down.

# find all files containing a function
rg "authenticate" --type ts

# find function definitions
rg "^export function" src/ -n

# search with surrounding context
rg "handleLogin" -C 3

# list only file names with matches
rg "useAuth" -l

When you ask "add error handling to the login function," the assistant first runs rg to locate where login logic is defined — before touching anything.

fd — fast file finder

For finding files by name pattern rather than content.

fd -e test.ts          # all TypeScript test files
fd "*.config.js"       # config files
fd -t f -name "*.env"  # env files

find — the standard fallback

Still widely used, especially in environments where fd is not available.

find src/ -name "*.py" -newer requirements.txt

grep — the universal fallback

When rg is not installed, grep -r covers the same ground, just slower.

Performance tip: Install ripgrep (brew install ripgrep / apt install ripgrep) and your AI coding assistant will search large codebases measurably faster.


2. File Reading Tools: Understanding What’s Already There

After locating the right files, the assistant reads them using the simplest possible commands.

cat — read entire files

cat src/auth/login.tsx
cat src/lib/api.ts

head / tail — read partial files

Useful for large files, long logs, or checking file structure without loading everything.

head -50 src/api/routes.ts    # first 50 lines
tail -100 logs/app.log        # last 100 lines of logs

wc — check file size first

The assistant often checks line count before deciding whether to read a file in full.

wc -l src/models/user.py

ls / tree — understand directory structure

ls -la src/components/
tree src/ --depth 2

3. File Writing and Editing Tools: Making the Changes

This is where the actual code generation happens. The AI chooses its editing strategy based on the scope of the change.

Creating new files

For new files written from scratch:

cat > src/components/LoginForm.tsx << 'EOF'
import React, { useState } from 'react'
// ... generated code
EOF

patch — applying structured diffs

For precise, reviewable edits:

patch src/auth/login.tsx < changes.patch

sed — in-place find and replace

For targeted substitutions across a file:

sed -i 's/oldFunctionName/newFunctionName/g' src/utils.ts

Inline Python / Node scripts

For complex JSON, YAML, or config transformations:

python3 -c "
import json
with open('config.json') as f:
    data = json.load(f)
data['featureFlag'] = True
with open('config.json', 'w') as f:
    json.dump(data, f, indent=2)
"

4. Code Execution and Testing Tools: Verifying the Work

A well-designed AI coding assistant does not just write code — it verifies the code works. The edit-compile-test cycle happens automatically.

Test runners

# Python
pytest tests/ -v
pytest tests/test_auth.py::test_login -x   # stop on first failure

# JavaScript / TypeScript
npm test
npx jest src/auth/login.test.ts

# Go
go test ./...

# Rust
cargo test

Type checkers

npx tsc --noEmit    # TypeScript, no output files
mypy src/           # Python type checking

Linters and formatters

npx eslint src/ --fix
ruff check src/
npx prettier --write src/

Build verification

npm run build
cargo build
go build ./...
make

The loop: write → test → read error output → fix → test again. The AI runs the same cycle a developer would, just without the coffee breaks.


5. Git Tools: Understanding History and Saving Work

Git is central to how coding assistants operate. They use it to understand context before making changes and to save work after.

Reading state and history

git status                          # what has changed
git diff                            # exact line-level changes
git log --oneline -20               # recent commit history
git log main..HEAD --oneline        # changes in current branch
git blame src/auth/login.ts         # who changed what and when

Committing changes

git add src/components/LoginForm.tsx
git commit -m "feat: add login form component"

GitHub CLI (gh) for PR workflows

gh pr diff 142                      # fetch PR diff for review
gh pr create --title "..." --body "..."
gh pr checks                        # check CI status
gh issue view 88                    # read issue context

6. Package Managers and Runtime Tools

The specific tools called depend on your tech stack.

JavaScript / TypeScript projects

npm install
npm run dev
npx <tool>
bun install && bun run dev

Python projects

pip install -r requirements.txt
python manage.py migrate
uvicorn main:app --reload

Docker and containers

docker compose up -d
docker logs app_container
docker exec -it container_name bash

API testing

curl -X POST http://localhost:8000/api/login \
  -H "Content-Type: application/json" \
  -d '{"email":"test@example.com","password":"pass"}'

Real Example: "Add a post form to /dashboard"

Here is the full sequence of shell commands that actually runs when you give that prompt to a coding assistant like Claude Code:

# step 1: understand project structure
ls src/
tree src/pages --depth 2

# step 2: find the dashboard page
rg "dashboard" src/ --type tsx -l
cat src/pages/dashboard.tsx

# step 3: find existing form patterns to reuse
rg "form" src/components/ -l
cat src/components/CommentForm.tsx

# step 4: understand how API calls are made
rg "fetch|axios|api" src/lib/ -l
cat src/lib/api.ts

# step 5: check what post endpoints exist
rg "POST" src/api/ -n

# step 6: write the new component
cat > src/components/PostForm.tsx << 'EOF'
...generated component...
EOF

# step 7: add import to dashboard page
sed -i "s/from '.\/CommentForm'/from '.\/CommentForm'\nimport { PostForm } from '.\/PostForm'/" \
  src/pages/dashboard.tsx

# step 8: verify TypeScript compiles
npx tsc --noEmit

# step 9: run relevant tests
npm test -- --testPathPattern=dashboard

# step 10: show what changed
git diff

Every step is a plain shell command. The intelligence is in knowing which commands to run, in what order, and how to interpret their output.


Why This Matters for Developers

Understanding the underlying tool layer has four practical implications.

Performance: If rg is not installed, the AI falls back to grep, which is significantly slower on large codebases. Installing ripgrep is a free performance upgrade for any AI coding assistant.

Debugging AI mistakes: When an assistant makes a wrong edit, you can usually trace the cause to something it misread. Ask yourself: what did it search for, and what did it find? The error is almost always in the tool output, not the AI reasoning.

Security: Every tool the AI calls runs with your credentials on your machine. Knowing it will call git, npm, docker, and curl lets you reason clearly about what permissions it actually needs — and apply the right restrictions via allow-lists.

Building your own coding assistant: If you want to build an agent like Claude Code or Aider, you now know the full tool surface. The LLM layer is almost secondary to the design of clean tool interfaces around these programs.


The Complete AI Coding Assistant Tool Map

Category Tools Used
Search content rg (ripgrep), grep, awk
Find files fd, find, ls, tree
Read files cat, head, tail, wc
Write / edit files patch, sed, tee, inline scripts
Run code python, node, go, cargo, ruby
Run tests pytest, jest, vitest, go test, cargo test
Build npm run build, cargo build, make, gradle
Lint / typecheck eslint, tsc, mypy, ruff, prettier
Version control git, gh (GitHub CLI)
Package managers npm, pip, cargo, brew, apt
Infrastructure docker, docker compose, kubectl
Network / API curl, wget, httpie

Frequently Asked Questions

Do all AI coding assistants use the same tools?
The core tools — rg, git, cat, and test runners — are common across Claude Code, Codex CLI, Aider, and Cline. The specific invocations and sequencing differ, but the underlying programs are the same.

Does the AI have access to my entire filesystem?
By default, yes — within the working directory and its subdirectories. Tools like Claude Code support permission allow-lists (e.g., "Bash(git *)") to restrict which commands can run.

Why does the AI use rg instead of just reading all files?
Reading every file in a large codebase would exceed the LLM’s context window and cost too many tokens. Searching with rg first lets the AI be surgical about what it actually reads.

Can I build my own coding assistant with these tools?
Yes. The core architecture is: LLM + tool definitions (bash, read, write, grep) + an agent loop. Open-source projects like Aider make this concrete. The shell tools themselves require no special setup.

What happens if a tool is missing?
The AI typically falls back gracefully — rggrep, fdfind. Some tools like gh are optional; assistants skip PR-related steps if it is not installed.


Conclusion

AI coding assistants are powerful not because they invented new ways to work with code — they’re powerful because they’re exceptionally good at orchestrating the tools that already exist. The rg, git, npm, and patch commands running under Claude Code are the same ones developers have used for years.

The AI brings the reasoning: knowing which tool to reach for, what to search for, and how to interpret the output. The tools bring the execution: actually reading, writing, and running code.

When you understand this separation, the AI coding assistant stops being a black box. It becomes a system you can reason about, optimize, debug, and — if you want — build yourself.


Related Reading


Found this useful? The best way to go deeper is to run a coding assistant with verbose logging enabled and watch exactly which commands it issues. You will learn more in one session than from any documentation.


Get in Touch with us

Chat with Us on LINE

iiitum1984

Speak to Us or Whatsapp

(+66) 83001 0222

Related Posts

Our Products