Konrad Kowalski (rootsher)Principal Platform & Reliability Architect101010101011101111101010000001011011000011001011

From chat to agent: stop carrying code to AI

date
category
AI Agents
also in
AI Engineering · Automation · Engineering Practices
reading
4 min / 775 words

Almost every developer knows the first way of working with LLMs:

text
IDE
-> select code
-> copy
-> ChatGPT / Claude
-> prompt
-> answer
-> copy
-> IDE

It works.

You can fix a bug, write a regex, generate a test or get a refactoring suggestion this way.

The problem is that all the real work still stays on your side.

You:

  • choose files,
  • explain the project structure,
  • copy the error,
  • apply the change,
  • run the test,
  • copy the next error,
  • ask the model again.

AI is a consultant. Not a participant in the SDLC.

The next level: an agent in the repository

Run Claude Code directly in the repository.

Instead of:

How do I write validation for this endpoint?

try:

Add validation to this endpoint. First check the existing patterns in the project, then run the relevant tests after the change.

The difference is fundamental.

Claude can now:

text
search the repository
|
v
read the relevant files
|
v
understand existing code
|
v
change files
|
v
run tests
|
v
see the failure
|
v
fix the implementation

You do not only get an answer.

You get task execution.

What actually changed technically?

The LLM still receives information and generates a response.

An agent appears when we add:

  • tools,
  • an environment,
  • the ability to observe the results of its own actions,
  • a loop that allows more than one step.

The simplest model:

text
Claude
|
v
decides: I need to read a file
|
v
tool: read
|
v
result returns to Claude
|
v
decides: I need to change code
|
v
tool: edit
|
v
result
|
v
decides: I run the test
|
v
tool: shell
|
v
result
|
v
next decision

This is the agent loop.

It can be reduced to:

text
observe
-> decide
-> act
-> observe
-> decide
-> act
-> ...

Claude Code is the layer that handles this loop. You will sometimes see the term agent harness: code and runtime around the model that expose tools, execute tool calls and return results.

You do not need to write it yourself.

For a developer, the more important change is this:

You stop asking the model how you should perform the task. You start giving it the conditions to perform the task itself.

Built-in tools change prompting

When Claude can search the repository itself, there is no point in immediately pointing it to every file.

Instead of:

Open src/services/UserService.ts, src/controllers/UserController.ts and tests/UserService.test.ts. Add...

it is better to start from the goal:

Add support for X. First check where this project implements similar things.

It is a small change, but a very important one.

You give the agent room to use:

  • search,
  • grep,
  • glob,
  • file reads,
  • git,
  • shell.

If you immediately feed it only your own slice of the repository, you are still partly working in the copy/paste era.

Where does this help in normal SDLC?

Bugfix

Before:

text
failure
-> I copy the stack trace
-> I ask AI
-> I find the file
-> I apply the fix
-> I run the test

After:

text
"Find the cause of the failing test and fix it."
-> Claude runs the test
-> reads the failure
-> finds the code
-> fixes it
-> runs the test again

Small feature

Before:

Generate a component / endpoint / function for me.

After:

Implement the feature according to the existing project patterns and verify the change.

Refactor

Before:

What is the best way to refactor this fragment?

After:

Refactor this area without changing behavior. First find dependent places and run tests after the change.

AI starts participating not only in coding, but also in:

  • discovery,
  • verification,
  • debugging.

What have we not solved yet?

Claude has access to the repository, but that does not mean it understands your project like someone who has worked on it for a year.

It does not automatically know:

  • which architectural rules really matter,
  • what conventions apply,
  • what "done" means,
  • which operations must not be performed,
  • which tests are required after a particular change.

And that quickly becomes the next bottleneck.

But first, make the first upgrade.

Implement this today

1. Run Claude Code in a real repository

Do not create a demo project.

Take a repository where you normally work.

2. Choose a small real task

Ideally something you could do yourself in several minutes or a few dozen minutes:

  • fix a failing test,
  • add simple validation,
  • remove a deprecated API,
  • add a missing test,
  • perform a small refactor.

3. Give a goal, not a copy/paste instruction

Not:

Here are three files. Tell me what to change.

But:

Fix X. First inspect the existing code, then run the relevant tests after the change.

4. Let Claude use the repository

Before you point it to a file, check whether it can find it.

Before you copy a failure, let it run the test itself.

5. Observe the loop

Pay attention to the sequence:

text
search
-> read
-> edit
-> test
-> read
-> edit
-> test

This is the most important difference between chat and agent.

Level complete

The level is complete if, on the next small task:

  • you do not copy code from the repository to chat,
  • you do not copy the answer from chat to the IDE,
  • Claude finds the required files itself,
  • Claude performs at least part of the verification itself.

At the next level we stop onboarding Claude into the project in every new session.

Materials