Peter Steinberger, who created OpenClaw, says the project deleted about 400k lines of its own tests with little change in coverage, because "modern models just love writing tests for every tiny change, even if they aren't useful." He says a skill helped.
Guides · Repos
Repositories for beginners, and how to let an agent work in one safely
A repository is a project folder that remembers its whole history. Learn the five words you need, the everyday loop, and eight rules that keep an AI agent from breaking your project.
Updated
What a repository is
A repository, or repo, is a project folder that keeps its whole history. Git is the tool that tracks that history on your computer. GitHub is a website that keeps a copy online, so you can share it and review changes with others.
Source GitHub Docs: What is GitHub reference
The five words you need
Clone
Download a copy of a repo to your computer.
Clone commandgit clone https://github.com/OWNER/REPO.git cd REPOSource Git docs: git clone reference
Branch
A parallel copy where you can try things without touching the main version.
Branch commandgit switch -c fix-login-bugSource Git docs: git switch reference
Commit
A saved checkpoint with a short message about what changed. Check what you are saving first.
Commit commandgit status git diff git add -A git commit -m "Fix login redirect loop"Sources Git docs: git commit referenceGit docs: git diff reference
Push
Upload your branch to GitHub.
Push commandgit push -u origin fix-login-bugSource Git docs: git push reference
Pull request (PR)
A request to merge your branch into main. You, or others, review the changes line by line before they go in. Open one on the GitHub website or from the terminal.
Pull request (PR) commandgh pr createSources GitHub Docs: Pull requests referenceGitHub CLI manual: gh pr create reference
The everyday loop
Get the latest main, make a branch, change things, commit, push, open a pull request, review it, merge it.
git switch main
git pull
git switch -c my-change
# make your changes, then:
git add -A
git commit -m "Describe the change"
git push -u origin my-change
gh pr createEight rules for letting an agent work in a repo
One line to remember: branch first, commit often, read every diff, keep secrets out, and make the agent prove it works.
Give it a branch, never main.
If the work is bad, delete the branch and nothing is lost.
Source Git docs: git switch reference
Commit before you start.
That gives you a clean checkpoint.
git restore .throws away uncommitted changes, so commit first.Source Git docs: git restore reference
Read every diff.
Use
git diffor the pull request view. If you don’t understand a change, ask the agent to explain it before you keep it.Sources Git docs: git diff referenceGitHub Docs: Pull requests reference
Keep secrets out.
Put keys in a
.envfile, add.envto.gitignore, and never paste keys into the chat.Sources Git docs: gitignore referenceGitHub Docs: Ignoring files reference
Limit what it can do.
Keep approvals on for anything that deletes files, installs packages, pushes code or touches production. Anthropic suggests asking before actions “that are hard to reverse, affect shared systems, or could be destructive.”
Source Anthropic: Prompting best practices undated
Make tests the judge.
Ask the agent to run the tests and show the output. No tests yet? Make “add a test for this” part of the first task.
Source Claude Code: Best practices undated
Merge through a pull request.
Protect main on GitHub so nothing lands without a PR. Even on your own, the PR screen is the best place to read the whole change.
Source GitHub Docs: About protected branches reference
No force-push unless you know why.
git push --forcecan overwrite commits other people already pushed.Source Git docs: git push reference
Five beginner mistakes with coding agents
- A vague request with no definition of done. Use the prompt template: goal, context, constraints, done when.
- Not reading the diff. Changes you didn’t review are how bugs, deleted code and leaked keys get in.
- Working on main with no commits. If the agent breaks something, there is nothing to go back to.
- Giving it secrets. Pasting API keys into chat, or letting the agent write them into files.
- Trusting “done” without proof. Ask for the command and its output, or run it yourself.
What people report works
What developers shared on X about agents in real repos.
noko says agents can still delete files: "i tried 19 ways, 8 got through." What held up for the author was one folder per agent, a CLAUDE.md for the job, a memory file it reads first and a log file it writes when done.
Ado says each Claude Code session starts with only the system prompt and tools, so project-wide context belongs in CLAUDE.md (or AGENTS.md) at the repo root.
Practice on a real repo
Every Repo of the Week page has a beginner setup guide for a trending GitHub project.
Sources
- Git docs: git clone reference
- Git docs: git switch reference
- Git docs: git commit reference
- Git docs: git diff reference
- Git docs: git push reference
- GitHub Docs: Pull requests reference
- GitHub CLI manual: gh pr create reference
- Git docs: git restore reference
- Git docs: gitignore reference
- GitHub Docs: Ignoring files reference
- Anthropic: Prompting best practices undated
- Claude Code: Best practices undated
- GitHub Docs: About protected branches reference
- GitHub Docs: What is GitHub reference