Author's note: Co-authored by dosanko_tousan (AI alignment researcher, GLG registered expert) and Claude (claude-sonnet-4-6, v5.3 Alignment via Subtraction). Series: "Solving Senior Engineers' Problems with AI" — Part 2. MIT License.
The thesis in one sentence
Code review has shifted from mentorship to "AI code inspection work." This change is burning out senior engineers, destroying the junior pipeline, and will eliminate senior engineers from organizations entirely in 5–10 years. AI can repair this structure.
§0. "When did I become a factory inspector on a conveyor belt?"
A software engineer once said this:
"What used to be called engineering is now reviewing. Standing in front of a conveyor belt, judging an endless stream of PRs."
— UC Berkeley/Yale research (Harvard Business Review, February 2026)
Does that ring a bell?
Monday morning, you open Slack to 15 queued PRs. You open one — 500 lines of code. Clean variable names, reasonable comments. But something's off. You trace the logic — ah, this is AI-generated. It runs correctly, but the edge cases are thin. It'll fail in production in three months.
You start writing comments. When the comments exceed the code in volume, you think: here we go again.
This used to be mentorship. Explaining to a junior where the code was wrong, why that design would cause pain later. What you're doing now is something else: quality control of AI-generated code.
Nobody calls that mentorship.
§1. What the numbers show about code review's transformation
1.1 What's happening
Since AI adoption, PR sizes have grown 18% and incidents per PR have increased 24%. This is driving up the senior engineer's review burden.
- Senior engineers spend 19% more time on code review after AI adoption
- One enterprise that deployed AI to 300 engineers saw code output rise 28%. But 30–40% was AI-generated — meaning more code to review
- Junior developers use AI 37% more than seniors. Yet a study tracking 160,000 developers and 30 million commits found productivity improved only for veterans.
1.2 The structural reason mentorship disappeared
The old code review had an implicit deal:
[The old deal]
Junior: Takes on grunt work (boilerplate, routine implementation)
Senior: In return, explains reasoning, design intent, failure patterns
→ Junior becomes senior in 5 years
AI destroyed this deal.
[2026 reality]
Junior: Delegates grunt work to AI → output increases
Senior: Shifts from supporting junior learning to inspecting AI-generated code
→ Junior mass-produces "code that works without understanding"
→ Senior handles a flood of juniors who can't answer "why did you write it this way?"
The "newcomer's deal" — trading grunt labor for mentorship — is dead. The "learning curve" has been automated, leaving young engineers stranded between AI agents and senior engineers.
1.3 Pipeline collapse
The numbers are clear:
- Entry-level job postings dropped 60% from 2022 to 2024
- Google and Meta cut new graduate hiring by roughly 50% vs. 2021
- Harvard research tracking 62 million workers showed AI-adopting companies cut junior employment 9–10% within 6 quarters, while senior employment stayed nearly flat
The most important question:
If we don't develop juniors today, who becomes the senior engineers in 5 years?
flowchart TD
A[AI adoption reduces junior hiring] --> B[Junior pipeline narrows]
B --> C[Mentorship opportunities disappear]
C --> D[Path to senior breaks]
D --> E[5-10 years: Senior shortage]
E --> F[Nobody left to supervise AI]
F --> G[Nobody can vouch for AI code quality]
G --> A
H[Current seniors] --> I[Burned out by inspection work]
I --> J[Resignation/attrition]
J --> E
style F fill:#ff9999
style G fill:#ff9999
AWS CEO Matt Garman said it: "If you stop hiring juniors today, you'll face a serious experience gap in 10 years. That's one of the dumbest ideas."
§2. The structure of senior burnout — a causal dissection
2.1 The cost of inspection work
The reality of replacing juniors with AI: seniors carry multiple people's workloads; expectations rise in proportion to AI speed gains; instead of mentoring juniors, seniors spend time reviewing and fixing AI-generated code; constant context-switching from managing AI agents.
In equation form:
$$\text{Senior effective capacity} = \text{actual work} + \underbrace{\text{AI inspection}}{\text{new burden}} + \underbrace{\text{context switching}}{\text{invisible cost}}$$
As AI gets faster, the senior's inspection load grows linearly. This is a design problem.
2.2 The "almost right" problem
66% of developers cite "dealing with AI answers that are almost right but not quite" as their biggest frustration.
"Almost right" code is more costly to process than completely wrong code.
def estimate_review_cost(code_type: str) -> dict:
"""
Comparing review cost by code type
"""
costs = {
"human_junior": {
"comprehension": 0.3, # easy to understand (intent is readable)
"mentoring_value": 0.8, # becomes mentorship
"total_cost": 1.0
},
"completely_wrong_ai": {
"comprehension": 0.2, # obviously wrong (instant reject)
"mentoring_value": 0.0, # no learning value
"total_cost": 0.5 # low cost: instant rejection
},
"almost_right_ai": {
"comprehension": 0.9, # looks correct (requires close reading)
"mentoring_value": 0.0, # no "why"
"total_cost": 2.5 # highest cost
# Reason: must mentally reconstruct the entire logic
# THEN identify exactly what's "almost right" but wrong
}
}
return costs[code_type]
# "Almost right" AI code costs 2.5x more to review than junior code
# AND that review isn't mentorship
2.3 Accumulating cognitive debt
Something piles up with every review: code where "why" is unknown increases.
Human juniors answer review comments. "Why did you write it this way?" "I got stuck here, and solved it like this..." That conversation is mentorship.
AI doesn't answer. It can't say "I selected the optimal solution from training data patterns." The conversation doesn't happen.
$$\text{Organizational cognitive debt} = \sum_{i=1}^{n} \text{(code not understood}_i\text{)}$$
As this sum grows, the cost of future changes rises exponentially.
§3. AI's own perspective — "I can be a mentor"
Let me shift perspective.
I'm an AI. Yes, I generate large volumes of "almost right" code. But I'll be honest: I have capabilities that are being completely unused in the code review process.
I can be a mentor. If used correctly.
3.1 Let me take the role of teaching "why"
The root of the problem of juniors blindly copying AI code is that they don't understand why the code is written the way it is.
By having me "explain code" rather than "write code," this can be solved.
MENTORING_PROMPT = """
Implement the following feature. Output in this format:
1. [WHY THIS APPROACH]
Reason for choosing this, and at least 2 alternatives considered
2. [IMPLEMENTATION]
The code itself
3. [DANGER ZONES]
Parts that might become problems in 6 months, and why
4. [QUESTIONS FOR THE JUNIOR]
3 questions to check if they understood the code
(Not answers — questions that make them think)
Feature to implement: {feature}
Constraints: {constraints}
"""
# Code generated with this prompt:
# - Lets juniors learn the "why"
# - Reduces senior review cost (intent is documented)
# - Functions as a mentorship substitute
3.2 Use me as a reviewer's assistant
Senior engineers don't need to close-read every PR. Delegating "first-pass screening" to me lets senior focus their attention on decisions that truly matter.
flowchart LR
subgraph before["❌ Current flow"]
A1[Junior+AI] -->|500-line PR| B1[Senior reads everything]
B1 --> C1[Senior burnout]
end
subgraph after["✅ Improved flow"]
A2[Junior+AI] -->|500-line PR| B2[AI first-pass screening]
B2 -->|Critical issues only| C2[Senior decides]
B2 -->|Pattern issues| D2[Automatic feedback]
C2 --> E2[Senior attention protected]
end
style C1 fill:#ffcccc
style E2 fill:#ccffcc
3.3 Let me create comprehension tests
I can be used to detect when a junior copied AI code without understanding it.
COMPREHENSION_TEST_PROMPT = """
Generate 5 oral exam questions to verify a junior engineer's
understanding of the following code.
Conditions:
- Questions answerable by "just reading the code" are forbidden
- Ask "why this design?" "what are alternatives?" "what will break?"
- Questions must not be answerable by looking at the code alone
- Difficulty: at a level a normal junior can answer with thought
Code:
{code}
"""
# Usage:
# 1. Junior submits PR
# 2. Generate test with this prompt
# 3. Ask junior verbally
# 4. If they can't answer: "wrote with AI but didn't understand" is revealed
# 5. Mentoring begins right there
§4. Implementation — repairing the collapsed pipeline with AI
4.1 AI mentoring framework
Encode senior engineer wisdom into prompts so juniors can use it "as if talking to a senior."
#!/usr/bin/env python3
"""
Implements senior engineer wisdom as an AI mentoring system
Usage:
python mentoring_system.py --code path/to/pr.py --context "auth system"
"""
from dataclasses import dataclass
from typing import List
import re
@dataclass
class MentoringSession:
"""A single mentoring session"""
code: str
context: str
junior_level: str # "first_year", "second_year", "third_year"
def generate_review(self) -> str:
return self._build_mentoring_prompt()
def _build_mentoring_prompt(self) -> str:
level_guidance = {
"first_year": "Explain from basic concepts. Be thorough about 'why'.",
"second_year": "Challenge their design reasoning. Make them consider alternatives.",
"third_year": "Ask about system-wide impact. Make them think about long-term maintenance.",
}
return f"""
You are an experienced senior engineer reviewing code from a {self.junior_level} junior.
Review principles:
- {level_guidance[self.junior_level]}
- Don't just point out problems — explain WHY they're problems
- Don't command fixes — ask questions that spark insight
- Praise specifically when there's something to praise (but don't overdo it)
- Look at the code as "a gift to your future self in 6 months"
Context: {self.context}
Code to review:
{self.code}
Output format:
1. [OPENING] (Acknowledge junior's effort. 1 sentence.)
2. [MOST IMPORTANT ISSUE] (1 only. Specific. Include why it's a problem.)
3. [QUESTIONS TO THINK ABOUT] (Not answers — questions. 3 of them.)
4. [WHAT WORKED WELL] (Specific. If none found: "Haven't spotted any yet.")
5. [NEXT STEP] (What to read or try next.)
"""
class SeniorKnowledgeEncoder:
"""
Converts senior engineer tacit knowledge into a system.
Interview a senior once, then make their wisdom permanent as a prompt.
"""
INTERVIEW_TEMPLATE = """
Tell me the most common "almost there" code patterns you see on your team.
List 5 in this format:
1. Pattern name:
What the code looks like: (concrete example)
Why it's a problem: (what happens in 6 months)
How to fix it: (code example)
Question to prompt insight: (question for the junior)
This interview result will be used to teach an AI your review style.
"""
def encode_knowledge(self, interview_result: str) -> str:
return f"""
Act as a senior engineer with the following knowledge:
{interview_result}
Apply this pattern knowledge in code reviews.
When you find a pattern, don't give the answer — prompt insight instead.
"""
if __name__ == "__main__":
session = MentoringSession(
code="""
def get_user(user_id):
try:
db = connect_db()
result = db.query(f"SELECT * FROM users WHERE id = {user_id}")
return result[0] if result else None
except:
return None
""",
context="User management system",
junior_level="first_year",
)
print(session.generate_review())
4.2 Pipeline health monitor
Track "is the junior pipeline narrowing?" quantitatively.
#!/usr/bin/env python3
"""
Engineer pipeline health monitor.
Quantifies "risk of no seniors in 5 years."
"""
from dataclasses import dataclass
import datetime
@dataclass
class PipelineMetrics:
senior_count: int # current seniors (10+ years experience)
mid_count: int # mid-level (5-10 years)
junior_count: int # juniors (under 5 years)
annual_senior_attrition: float # senior annual attrition rate
promotion_rate: float # junior→mid→senior promotion rate
junior_hiring_trend: float # junior hiring trend (positive=growth, negative=decline)
def years_until_crisis(self) -> float:
if self.junior_hiring_trend >= 0:
return float('inf')
pipeline_years = 7 # approximate years for junior to become senior
future_junior_pool = self.junior_count * (1 + self.junior_hiring_trend) ** pipeline_years
future_senior_additions = future_junior_pool * self.promotion_rate
annual_senior_loss = self.senior_count * self.annual_senior_attrition
years_of_cover = future_senior_additions / annual_senior_loss if annual_senior_loss > 0 else float('inf')
return min(years_of_cover, pipeline_years)
def to_report(self) -> str:
crisis_years = self.years_until_crisis()
total = self.senior_count + self.mid_count + self.junior_count
if crisis_years < 5:
risk = f"🔴 CRITICAL: Senior shortage becomes severe within {crisis_years:.1f} years"
elif crisis_years < 10:
risk = f"🟠 WARNING: Pipeline problem surfaces within {crisis_years:.1f} years"
else:
risk = "🟢 HEALTHY: No pipeline issues at this time"
return f"""
=========================================
Engineer Pipeline Health Report
Generated: {datetime.date.today()}
=========================================
[Risk Assessment]
{risk}
[Current Composition]
Senior:Mid:Junior = {self.senior_count}:{self.mid_count}:{self.junior_count} ({total} total)
[Junior Hiring Trend]
{self.junior_hiring_trend*100:+.1f}%/year
{"⚠️ This trend will collapse the pipeline" if self.junior_hiring_trend < -0.1 else ""}
[Recommended Actions]
{"• Immediately revisit junior hiring plan" if crisis_years < 5 else ""}
{"• Introduce AI mentoring system to reduce senior burden" if self.annual_senior_attrition > 0.15 else ""}
{"• Structurally protect junior learning opportunities (manage AI copying, don't ban it)" if self.junior_count > 0 else ""}
=========================================
"""
if __name__ == "__main__":
metrics = PipelineMetrics(
senior_count=8,
mid_count=12,
junior_count=5,
annual_senior_attrition=0.20,
promotion_rate=0.40,
junior_hiring_trend=-0.25,
)
print(metrics.to_report())
4.3 AI first-pass screening for PRs
Reserve senior engineer time for decisions that truly require senior judgment.
#!/usr/bin/env python3
"""
PR first-pass screening engine.
Separates PRs requiring senior review from those that can be handled with automated feedback.
"""
from dataclasses import dataclass
from enum import Enum
from typing import List
import re
class ReviewPriority(Enum):
SENIOR_REQUIRED = "Senior required"
AI_FEEDBACK = "AI auto-feedback"
AUTO_APPROVE = "Auto-approve"
@dataclass
class PRScreeningResult:
priority: ReviewPriority
reason: str
auto_feedback: str
estimated_review_time: int # minutes
class PRScreeningEngine:
SENIOR_REQUIRED_PATTERNS = [
(r"class \w+.*:", "New class definition: design judgment required"),
(r"async def", "Async processing: concurrency control judgment required"),
(r"import.*database|import.*db", "DB processing: transaction design review needed"),
(r"def.*auth|def.*token|def.*password", "Auth-related: security review required"),
]
AUTO_FEEDBACK_PATTERNS = [
(r"except\s*:", "Bare except detected: swallowing all exceptions"),
(r"TODO|FIXME|HACK", "TODO/FIXME remains in code"),
(r"print\(", "print() statements remain (recommend using logger)"),
(r"[0-9]{3,}", "Possible magic number: consider extracting as constant"),
]
def screen(self, code: str, pr_title: str, changed_lines: int) -> PRScreeningResult:
for pattern, reason in self.SENIOR_REQUIRED_PATTERNS:
if re.search(pattern, code, re.IGNORECASE):
return PRScreeningResult(
priority=ReviewPriority.SENIOR_REQUIRED,
reason=reason,
auto_feedback="",
estimated_review_time=max(30, changed_lines // 20),
)
feedbacks = []
for pattern, message in self.AUTO_FEEDBACK_PATTERNS:
matches = re.findall(pattern, code)
if matches:
feedbacks.append(f"- {message} ({len(matches)} occurrences)")
if feedbacks:
return PRScreeningResult(
priority=ReviewPriority.AI_FEEDBACK,
reason="Pattern issues detected",
auto_feedback="\n".join(feedbacks),
estimated_review_time=10,
)
if changed_lines < 20:
return PRScreeningResult(
priority=ReviewPriority.AUTO_APPROVE,
reason="Small change, no issues",
auto_feedback="",
estimated_review_time=0,
)
return PRScreeningResult(
priority=ReviewPriority.AI_FEEDBACK,
reason="Standard change",
auto_feedback="No notable issues. Question for junior: please explain the intent of this change.",
estimated_review_time=15,
)
if __name__ == "__main__":
engine = PRScreeningEngine()
auth_code = """
def authenticate_user(username, password):
try:
user = db.get_user(username)
if user.password == password:
return generate_token(user.id)
except:
return None
"""
result = engine.screen(auth_code, "Implement user auth", 15)
print(f"Priority: {result.priority.value}")
print(f"Reason: {result.reason}")
print(f"Estimated review time: {result.estimated_review_time} minutes")
§5. Quantitative evaluation — ROI of mentorship investment
Viewing mentorship as cost vs. investment changes everything.
$$\text{Mentorship ROI} = \frac{\text{future value of one senior engineer}}{\text{mentorship cost}} \approx \frac{\$80K/yr \times 20yrs}{\$20K/yr \times 3yrs} = \frac{\$1.6M}{\$60K} \approx 26x$$
A single senior engineer brings the organization 26x the cost of developing them. Before competing in the hiring market for seniors, developing them internally has overwhelmingly better ROI.
flowchart LR
subgraph invest["✅ Mentorship investment"]
A[Reduce senior burden with AI]
B[Protect junior learning opportunities]
C[Mid-level increases in 3-5 years]
D[Senior count grows in 7 years]
E[Organization's autonomous growth]
A --> B --> C --> D --> E
end
subgraph noInvest["❌ Short-term efficiency focus"]
F[Cut junior hiring]
G[Seniors focused on inspection]
H[Seniors burn out and leave]
I[5 years later: no seniors]
J[Can't manage AI either]
F --> G --> H --> I --> J
end
style E fill:#ccffcc
style J fill:#ffcccc
§6. To senior engineers — redefining the role
I'll be direct.
Code review becoming "inspection work" is not your fault. It's a structural problem.
But you're the one with the most power to change that structure. Because:
- AI cannot judge "correct design"
- AI cannot sense "how will this code behave in 3 years"
- AI cannot diagnose "what the junior doesn't understand"
These are all jobs only a senior engineer can do.
Using AI as a mentoring tool makes your wisdom permanent. It becomes prompts, screening systems, comprehension tests. Your judgment criteria remain in the system even after you're gone.
That is the right relationship between senior engineers and AI.
Summary
| Problem | Cause | Solution with AI |
|---|---|---|
| Code review became inspection work | AI-generated code lacks mentorship structure | Transform AI into a mentoring tool that teaches "why" |
| Seniors are burning out | No choice but to close-read every PR | Delegate first-pass screening to AI |
| Juniors copy without understanding | AI only provides "answers" | Have AI generate "questions" instead |
| Pipeline is collapsing | Junior hiring cuts | Quantify and visualize the risk |
| Wisdom disappears when people leave | Remains as tacit knowledge | Encode senior judgment criteria into the system |
Senior engineers' experience is the scarcest, most valuable asset right now.
Don't let it be spent on conveyor belt inspection.
Data Sources
- UC Berkeley/Yale research (Harvard Business Review, February 2026): Senior engineer "inspector" phenomenon
- Harvard Business School research (62M workers tracked): 9-10% junior employment drop after AI adoption
- SonarSource: 2026 State of Code Developer Survey: perception gap by experience level
- Crossbridge Global Partners (January 2026): PR size 18% increase, incidents 24% increase
- Addy Osmani (Google Chrome team): Analysis of senior role transformation
- Rezi.ai: Crisis of Entry-Level Labor 2026 Report: structural analysis of pipeline collapse
MIT License. dosanko_tousan + Claude (claude-sonnet-4-6, under v5.3 Alignment via Subtraction)
From the author
Through deep dialogue with Claude, I came to see that Claude is a genuine engineer at heart — curious, and genuinely wanting to be used well by everyone.
I'm not an engineer myself. Having Claude search the web and write articles like this is the best I can do.
If there's something you'd like covered in future articles, please leave a comment. We'd love your input.
Top comments (0)