Claude Code 2.0 and VS Code Extension: Checkpoints, Named Sessions, .claude/rules
On September 29, 2025 Anthropic released Claude Code 2.0, one version which represents a generational leap in user experience for the developer. It's not about it simply an incremental update: for the first time, we have tools that recognize the reality of long sessions, complex tasks, and the need to maintain control while working with AI agents. Checkpoints, Named Sessions, VS Code Extension beta, mid-session template management - these are not nice-to-have features, they are operational game changers.
In this twenty-third article of the Claude series, we will explore in depth how
Claude Code 2.0 transforms your daily workflow: the checkpoint system
for rollback during massive refactorings, the VS Code Extension which brings Claude inline into your
favorite editor, named sessions that allow continuity of work between days, files
.claude/rules/ which centralize project guidelines and model switching
mid-session which gives you control over token costs.
What You Will Learn
- Understand the checkpoint system and when to use it for saving and rollback
- Install and configure the VS Code Extension beta
- Navigate the sidebar and inline diff interface
- Rename and resume named sessions for business continuity
- Configure the directory
.claude/rules/for granular control - Use background agents for long tasks without freezing the terminal
- Switch between AI models mid-session to optimize cost and latency
- Access prompt suggestions with Tab to speed up your workflow
- Monitor the context window in the status line
Complete Series Overview (You are here: Article 23)
| # | Item | Focus | Date |
|---|---|---|---|
| 1 | Claude as Technical Partner | Setup and first steps | Oct 2024 |
| 2 | Project Context and Setup | CLAUDE.md and configuration | Oct 2024 |
| 3 | Concept and Requirements | MVP and user personas | Oct 2024 |
| 4 | Backend and Frontend Architecture | Spring Boot and Angular | Nov 2024 |
| 5 | Structure of the Code | Organization and conventions | Nov 2024 |
| 6 | Advanced Engineering Prompt | Advanced techniques | Nov 2024 |
| 7 | Testing and quality | Strategies and test generation | Dec 2024 |
| 8 | Professional Documentation | README, API, ADR | Dec 2024 |
| 9 | Deploy and DevOps | Docker, CI/CD, monitoring | Jan 2025 |
| 10 | Evolution and Maintenance | Refactoring and scalability | Jan 2025 |
| 11 | Real Project Integration | Claude Code in production | Feb 2025 |
| 12 | Claude Code CLI | Commands and configuration | Feb 2025 |
| 13 | Agent Skills | Modular capabilities | Mar 2025 |
| 14 | Specialized Subagents | Agents with specific roles | Mar 2025 |
| 15 | Hooks and Automation | Event-driven workflows | Apr 2025 |
| 16 | Ralph Wiggum Method | Test-driven development | Apr 2025 |
| 17 | BMAD Method | Structured project management | May 2025 |
| 18 | Multi-Agent Orchestration | Agent pipeline | May 2025 |
| 19 | Collaborative Work | Team and pair programming AI | Jun 2025 |
| 20 | Security and Best Practices | Hardening and compliance | Jul 2025 |
| 21 | Monitoring and Observability | Metrics and debugging | Aug 2025 |
| 22 | Prompt Caching and Optimization | Tokens and latency | Sep 2025 |
| 23 | Claude Code 2.0 and VS Code Extension (you are here) | Checkpoints, sessions, .claude/rules | Oct 2025 |
1. Claude Code 2.0: A Generational Leap
The release of Claude Code 2.0 on September 29, 2025 marks a major inflection point in the history of AI-assisted development tools. For years, the AI agent (both Claude, Copilot that others) was perceived as one instrument without operating memory: start a session, you work for hours, and if something goes wrong, you're in trouble. With Claude Code 2.0, the mental model changes radically.
The 6 Main Innovations of Claude Code 2.0
| Features | Release Date | Impact |
|---|---|---|
| Checkpoint System | 29 Sep 2025 | Salva e rollback durante sessioni lunghe |
| VS Code Extension | 29 Set 2025 (beta) | Claude direttamente nel tuo editor |
| Named Sessions | 3 Dic 2025 (v2.0.60) | Persisti e riprendi sessioni con nomi |
| .claude/rules/ Directory | 3 Dic 2025 (v2.0.60) | Linee guida granulari, non solo CLAUDE.md |
| Background Agents | 3 Dic 2025 (v2.0.60) | Task lunghe senza bloccare il terminale |
| Model Switching & Context Window | 5 Dic 2025 (v2.0.62) | Cambio modello mid-session, visibilità token |
La chiave di questa evoluzione è riconoscere che il valore reale non è nella singola iterazione dell'agente, ma nella capacità di orchestrare sessioni lunghe dove puoi dirgli "torna indietro di 5 passi", oppure "usa un modello più economico per il prossimo task", oppure "ricordati di questa regola di style per il prossimo progetto".
2. Checkpoint System: Salvare e Rollback Durante Sessioni Lunghe
Il sistema di checkpoint è la soluzione al problema più frustrante del workflow AI-assisted: sei a 3 ore dentro un refactoring massiccio, Claude ha fatto 50 file, e all'improvviso ti accorgi che il suo approccio non funziona. Non puoi semplicemente tornare indietro. Con i checkpoint, il rollback è una operazione di 2 secondi.
Come Funzionano i Checkpoint
Un checkpoint è una snapshot del filesystem + contesto di conversazione salvato a un punto specifico della sessione. Durante una sessione lunga, Claude Code salva automaticamente checkpoint ogni N iterazioni (default: ogni 10 tool use cycle). Puoi anche manualmente creare checkpoint nel mezzo di un task.
# Nel terminale Claude Code, durante una sessione:
# 1. Salvare un checkpoint manualmente
/checkpoint save "after-initial-refactoring"
# 2. Elencare tutti i checkpoint disponibili
/checkpoint list
# Output atteso:
# Checkpoint disponibili:
# 1. after-initial-refactoring [2025-10-29 14:32:15]
# 2. auto-checkpoint-iter-10 [2025-10-29 14:25:43]
# 3. auto-checkpoint-iter-20 [2025-10-29 14:18:22]
# 4. start-of-session [2025-10-29 14:00:01]
# 3. Rollback a uno specifico checkpoint
/checkpoint restore "after-initial-refactoring"
# Attesa: 5-15 secondi (dipende dalla size del checkpoint)
# Output:
# Checkpoint restored successfully.
# 42 files restored, 8 files removed, 120 lines changed in memory
# 4. Visualizzare differenze tra checkpoint
/checkpoint diff "after-initial-refactoring" "start-of-session"
# 5. Eliminare un checkpoint per risparmiare spazio
/checkpoint delete "auto-checkpoint-iter-10"
Caso d'Uso Reale: Refactor Monorepo 50 File
Scenario Tipico
Lavori su un monorepo Angular + Spring Boot. Decidi di migrare a uno schema di naming più consistente per tutti i servizi. Chiedi a Claude di refactorare 50 file. Claude lavora per 90 minuti, fa 47 file, poi scopri che ha erroneamente cambiato anche le import negli unit test in modo che non buildano più. Con i checkpoint, recuperi il lavoro in 10 secondi.
#!/bin/bash
# Scenario: refactor 50 file in monorepo
# 1. Avvia Claude Code in una sessione dedicata
claude --session "monorepo-refactor-naming-2025-10-29"
# 2. Dentro la sessione Claude:
> [Shift+Tab+Tab] Refactor 50 file del monorepo per rinominare tutti i service
> seguendo il pattern ServiceName.service.ts e aggiungi commenti JSDoc
# Claude inizia a lavorare...
# Dopo 20 file completati, salva manualmente un checkpoint:
> /checkpoint save "20-files-done-patterns-consistent"
# Continua per altri 30 file...
# Dopo 50 file, chiedi revisione:
> /checkpoint save "all-50-files-complete"
> Mostra un riepilogo di tutti i file cambiati
# A questo punto scopri che i test sono broken:
> /checkpoint list
> Vedi: "20-files-done-patterns-consistent"
> /checkpoint restore "20-files-done-patterns-consistent"
# Ora sei al punto di 20 file. Chiedi approccio diverso:
> Ripeti il refactoring dei prossimi 30 file, ma stavolta
> crea un script di refactoring automatico per i test,
> non modificare i test manualmente.
# Continua...
> /checkpoint save "30-more-files-with-test-automation"
> Concludi con i restanti 20 file
> /checkpoint save "all-50-with-automated-tests"
Checkpoint Automatici vs Manuali
Confronto
| Aspetto | Automatici | Manuali |
|---|---|---|
| Frequenza | Ogni 10 iterazioni (configurabile) | Su richiesta, quando lo decidi |
| Nome | auto-checkpoint-iter-N (generico) | Nome descrittivo personalizzato |
| Uso ideale | Safety net passivo, default | Milestone logici (feature completata, review ok) |
| Retention | Ultimo 20 (FIFO), gestione automatica | Manuale: conserva fino a eliminazione esplicita |
| Storage | ~50 MB per checkpoint (medio) | ~50 MB per checkpoint (medio) |
3. VS Code Extension Beta: Claude Inline nel Tuo Editor
La VS Code Extension porta Claude Code direttamente dentro VS Code, eliminando la necessità di alternare terminale/editor. L'extension è stata rilasciata in public beta on September 29, 2025 and offers a workflow-changing integration experience.
Installation and Setup
The extension is available in the official VS Code Marketplace under the name claude-code produced by Anthropic.
# Metodo 1: VS Code Marketplace UI
# 1. Apri VS Code
# 2. Vai a Extensions (Ctrl+Shift+X / Cmd+Shift+X)
# 3. Cerca "claude-code" o "Anthropic"
# 4. Clicca Install sul risultato ufficiale (logo Anthropic)
# 5. Al primo avvio, VS Code aprirà un flusso di login browser
# Metodo 2: Command Palette
# 1. Premi Ctrl+Shift+P (Cmd+Shift+P su macOS)
# 2. Digita: Extensions: Install Extensions
# 3. Cerca "claude-code"
# 4. Installa
# Metodo 3: CLI (se disponibile)
code --install-extension anthropic.claude-code
Extension UI: Sidebar + Inline Diff
Main Interface Components
| Component | Description | Action |
|---|---|---|
| Claude Sidebar | Left panel with Claude conversation + file context | Left click VS Code icon, or Ctrl+L |
| Inline Diff Viewer | View diff side-by-side before applying | Car on modification files proposed by Claude |
| Accept/Reject Buttons | Apply or reject each diff individually | Click button or keyboard shortcut |
| Context Files Panel | Lists files loaded in session context | Drag-drop file into the sidebar or /add |
| Model + Settings | Model dropdown, permissions, checkpoints | Gear icon at the top of the sidebar |
# 1. Apri VS Code con un progetto
code ~/projects/my-app
# 2. Clicca icon Claude nel sidebar sinistro (o Ctrl+L)
# → Appare il Claude Sidebar panel
# 3. Trascinare file nel sidebar per caricare nel contesto
# oppure digitare nel prompt Claude
# Esempio prompt nella sidebar:
> Aggiungi validazione email al form di registrazione
> Usa Angular reactive forms e i validatori built-in
> Aggiungi test per la validazione
# 4. Claude lavora sui file, visualizza diff nel editor
# Vedi un diff viewer che mostra:
# LEFT: old code
# RIGHT: new code (highlighted)
# 5. Per ogni diff, scegli:
# [✓ Accept] [✗ Reject] [↻ Request Change]
# 6. Una volta accettato, il file si modifica in tempo reale
# 7. Puoi continuare a chattare senza uscire dall'editor
Keyboard Shortcuts VS Code Extension
Quick Commands
| Shortcuts | Action |
|---|---|
| Ctrl+L (Cmd+L macOS) | Toggle Claude Sidebar |
| Ctrl+Shift+K | Accept diff (when diff viewer is in focus) |
| Ctrl+Shift+J | Reject diff |
| Ctrl+Alt+C | Open new session Claude |
| Ctrl+Alt+V | Resume previous session |
| Cmd+K Cmd+D (macOS) | Open Claude Diff View |
| Alt+Enter | Send message in Claude input (sidebar) |
4. Named Sessions: Continuity of Work between Days
One of Claude Code's historical frustrations was that every session was episodic. You started on Monday, worked for 2 hours, saved the file. Tuesday, you started Claude again, but the conversation was lost, context was gone. With Named Sessions (introduced December 3, 2025), you can nominate a session and resume it exactly as you left it.
Save a Session
# 1. Durante una sessione, rinominala:
> /rename "spring-boot-cache-layer-refactor"
# Ora la sessione ha un nome permanente
# 2. Al termine della sessione (dopo 2 ore di lavoro):
> Salvo i progressi. A domani!
# Premi Ctrl+D per uscire
# 3. Il giorno dopo, puoi riprendere esattamente dove eri:
claude --resume "spring-boot-cache-layer-refactor"
# Output:
# Resuming session: spring-boot-cache-layer-refactor
# Last activity: [2025-12-03 17:45:22]
# Context: 42 files loaded, 15 checkpoint disponibili
# Conversation history: 87 messages
# 4. Sei dentro la stessa sessione, stessa conversazione
> Ricordi dove eravamo rimasti? Ricapitoliamo ultimi 3 step
# Claude ha il contesto completo della conversazione
# 5. Elencare tutte le named session:
claude --list-sessions
# Output:
# Named Sessions:
# 1. spring-boot-cache-layer-refactor [2025-12-03]
# 2. angular-standalone-migration [2025-11-28]
# 3. database-optimization [2025-11-15]
# ...
# 6. Riprendere sessione diversa:
claude --resume "angular-standalone-migration"
# 7. Eliminare una sessione (se non ti serve più):
/session delete "angular-standalone-migration"
When to Use Named Sessions
Ideal Use Cases
- Long-running refactoring: Feature that lasts 2-3 working days
- Incremental migration: Eg. update 100 files to new pattern, batch by batch
- Learning and documentation: Write ebooks/tutorials chapter by chapter
- Complex Debugging: Problem requiring iterative investigation (days)
- Pair programming with Claude: Same project, same checkpoints, resumable
- Parallel projects: Team can resume sessions of colleagues (with permissions)
5. .claude/rules/ Directory: Granular Guidelines
Up to Claude Code 1.0, the CLAUDE.md it was the only source of truth for them instructions. But in larger projects, you had different needs for submodules: TypeScript rules different from Java, frontend conventions different from backend. With .claude/rules/ (introduced December 3, 2025), you can organize instructions into granular files by domain.
Directory Structure .claude/rules/
.claude/
├── rules/
│ ├── 00_root.md # Root rules applicate a tutto
│ ├── frontend/
│ │ ├── 01_typescript.md # TypeScript + Angular specific
│ │ ├── 02_components.md # Component structure
│ │ ├── 03_styling.md # CSS/design system rules
│ │ └── 04_testing.md # Frontend unit test conventions
│ ├── backend/
│ │ ├── 01_java.md # Java/Spring Boot specific
│ │ ├── 02_architecture.md # Clean arch layers
│ │ ├── 03_testing.md # Backend integration test
│ │ └── 04_database.md # SQL/schema migrations
│ ├── security/
│ │ ├── 01_secrets.md # Secret management
│ │ ├── 02_authentication.md # Auth patterns
│ │ └── 03_compliance.md # GDPR, OWASP
│ ├── devops/
│ │ ├── 01_docker.md # Dockerfile + compose
│ │ ├── 02_ci_cd.md # GitHub Actions, pipelines
│ │ └── 03_monitoring.md # Prometheus, alerts
│ └── shared/
│ ├── 01_git_workflow.md # Commit, PR, branching
│ ├── 02_documentation.md # Writing standards
│ └── 03_code_style.md # Immutability, naming
├── settings.json
└── settings.local.json
Example of TypeScript Rules
# TypeScript Rules per Frontend Angular
## Strict Mode
- Abilita sempre `strict: true` in tsconfig.json
- Non usare `any` - preferisci types espliciti o `unknown`
- Niente `Object` come tipo - usa `Record` o type specifico
## Naming Conventions
- **Files:** kebab-case.component.ts, kebab-case.service.ts
- **Classes:** PascalCase (UserComponent, AuthService)
- **Methods/Properties:** camelCase (getUserData, isLoggedIn)
- **Constants:** UPPER_SNAKE_CASE (MAX_RETRIES, API_URL)
- **Privates:** prefisso # oppure private keyword (preferito: #)
## Import Order
1. Angular framework (@angular/*)
2. RxJS (rxjs/*)
3. Third-party libraries
4. Blank line
5. Project modules (@services/*, @models/*)
## Reactive Forms Mandatory
```typescript
// WRONG:
form = new FormGroup({
email: new FormControl('')
});
// CORRECT:
form = new FormGroup({
email: new FormControl('', [Validators.required, Validators.email])
});
```
## Change Detection OnPush
```typescript
@Component({
selector: 'app-user-card',
template: '...',
changeDetection: ChangeDetectionStrategy.OnPush // Sempre questo!
})
```
## No Unsubscribe Pattern
Usa `takeUntil` o `takeUntilDestroyed` (Angular 16+):
```typescript
// AVOID:
subscription = this.service.data$.subscribe(d => this.data = d);
// CORRECT:
private destroy$ = new Subject<void>();
data$ = this.service.data$.pipe(
takeUntil(this.destroy$)
);
// E nel ngOnDestroy:
ngOnDestroy() { this.destroy$.next(); }
```
Example of Java/Spring Rules
# Java / Spring Boot Rules per Backend
## Clean Architecture Layers
Rispetta i 4 livelli:
1. **Domain:** Business rules, entity, port/interface
2. **Application:** Use case, DTO, exception
3. **Infrastructure:** Repository impl, service integration
4. **Presentation:** Controller, filter, advice
Nessuno strato deve dipendere da strati sopra di lui (dipendenze top-down).
## Immutability
- Preferisci record (Java 14+) per DTO e ValueObject
- Se usi class, fai constructor-only assignment, no setters
- Per entity, preferisci builder pattern
```java
// CORRECT:
public record UserCreateRequest(
String email,
String password
) {}
// AVOID:
public class UserCreateRequest {
private String email;
public void setEmail(String e) { ... }
}
```
## Error Handling
- Crea custom exception per ogni dominio (UserNotFoundException, etc.)
- Lancia sempre con messaggio user-facing + log server-side
- Global exception handler in @RestControllerAdvice
```java
throw new UserNotFoundException(
"Utente con ID " + userId + " non trovato"
);
// Log automatico nel handler + HTTP 404
```
## Database Transactions
- Usa @Transactional sui service, non su controller
- Read-only transaction per query non modificanti
- Fallback a JDBC/raw SQL solo se JPA insufficiente
## Testing
- Unit test service (mock repo)
- Integration test controller (Testcontainers PostgreSQL)
- Coverage target: 80%+
- Test nome: methodName_scenario_expectedResult()
How Claude Reads the Rules
When you launch Claude Code in a directory with .claude/rules/,
Claude automatically loads all applicable rules:
00_root.md- always read (global rules)- Rules for the current directory (e.g. if you are in
src/app/→ loadfrontend/*.md) - Parent rules when going up directories
- Priority: more specific wins (frontend/typescript > root)
Check Loading Rules
To verify that the rules were loaded correctly:
> /status
# Mostra: "Rules loaded: 7 files (.claude/rules/)"
# Mostra lista delle regole applicate
# Oppure:
>> /rules
# Lista tutte le regole attive nella sessione
6. Background Agents: Long Tasks Without Blocking
Introduced December 3, 2025, i background agents allow you to start a long task (e.g. generation of 100 tests, massive refactoring) without blocking your terminal. I continued working normally while Claude worked in the background.
# Metodo 1: Sintassi &@
> Genera test per tutti i service in src/services/ &@
# Output immediato:
# Background agent started: bg-agent-1729993847
# Use 'claude --attach bg-agent-1729993847' to monitor
# Continui a usare Claude normalmente
> Implementa il nuovo componente UserProfile
# Nel frattempo, l'agente in background genera i test
# Metodo 2: Avvia e monitora
> &@ Refactor 200 file del monorepo
# Ottieni ID agente
# Usa un'altra finestra di terminale:
claude --attach bg-agent-1729993847
# Vedi lo stato in tempo reale
# Metodo 3: Elencare tutti i background agent
claude --list-agents
# Output:
# Background Agents:
# 1. bg-agent-1729993847 [running] 32% - Refactor 200 files
# 2. bg-agent-1729992103 [completed] - Generate tests (132 file)
# 3. bg-agent-1729990001 [failed] - Migration script
# Metodo 4: Attendere il completamento di uno specifico agente
claude --wait bg-agent-1729993847
# Blocca il tuo terminale fino al completamento dell'agente
Use Case: Massive Test Generation
Scenario
You have 87 TypeScript services without testing. Start a background agent to generate tests for everyone. While Claude generates tests in the background (45 minutes), you continue to write features elsewhere in the project. Upon completion, all tests are generated and ready for review.
# Terminal 1: Avvia background agent
claude
> &@ Genera unit test con Jasmine per tutti i 87 service in src/app/services/
> Ogni test deve coprire: metodo principale, error handling, mock HTTP
> File output: {serviceName}.spec.ts nello stesso dir del service
# Output:
# Background Agent started: bg-test-gen-001
# Estimated time: 40-60 minutes
# You can now return to work in this or another terminal
# Terminal 1: Continua lavoro
> /clear
> @src/app/pages/user-profile.component.ts
> Implementa il form di editing profilo con validazione
# Terminal 2 (opzionale): Monitora l'agente in background
claude --attach bg-test-gen-001
# Vedi progresso in tempo reale
# Dopo 45 minuti, Terminal 2 mostra:
# Background Agent COMPLETED
# Generated 87 test files
# Total lines: 12,340
# Coverage: 83%
# Time elapsed: 47 minutes 23 seconds
# Torna a Terminal 1, continua il tuo lavoro
# I test sono già generati e salvati sul filesystem
7. Model Switching and Context Window Visibility
Introduced December 5, 2025, the mid-session model switching it allows you to switch AI models during a session without losing context. Combined with the visibility of the context window in the status line, you can optimize cost and latency dynamically.
Switch Mid-Session Model
# Metodo 1: Comando slash
> /model claude-sonnet-4-20250514
# Switching from claude-opus-4 to claude-sonnet-4
# Model changed successfully. Contesto preservato.
# Metodo 2: Shortcut Alt+P (Option+P su macOS)
# Apre un dropdown dei modelli disponibili, seleziona uno, applica
# Metodo 3: Visualizzare modello corrente
> /status
# Output:
# Session: spring-boot-cache-layer-refactor
# Current Model: claude-opus-4-20250514
# Context Window: 47,382 / 200,000 tokens (23.7%)
# Files Loaded: 12
# Checkpoint: 4 available
# Modelli disponibili (a seconda del piano):
# - claude-haiku-4-20250904 (fastest, cheapest, 200k context)
# - claude-sonnet-4-20250514 (balanced, 200k context)
# - claude-opus-4-20250514 (strongest, 200k context)
# - claude-opus-4-mini-20250903 (mid-tier, 200k context, new!)
Switching Strategy to Optimize Costs
Model Selection Strategy
| Tasks | Recommended model | Reason | Cost/Token |
|---|---|---|---|
| Code generation boilerplate (CRUD, form) | Haiku | Simple task, speed priority | Minimum |
| Refactoring routines, naming, formatting | Sonnet | Speed/quality balance, non-critical tasks | Medium |
| Architecture design, security review, complex logic | Opus | Highest reasoning, maximum criticality | Maximum |
| Test generation, documentation | Sonnet | Good compromise, less reasoning required | Medium |
Context Window in Status Line
La status line by Claude Code (bottom line of terminal) now shows the consumption of the context window in real time. This is crucial for long sessions.
# Status line in fondo al terminale Claude Code:
[2025-12-05 15:32:18] Model: claude-opus | Context: 67,234/200,000 (33.6%) | Files: 15 | Checkpoint: 3
# Cosa significa:
# - Modello corrente: claude-opus-4-20250514
# - Token usati: 67,234 su 200,000 disponibili
# - Percentuale: 33.6% - sei a metà strada
# - File nel contesto: 15
# - Checkpoint salvati: 3
# Se scende sotto il 10%, Claude ti avverte:
# ⚠️ WARNING: Context window usage > 90%
# Consider: /clear + /add file specifici, o /checkpoint restore
Use Case: Long Refactor with Switching
# Avvio sessione per refactor complesso (3 giorni di lavoro)
claude --session "monorepo-major-refactor"
# Primi step: pianificazione e design (reasoning critico)
> /model claude-opus-4-20250514
> [Plan Mode] Crea un piano dettagliato per refactorare i 50 service
# Claude usa Opus, analizza architettura, produce piano
# Status: Context 42,000/200,000 (21%)
# Phase 2: Implementazione routine (Sonnet efficiente)
> /model claude-sonnet-4-20250514
> Implementa i primi 10 service seguendo il piano
# Status: Context 78,000/200,000 (39%)
# Tempo: ridotto perché Sonnet è più veloce
# Phase 3: Testing e debug
> /model claude-haiku-4-20250904
> Genera test per i 10 service implementati
# Status: Context 95,000/200,000 (47.5%)
# Costo: minimo, task semplice
# Status del contesto è sotto 50%, puoi continuare
# Phase 4: Refactor avanzato (torna a Opus)
> /model claude-opus-4-20250514
> Torna indietro al checkpoint "10-services-done"
> Implementa i prossimi 20 service con refactoring conservativo
# SWITCH intelligente basato su criticità del task = minimizzare cost
8. Prompt Suggestions and Smart Autocomplete (5 December 2025)
On December 5, 2025, Anthropic added prompt suggestions in the VS Code Extension and in the CLI. As you type in Claude's prompt, press Tab to see suggestions contextual based on the uploaded files and the history of the conversation.
# Nel CLI:
> Aggiungi validazione [TAB]
# Claude suggerisce automaticamente:
# Suggerimenti contestuali:
# 1. Aggiungi validazione email al form di registrazione
# 2. Aggiungi validazione numero di telefono
# 3. Aggiungi validazione password (strength check)
# 4. Aggiungi validazione IBAN
# Premi freccia su/giù per navigare, Enter per selezionare
# Oppure digita le prime lettere del numero
# Nel VS Code Extension (sidebar Claude):
# Digita: "Genera..."
# Tab mostra:
# 1. Genera test per questo file
# 2. Genera documentazione API
# 3. Genera changelog entry
# 4. Genera seed data
# Tab copia il suggerimento, puoi modificare prima di inviare
9. Real Use Case: Refactor Monorepo 50 Files with All the Tools
Let's put together everything we've learned in one real use case: Complete refactor of an Angular + Spring Boot monorepo that lasts 3 days.
# 1. Avvia sessione nominata
claude --session "major-refactor-2025-12-05"
# 2. Accedi VSCode Extension (Ctrl+L), carica file radice
# Drag-drop CLAUDE.md + package.json + pom.xml nella sidebar
# 3. Attiva Plan Mode e usa Opus per il planning
> [Shift+Tab+Tab] Crea piano dettagliato per refactorare 50 servizi
> Il piano deve coprire 3 giorni di lavoro, include test, commit strategy
# Claude (Opus) genera piano di 2000 righe
# Status: Context 45,000 / 200,000 (22.5%)
# 4. Salva checkpoint per il piano
> /checkpoint save "day1-planning-complete"
# 5. Rinomina il piano in file:
> Salva il piano in docs/refactor-plan-2025-12-05.md
# End of Day 1
> /session rename "major-refactor-planning-done"
# 1. Riprendi sessione
claude --resume "major-refactor-planning-done"
# 2. Passa a Sonnet per implementazione routine
> /model claude-sonnet-4-20250514
# 3. Avvia background agent per i primi 20 servizi
> &@ Refactor i primi 20 servizi seguendo il piano
> Includi: rinominare, aggiornare test, aggiornare import
# Background agent avviato: bg-refactor-1
# Continua il tuo lavoro mentre Claude lavora in background
# 4. Nel frattempo, refactor manuale file critici con VS Code Extension
# Usa Sidebar, drag-drop file singoli, fai diff review prima di accept
# 5. Monitora progresso
claude --attach bg-refactor-1
# Vedi: 12/20 servizi completati... 15/20... 20/20 DONE
# 6. Checkpoint al completamento dei primi 20
> /checkpoint save "20-services-refactored"
# 7. Continua con i prossimi 20 in background
> &@ Refactor i servizi 21-40 seguendo il piano
# bg-refactor-2 avviato
# End of Day 2
> /session rename "major-refactor-40-services-done"
# 1. Riprendi sessione
claude --resume "major-refactor-40-services-done"
# 2. Ultimi 10 servizi + testing integrazione
> /model claude-opus-4-20250514 # Torna a Opus per quality
# 3. Refactor ultimi 10 servizi
> Refactor i servizi finali 41-50
> Run test suite - se failures, debug e fix
# 4. Salva checkpoint "all-50-refactored"
> /checkpoint save "all-50-services-complete"
# 5. Full regression test
> /model claude-haiku-4-20250904 # Torna a Haiku per test routine
> Genera uno smoke test che verifica tutti i 50 servizi in azione
# 6. Code review finale (Opus reasoning)
> /model claude-opus-4-20250514
> Fai una code review completa di tutti i 50 file refactorizzati
> Cerca: error handling inconsistency, missing JSDoc, stile code
# 7. Genera changelog
> /model claude-haiku-4-20250904
> Genera un CHANGELOG entry con tutti i cambiamenti
# 8. Final checkpoint
> /checkpoint save "refactor-complete-ready-for-pr"
# End of Day 3
> Completed! Tutto pronto per PR. Summary:
# - 50 servizi refactorizzati
# - 50 test file aggiornati
# - 0 broken imports
# - CHANGELOG generato
# - Code review completo eseguito
10. Best Practices for Claude Code 2.0
To maximize the value of your new tools, follow these best practices:
10 Best Practices for Claude Code 2.0
- Use Named Sessions for multi-day work: Maintain continuity and reduce context reload
- Save checkpoints frequently: Every logical milestone (feature completed, review passed)
- Organize .claude/rules/ by domain: Don't put everything in CLAUDE.md
- Task-based model switching: Opus by design, Sonnet by implementation, Haiku by routine
- Monitor context window: If > 80%, clean with /clear or /checkpoint restore
- Background agents for long tasks: Avoid locking your work with &@ syntax
- VS Code Extension for inline diff: Much quicker than alt-tabbing to terminal
- Prompt suggestions with Tab: Speed up typing of long prompts
- Combine checkpoint + rollback for process safety: Try different approaches without risk
- Rename sessions with descriptive names: "spring-cache-layer-2025-12-05" not "session-1"
Conclusion: A New Era of AI-Assisted Development
Claude Code 2.0 represents a paradigm shift in the way we work with AI agents. It's no longer an episodic tool that "helps me with a task", it's a continuous development partner which remembers the context, supports continuity operational, and gives you granular control over how it works.
Key Points to Remember
- Checkpoint system: Save filesystem snapshot + conversation, instant rollback
- VS Code Extension: Claude inline in your editor, diff review built-in
- Named Sessions: Name sessions, resume identical to how you left them
- .claude/rules/ directory: Granular guidelines for each project domain
- Background agents: Long tasks without freezing your terminal (&@ syntax)
- Model switching: Change mid-session model based on task criticality
- Context window visibility: Monitor token usage in the status line
- Prompt suggestions: Autocomplete tabs for long prompts
In the next article of the Claude series we will explore MCP (Model Context Protocol) and how to integrate external services (databases, APIs, remote file systems) directly into the context by Claude Code, creating a truly connected ecosystem of tools.
Official Resources
- VS Code Extension Marketplace: https://marketplace.visualstudio.com/items?itemName=anthropic.claude-code
- Claude Code Changelog: https://code.claude.com/docs/en/changelog
- Agent SDK Documentation: https://platform.claude.com/docs/en/agent-sdk/overview
- Best Practices Guide: https://docs.anthropic.com/en/guides/agent-development
Commenti
Caricamento commenti...
Sign in to comment