# AI use cases for Code Agent (Harvil1/codeAgent)

Repo: [Harvil1/codeAgent](https://github.com/Harvil1/codeAgent) | Use cases: 4 | Page: https://dedupedai.com/use-cases/harvil1-codeagent/

CodeAgent is an open-source Python command-line coding assistant that reads your code, edits files, runs commands and tests, and works through multi-step tasks in your terminal.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- Hand a multi-step coding task to a terminal agent: https://dedupedai.com/use-cases/harvil1-codeagent/run-terminal-agent-on-a-repo-task/
- Run the regression suite on agent-made changes: https://dedupedai.com/use-cases/harvil1-codeagent/check-agent-edits-before-merging/
- Roll back an agent session to an earlier checkpoint: https://dedupedai.com/use-cases/harvil1-codeagent/undo-agent-edits-with-rewind/
- Review an agent's plan before it touches files: https://dedupedai.com/use-cases/harvil1-codeagent/approve-plan-before-agent-edits/

## How to hand a multi-step coding task to a terminal agent with Code Agent

Repo: [Harvil1/codeAgent](https://github.com/Harvil1/codeAgent) | Difficulty: Intermediate | Time: 30 minutes | Basis: From the README

Install CodeAgent, start it in a project, and let it plan, edit files, and run commands until the task is done.

**Who it is for:** A developer with an existing project who has a multi-file change to make and wants an agent to do the routine edits in the terminal.

**The problem:** Routine multi-file changes take time to plan and type out, and a chat window cannot read or run anything in the repo.

**The outcome:** The agent works inside the project folder, reads the code, changes files, runs commands and tests, and reports when the task is finished.

### Steps

1. Install uv using the command for your system from the Quick Start section of the README.
2. Run `git clone https://github.com/Harvil1/codeAgent.git` and then `cd codeAgent`.
3. Run `uv sync` to install the dependencies.
4. Set one provider key, for example `DEEPSEEK_API_KEY`, as an environment variable, or write it under `models. .api_key` in `~/.codeAgent/settings.json`.
5. Run `uv run python main.py` and describe the change you want in plain language.

### Prompt to paste into your agent

```text
Using the Harvil1/codeAgent repo, start the interactive mode with `uv run python main.py` and give it the task: <describe the change for the target project at <path>>. Expect the agent to read the relevant files, edit them, and report a final summary. Verify by checking that the files named in the summary changed in the target project.
```

### Caveat

The README and in-code comments are written in Chinese, and macOS is described as theoretically usable but not fully verified.

Risk, credentials: The API key can be stored as an environment variable or in ~/.codeAgent/settings.json, so keep that file out of shared repos and backups.

Risk, credentials: Approve shell commands and file writes only after reading them, since the agent can run terminal commands in the project.

Dual-use notice: only use this on software, sites and systems you own or are authorized to test.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/harvil1-codeagent/run-terminal-agent-on-a-repo-task/

## How to run the regression suite on agent-made changes with Code Agent

Repo: [Harvil1/codeAgent](https://github.com/Harvil1/codeAgent) | Difficulty: Intermediate | Time: 30 minutes | Basis: From the README

Use the repo's verify script and ruff lint to check code the agent changed before you commit it.

**Who it is for:** A maintainer or contributor who will accept code from CodeAgent, or who changed CodeAgent itself, and needs a quick check before committing.

**The problem:** Agent edits can break behavior in ways that look fine on a read-through, so a fast automated check is needed before merging.

**The outcome:** A pass or fail result from the 60-plus regression checks and a lint report for the changed code.

### Steps

1. Run `git clone https://github.com/Harvil1/codeAgent.git` and then `cd codeAgent`.
2. Run `uv sync` to install the dependencies.
3. Make your changes, either by hand or by asking the agent with `uv run python main.py`.
4. Run `uv run python scripts/verify.py` and fix any failing checks.
5. Run `uv run ruff check .` and fix any lint errors before committing.

### Prompt to paste into your agent

```text
In the Harvil1/codeAgent repo, run `uv run python scripts/verify.py` after the changes in <branch or path> are applied. Expect a pass or fail count from the regression checks. Verify that the count shows no failing checks before you report the change as ready.
```

### Caveat

The README gives the check count as 60-plus items and does not describe what each check covers, so a pass does not prove every behavior works.

Dual-use notice: only use this on software, sites and systems you own or are authorized to test.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/harvil1-codeagent/check-agent-edits-before-merging/

## How to roll back an agent session to an earlier checkpoint with Code Agent

Repo: [Harvil1/codeAgent](https://github.com/Harvil1/codeAgent) | Difficulty: Beginner | Time: 15 minutes | Basis: From the README

Resume the last session and rewind to an earlier checkpoint when the agent's changes went the wrong way.

**Who it is for:** A developer who let the agent run for a while, saw the result drift from the goal, and wants to try again from an earlier point.

**The problem:** A long agent run can take a wrong turn, and starting over loses the useful context from the session so far.

**The outcome:** The session returns to a chosen checkpoint so the next attempt starts from that point.

### Steps

1. Run `uv run python main.py -c` to resume the most recent session.
2. Run `/sessions` to see the list of saved sessions if the one you want is not the latest.
3. Run `/rewind` and pick the checkpoint you want to return to.
4. Restate the task with a narrower instruction and continue in the same session.

### Prompt to paste into your agent

```text
In the Harvil1/codeAgent repo, run `uv run python main.py -c` to resume the last session, then run `/rewind` to return to <checkpoint name or position>. Expect the session to show the chosen checkpoint as the current point. Verify by asking the agent to restate the last step it will take before it runs anything.
```

### Caveat

The README says /rewind returns to a checkpoint but does not say whether file changes on disk are reverted, so check your files after a rewind.

Dual-use notice: only use this on software, sites and systems you own or are authorized to test.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/harvil1-codeagent/undo-agent-edits-with-rewind/

## How to review an agent's plan before it touches files with Code Agent

Repo: [Harvil1/codeAgent](https://github.com/Harvil1/codeAgent) | Difficulty: Beginner | Time: 15 minutes | Basis: From the README

Switch to plan mode so the agent proposes steps and waits for your approval before editing anything.

**Who it is for:** A developer working on a risky or unfamiliar part of a codebase who wants to see the agent's intended steps first.

**The problem:** An agent that starts editing right away can change many files before you understand what it is doing.

**The outcome:** You read a proposed plan, approve or adjust it, and only then let the agent make changes.

### Steps

1. Run `uv run python main.py` in the project folder.
2. Run `/plan` to enter plan mode.
3. Describe the change you want and read the plan the agent proposes.
4. Approve the plan or ask for changes, then let the agent carry it out.

### Prompt to paste into your agent

```text
In the Harvil1/codeAgent repo, start with `uv run python main.py`, run `/plan`, and ask for <describe the change> in <target project path>. Expect a written plan with steps and no file edits yet. Verify that no files in the target project changed before you approve the plan.
```

### Caveat

The README describes plan mode as presenting a plan for approval before action but does not describe how the plan is stored or edited afterward.

Dual-use notice: only use this on software, sites and systems you own or are authorized to test.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/harvil1-codeagent/approve-plan-before-agent-edits/
