What coding agents actually do

A coding agent is more than autocomplete. It reads files in the project, plans a change, edits several files and runs commands such as tests or Composer. Well-known tools include Claude Code, GitHub Copilot in agent mode, Cursor and Codex. The principles in this guide apply to all of them.

The benefit depends less on the tool than on the project: how quickly can the agent tell whether its change works? The better a project is tested and described, the more work can be delegated reliably.

The project file: CLAUDE.md and AGENTS.md

An agent starts every session without any knowledge of your project. A project file in the repository gives it the context a new team member learns in their first week. Claude Code reads the file CLAUDE.md; many other tools, such as Codex, use AGENTS.md. If you need both, maintain the content in AGENTS.md and include it in CLAUDE.md with the line @AGENTS.md.

It should contain what an agent cannot guess from the code:

  • the commands for tests, static analysis and code style, exactly as they are run in the project,
  • the structure: where business logic, controllers, templates and migrations live,
  • conventions that differ from the framework default,
  • areas that must not be changed,
  • notes on the environment: Docker, PHP version, database.
# Customer portal (Symfony 7.4, PHP 8.4)

## Commands
- Tests: docker compose exec app vendor/bin/phpunit
- Static analysis: docker compose exec app vendor/bin/phpstan analyse
- Code style: docker compose exec app vendor/bin/php-cs-fixer fix --dry-run

## Structure
- Business logic lives in src/Domain; controllers stay thin.
- Database changes only through new Doctrine migrations.

## Rules
- Do not change existing migrations, vendor/ or config/secrets/.
- Every change needs tests; PHPStan must pass without errors.
- Never run commands against staging or production.

Keep the file short and specific. General advice such as “write clean code” does not help; the exact test command does. The file belongs in the repository so that the whole team works with the same rules.

Tests and static analysis as guardrails

An agent works best in a loop: change, check, correct. For that it needs checks it can run itself and that give clear results.

  • PHPUnit: tests for the most important workflows. If they are missing, start with the areas where errors would be most expensive.
  • PHPStan: static analysis finds type errors and wrong calls before code runs. For existing projects, a baseline helps: known legacy errors are recorded and new ones show up immediately.
  • Code style: PHP-CS-Fixer or PHP_CodeSniffer ensure a consistent format so that reviews can focus on content.
  • CI pipeline: the same checks run on every merge request, whether a person or an agent wrote the change.

For upgrades, Rector complements these tools: it applies many similar changes based on rules. An agent then handles the cases that Rector cannot solve automatically. More on the PHP upgrade page.

Tasks that work well

My own assessment from practice, as of November 2026.
TaskSuitability
Adding tests for existing codeGood, if the team checks that the right behaviour is tested
Similar changes during upgradesGood, together with Rector and PHPStan
Scaffolding following project conventionsGood, for example entities, controllers or Shopware plugin structures
Debugging with a reproducible testGood
Restructuring large classesWith care, in small steps
Security-relevant codeOnly with a thorough review
Unclear business requirementsUnsuitable, clarify first

A good task names the goal, the affected code and an acceptance criterion, for example: “The export should skip orders without a delivery address. Add a test under tests/Export/ that checks this.”

Review and responsibility

  • Small changes: several manageable merge requests rather than one large one.
  • Read it yourself: whoever gives the agent the task reads the change in full before requesting a review.
  • Check tests closely: an agent can adjust tests so that they pass without checking anything meaningful. Changed tests deserve special attention.
  • Label it: a note in the commit or merge request that an agent was involved helps with later questions.
  • Responsibility: approval and responsibility lie with a person in the team, not with the tool.

Access, data and code at the provider

  • Code at the provider: cloud-based agents send parts of the code and your inputs to the provider. Check your client contracts, the terms of use and whether inputs are used for training. Many providers offer business plans with their own rules for this.
  • Secrets: credentials do not belong in files the agent reads. Most tools let you exclude files such as .env.local and individual commands.
  • Commands: allow tests and analysis, but no commands against production systems, no deployments and no access to databases with real customer data.
  • Local models: where code must not leave the company, local models are an option. They are currently usually less capable than the large cloud models; check with real tasks whether the quality is sufficient.

Typical mistakes

No context

Without a project file, an agent invents structures, runs the wrong commands or creates files where nobody expects them.

Assignments that are too large

“Rebuild the module” leads to huge changes that can hardly be reviewed. Split large projects into steps with their own result.

Green tests that prove nothing

Existing tests are changed so that they pass again, even though the behaviour is wrong. A rule in the project file to change tests only after asking helps.

Outdated knowledge

Models often know older framework versions and suggest outdated patterns. The version in the project file and PHPStan with suitable extensions catch much of this.

No shared standard

If everyone uses the tool differently, results become inconsistent. Agree rules in the team and record them in the project file.

How I support teams with the introduction is described on the coding agents for development teams page.

Sources: Claude Code: memory and CLAUDE.md; AGENTS.md; PHPStan: baseline; Rector, accessed on 29 November 2026.