← ~/pillars / multi-agent-orchestration / agent-native-architecture
Agent-native architecture
Architecture is now an agent-effectiveness concern: how system boundaries, operational design, and observability determine what an agent can understand and safely change.
updated 2026-11-08 ~2 min read pattern 05/06 Architecture & Orchestration
on this page
Every architectural decision you make is now also a decision about how well agents work on your system. The constraint is the context window: not its size, but how it degrades. Anthropic’s context engineering post names the failure “context rot”: model accuracy falls as token volume rises, because transformer attention spreads thin over long sequences (context engineering). Your codebase’s shape determines how many tokens an agent must load to understand and change a feature. The goal, stated plainly in the same post: the smallest set of high-signal tokens that fully defines the work scope.
This is why architecture choices that were stylistic for humans are
operational for agents. The Claude Code docs call context the most important
resource to manage and recommend organising a codebase by problem domain
rather than technical layer, explicitly because it reduces the load for both
Claude and humans (best practices).
A repo where one feature’s code is scattered across controllers/,
services/, and repositories/ forces the agent to load three trees to
change one behaviour. A repo where the feature owns a directory lets it load
one.
Applied to Java on AWS
Three findings matter disproportionately for a Spring Boot estate on AWS:
Hexagonal architecture maps directly onto agent workflows. The AWS
Architecture Blog recommends organising code into domain/, application/,
and infrastructure/ layers specifically so agents can “modify business logic
and validate it locally without touching cloud-specific code”
(AWS architecture blog).
If your services are already ports-and-adapters, you are most of the way to
agent-friendly; the remaining move is slicing by feature, covered in
context-friendly repos.
Monorepos help until they don’t. Agents see both sides of a cross-service contract when producer and consumer share a repo, but practitioner analysis puts the ceiling at roughly 2,500 files before retrieval quality degrades, regardless of advertised context window size (tianpan.co). Past that, you need deliberate context construction, not a bigger window.
Local emulation is an agent feedback loop, not a convenience. The same AWS post highlights SAM local testing so agents validate behaviour before deploying. Testcontainers, DynamoDB Local, and LocalStack turn a minutes-long cloud round-trip into a seconds-long iteration, and an agent iterates far more often than a human does.
The greenfield question
Does a system designed for agents from day one look different? The practitioner answer is yes, with honest caveats about evidence quality: these are convergent reports, not controlled studies. The recurring elements (agent-native engineering, long-running harnesses):
- CLAUDE.md written before the code, as an executable specification of architecture, conventions, and verification commands, not extracted from the code later.
- Tests as reward signals. Tests gate agent loop completion, so they must be fast enough to run every iteration; the long-running harness pattern iterates against a feature list whose entries are marked passing or failing.
- An
evals/directory from day one for any AI feature, with golden sets defined at initial implementation rather than retrofitted. - A committed
.claude/directory (subagents, skills, settings) treated as part of the architecture, not personal tooling.
The caveat worth keeping: the same source that coined agent-native engineering reports that complex tasks still require engineer involvement. Agents accelerate implementation; humans own the architecture decisions this page is about.
// sources
- https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents
- https://code.claude.com/docs/en/best-practices
- https://tianpan.co/blog/2026-04-17-coding-agents-monorepo-context-window
- https://aws.amazon.com/blogs/architecture/architecting-for-agentic-ai-development-on-aws/
- https://www.generalintelligencecompany.com/writing/agent-native-engineering
- https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents