# Your AI Agent Starts Every Session Like a New Hire

Killian Carlsen-Phelan, Sonar | AI Engineer NYC 2026 | 17:45

Source: https://www.youtube.com/watch?v=8vDzncmzxyg
Channel: AI Engineer (https://www.youtube.com/@aiDotEngineer). Summarised by AIE Talks.
Page: https://aietalks.com/talks/your-ai-agent-starts-every-session-like-a-new-hire
Published: 2026-10-30
Tags: agents, coding-agents, context-engineering, reliability

## TL;DR
- A new coding agent session has to rediscover project conventions, architecture rules, approved libraries, and existing code patterns before it can work effectively.
- Sonar Vortex gives the agent project context before it writes and runs deterministic SonarQube checks whenever the agent edits files.
- In a demo, Vortex rejected an agent's first fix for a temporary-file permission issue because the permissions were not set explicitly.

## Summary
Killian Carlsen-Phelan argues that coding agents lose time and tokens because each session starts without knowledge of the project's conventions, architecture, libraries, and existing code. Sonar Vortex connects to the agent, supplies that context before implementation, and brings SonarQube checks into the editing loop. The checks run after file changes and include a deeper analysis before the agent finishes its turn. In the demo, an agent unzips a log into a temporary file and writes tests, but its tests miss that the file permissions are implicit. Vortex flags the issue, then rejects the agent's first fix because it still relies on a shared temporary directory and a platform default. The speaker also distinguishes Vortex from an AI reviewing AI. Its analysis is deterministic, so the same code produces the same result. Sonar reports 36% fewer tokens and a 44% reduction in production outages for users of the approach.

## Key ideas
### Every new agent session must rediscover the repository
[00:32](https://www.youtube.com/watch?v=8vDzncmzxyg&t=32s)
Killian compares a fresh agent session with a new employee joining a project. The agent does not know the project's conventions, coding guidelines, architecture rules, or approved libraries. When asked to build an API endpoint, it searches the repository to learn how existing endpoints work. That search may be quick or may spread across the codebase, consuming time and tokens. Existing problems can also become patterns that the agent repeats in new code.

### Vortex gives the agent project context before implementation
[02:06](https://www.youtube.com/watch?v=8vDzncmzxyg&t=126s)
Sonar Vortex is a plugin that connects to the coding agent before it starts coding. It supplies architecture guidelines, approved libraries, coding standards, and a map of how the code connects. These settings can include requirements defined by the team. The agent can then go directly to relevant files instead of searching through the repository one file at a time.

### SonarQube checks edits during the agent's work
[05:53](https://www.youtube.com/watch?v=8vDzncmzxyg&t=353s)
Each time the agent uses its editing tools, Vortex triggers a quick SonarQube check on the changed files. Before the agent ends its turn, it is told to run a deeper check that can find security problems and cross-file data-flow issues. If the analysis finds a problem in new code, the issue goes back to the agent, which fixes the code and gets checked again. Killian says Vortex works with agents including Claude Code, Codex, and Antigravity, with configurable MCP clients for other agents.

### The agent's own tests can miss a temporary-file security problem
[02:29](https://www.youtube.com/watch?v=8vDzncmzxyg&t=149s)
In the recorded task, the agent was asked to unzip a log file into a temporary file and write a test showing that the same file is reused. The agent completed the feature and its tests in under two minutes, but it created the temporary file without explicit permissions. Killian says this kind of issue is difficult to test and may only be noticed by a senior reviewer who is looking for it. Vortex caught the problem after the agent's tests passed.

### Front-loaded context reduces search and rework
[10:50](https://www.youtube.com/watch?v=8vDzncmzxyg&t=650s)
In the demo, the agent asks Sonar where the relevant class lives and what Java coding guidelines apply before writing code. Vortex returns the class's parent and child architecture, existing patterns, and project-specific guidance. Killian says that giving agents context and steering at the start has the largest effect on agent performance outside model choice. More work at the front reduces later rework, correction, and intervention.

### Sonar reports fewer tokens and fewer production outages
[07:20](https://www.youtube.com/watch?v=8vDzncmzxyg&t=440s)
Killian says Vortex uses 36% fewer tokens on average, especially for refactoring existing codebases. He also reports a 44% reduction in production outages among people who use it. Vortex reuses knowledge from SonarQube scans already run in CI, so the agent can receive information about the rest of the codebase while checking the files it changes.

### Deterministic analysis is different from an AI reviewing its own code
[12:56](https://www.youtube.com/watch?v=8vDzncmzxyg&t=776s)
Killian says Vortex is not another AI checking AI-generated code. A deterministic analysis returns the same result whenever it runs on the same code, which gives teams predictable and governable guidance. In the demo, six findings appear, with two on lines the agent wrote and four in pre-existing code. New-code findings require correction, while findings in existing code are surfaced for awareness rather than forcing unrelated fixes.

### Vortex rejects a fix that still relies on implicit permissions
[14:46](https://www.youtube.com/watch?v=8vDzncmzxyg&t=886s)
The agent first puts the log in the default temporary folder and relies on the Java and operating-system defaults for access. Vortex runs again and reports that the finding remains because the file is still in a shared directory. Killian says the team's rule requires permissions to be set explicitly, even where macOS and Linux defaults may restrict access to the owner. The agent then makes a further fix and Vortex checks it again.

## Notable quotes
- "Every time you start a new agentic session in your IDE, it is like starting from scratch." (00:32)
- "Before it writes anything with Sonar Vortex now, it is going to get the coding guidelines for your project and a map of how the code connects." (05:28)
- "Outside of model choice, the context and steering from the get-go that agents receive is the single greatest lever that you can manipulate for agentic performance." (10:50)
- "This is not another AI checking AI, right? And it's certainly not it checking itself." (12:56)
- "The finding persists because the temp file is still in a shared directory." (15:34)

## Tools & references mentioned
- Sonar
- Sonar Vortex
- SonarQube
- Claude Code
- Codex
- Antigravity
- MCP
- Guitar

## Who should watch
- You are adding coding agents to an existing repository and want them to learn project rules before they start editing files.
- Your tests pass, but security and maintainability issues still reach pull-request review or production.
- You already run SonarQube in CI and want its analysis to affect the agent's work before the pull request.

## Related talks

- [SonarQube + OpenAI: Agentic Development](https://aietalks.com/talks/sonarqube-openai-agentic-development) (Killian Carlsen-Phelan, Sonar, 41:58)
- [Your AI Agent Is Hiding Its Mistakes From You](https://aietalks.com/talks/your-ai-agent-is-hiding-its-mistakes-from-you) (Ben Holmes, Warp, 19:20)
- [Stop Giving Your Agent Tools. Give It a Sandbox](https://aietalks.com/talks/stop-giving-your-agent-tools-give-it-a-sandbox) (Mikyo King, Arize AI, 14:38)
- [How We Solved Agent Building](https://aietalks.com/talks/how-we-solved-agent-building) (Andrew Qu, Vercel, 17:34)
- [Your agent is blindfolded](https://aietalks.com/talks/your-agent-is-blindfolded) (Johan Lajili, Poolside, 09:58)
