How to squeeze every drop of leverage from AI agents — for developers who want to ship 10x, not just "use AI"
| Old Way | AI-Native Way (2026) |
|---|---|
| "Let me write this function" | "Let me describe the outcome, verify the result" |
| "I'll debug this error" | "Here's the error + context, fix it and add a regression test" |
| "I need to learn this API" | "Agent, read the docs and give me a working integration" |
| "I'll refactor this later" | "Agent, refactor this *now* — here's the pattern I want" |
| Human as writer | Human as architect + reviewer + verifier |
Golden Rule: If you're typing more than 20 lines of boilerplate without an agent, you're doing it wrong.
| Category | Best Cloud | Best Local | When to Use |
|---|---|---|---|
| General coding | Claude Code / Codex / Aider | ollama run gpt-oss:120b + Aider / Continue | Daily driver |
| Code review | Codex read-only / DeepSource / SonarQube AI | Local LLM + static analysis | Every PR |
| Architecture | o3 / GPT-5 / Opus 4 | Local 120B+ model (Nemotron 4 Ultra) | System design |
| Test generation | Codex / Cursor / Cline | Local + pytest-mock / Vitest | Before merge |
| Refactoring | Aider / Cursor / Windsurf | Local + AST tools (ts-morph, libcst) | Tech debt sprints |
# Cloud (when TLS works)
npm i -g @openai/codex@latest @anthropic-ai/claude-code@latest
codex login && claude-code auth login
# Local (VPS, air-gapped, TLS-intercepted)
curl -fsSL https://ollama.com/install.sh | sh
ollama serve &
ollama pull gpt-oss:120b nemotron-4-ultra:latest qwen2.5-coder:32b deepseek-coder-v3:latest
# Wrapper for both
curl -o ~/.local/bin/hcodex https://raw.githubusercontent.com/.../hcodex
chmod +x ~/.local/bin/hcodex
# Git worktrees — parallel agent work
git worktree add -b fix/auth /tmp/auth-fix main
git worktree add -b feat/payments /tmp/payments main
# Context compression (saves 60-90% tokens)
pip install headroom
headroom compress < huge_context.txt
# Session persistence
# tmux / zellij for background agents
# ~/.hermes/skills for reusable patterns
# MCP servers for tool access
# - filesystem, github, postgres, k8s, browser
# Configure in ~/.hermes/mcp-servers.json
# YOU: Write the spec + tests first
"""
SPEC: Payment webhook handler
- POST /webhook/stripe
- Verify Stripe signature (header: Stripe-Signature)
- Idempotency via Stripe event ID (redis SETNX 24h TTL)
- On payment_intent.succeeded: credit user account, emit event
- Return 200 within 500ms
"""
# AGENT: Write tests FIRST (pytest + pytest-mock)
# AGENT: Implement to make tests pass
# YOU: Run tests, verify coverage, ship
Why: Tests are the specification. Implementation without tests = unmaintainable AI code.
# BAD: "Fix the bug in user_service"
# GOOD: Context pack
cat > /tmp/context.md << 'EOF'
## Task
Fix race condition in OrderService.create_order()
## Files
- services/order_service.py:45-89 (the method)
- models/order.py (Order, OrderItem models)
- tests/test_order_service.py (existing tests)
## Error
concurrent.futures._base.CancelledError: duplicate inventory deduction
## Constraints
- Use SELECT FOR UPDATE (PostgreSQL)
- Keep existing API unchanged
- Add test for concurrent orders
- No new dependencies
## Acceptance
- `pytest tests/test_order_service.py::test_concurrent_orders` passes
- No performance regression >10ms
EOF
# Then
hcodex -C /project @/tmp/context.md "Fix the race condition per spec"
# One terminal per worktree
# Terminal 1
cd /tmp/auth-fix && hcodex "Implement OAuth2 PKCE flow per spec"
# Terminal 2
cd /tmp/payments && hcodex "Add Stripe webhook handler per spec"
# Terminal 3
cd /tmp/refactor-db && hcodex "Extract repository pattern from user_service"
# Monitor
watch -n 5 'git -C /tmp/auth-fix status && git -C /tmp/payments status'
# Pre-merge review (read-only, fast)
hcodex --sandbox read-only -C /project \
"Review PR #142: Check for SQL injection, XSS, auth bypass, secrets in code, \
error handling, logging, performance. Output as markdown with severity labels."
# Security-focused
hcodex --sandbox read-only -C /project \
"Security audit of last 5 commits: authentication, authorization, input validation, \
secrets management, dependency vulnerabilities. Output SARIF if possible."
# 1. Snapshot
git stash push -m "pre-refactor-$(date +%s)"
# 2. Agent refactors with tests
hcodex -C /project \
"Extract UserRepository from user_service.py.
- Keep all public methods identical
- Add dependency injection (FastAPI Depends)
- All existing tests must pass
- Add tests for new repository class"
# 3. Verify
pytest tests/ -x -v
git diff --stat
# 4. Commit or rollback
git stash pop # if broken
headroom compress first).env + --add-dir)# Compress 500KB of docs → 15KB
headroom compress < docs/architecture.md > /tmp/arch_compressed.md
# Agent reads compressed
hcodex -C /project "@/tmp/arch_compressed.md" "Design the new cache layer"
| Task | Cloud Model (Exact Name) | Local Model (Ollama Tag) |
|---|---|---|
| Complex reasoning, architecture | o3, gpt-5-2026-07, claude-opus-4-202607 | nemotron-4-ultra:latest, llama3.3:120b-instruct-q4_K_M |
| Coding, refactoring, tests | gpt-5-2026-07, claude-sonnet-4-202607 | gpt-oss:120b-q4_K_M, qwen2.5-coder:32b-instruct-q4_K_M, deepseek-coder-v3:latest |
| Quick edits, boilerplate | gpt-5-mini-2026-07, claude-3-5-haiku-202607 | deepseek-coder-v2:16b-instruct-q4_K_M, qwen2.5-coder:14b-instruct-q4_K_M |
| Code review, security audit | o3, claude-opus-4-202607 | nemotron-4-ultra:latest, gpt-oss:120b-q4_K_M |
| Chinese + coding | gpt-5-2026-07 | qwen2.5-coder:32b-instruct-q4_K_M, deepseek-coder-v3:latest |
| VRAM/RAM | Models that fit (Ollama tag) |
|---|---|
| 8 GB | deepseek-coder:6b-instruct-q4_K_M, qwen2.5-coder:7b-instruct-q4_K_M |
| 16 GB | gpt-oss:20b-q4_K_M, qwen2.5-coder:14b-instruct-q4_K_M, deepseek-coder-v2:16b-instruct-q4_K_M |
| 24 GB | qwen2.5-coder:32b-instruct-q4_K_M, nemotron-3-ultra:20b-q4_K_M |
| 48 GB | llama3.3:70b-instruct-q4_K_M, gpt-oss:120b-q4_K_M |
| 96 GB | nemotron-4-ultra:latest, llama3.3:120b-instruct-q4_K_M |
After every agent task:
# 1. Tests pass
pytest tests/ -x -q
# 2. Types check
mypy --strict services/ models/
# 3. Lint clean
ruff check . --fix
# 4. Diff is minimal & intentional
git diff --stat
git diff | head -100 # actually read it
# 5. No secrets leaked
git diff | grep -iE "(api_key|secret|password|token)" || echo "Clean"
# 6. Performance spot-check
hyperfine --warmup 3 'python -m pytest tests/test_perf.py::test_latency'
# 7. Security scan
semgrep --config=auto . || bandit -r .
If any fails → send back to agent with exact error.
| Anti-Pattern | Why It Fails | Fix |
|---|---|---|
| "Write me a REST API" | No spec → hallucinated endpoints | Write OpenAPI spec first |
| "Fix the bug" (no context) | Agent guesses wrong file | Give file:line + error + test |
| No tests written | Can't verify correctness | Tests FIRST, then implement |
| Single huge prompt | Context overflow, drift | Break into context packs |
| Accept first output | Hallucinations slip through | Verify with tests + diff review |
| Cloud-only workflow | Fails on VPS/TLS intercept | Always have local fallback |
| Day | Focus | Agent Work |
|---|---|---|
| Mon | Planning + specs | Write specs + tests for week's features |
| Tue | Implementation | Parallel agents on worktrees |
| Wed | Implementation | Continue + mid-week review |
| Thu | Refactor + debt | Agents extract patterns, add types |
| Fri | Review + ship | AI code review all PRs, merge, deploy |
Weekend: Learn one new agent pattern, update your context packs.
Build reusable prompts as files:
~/agent-prompts/
├── feature.md # "Implement X per spec..."
├── refactor.md # "Extract repository pattern..."
├── test-gen.md # "Add pytest tests covering..."
├── review.md # "Security review for..."
├── bugfix.md # "Fix race condition in..."
├── docs.md # "Generate OpenAPI spec for..."
├── migrate.md # "Upgrade from Flask to FastAPI..."
└── arch-review.md # "Review architecture for..."
Then: hcodex -C /project @~/agent-prompts/feature.md "JWT auth in FastAPI"
# 1. Install the stack (5 min)
npm i -g @openai/codex@latest
curl -fsSL https://ollama.com/install.sh | sh
ollama serve & ollama pull gpt-oss:120b-q4_K_M nemotron-4-ultra:latest
# 2. Create your first context pack (10 min)
cat > ~/agent-prompts/test-gen.md << 'EOF'
Add pytest tests for {{module}}. Cover: happy path, edge cases, errors, mocks.
Follow existing patterns in tests/. Use pytest-mock.
EOF
# 3. Run your first delegated task (5 min)
cd your-project
hcodex -C . @~/agent-prompts/test-gen.md "services/payment.py"
# 4. Verify
pytest tests/ -x -v
git diff
# 5. Add to weekly routine
The developers who master this aren't "using AI" — they're building systems where AI is a first-class team member. The gap compounds weekly.
Version 2.0 — July 2026. Fork, adapt, share. The best workflows are stolen and improved.
AI-Native Developer 2026