Lars Hansen

Software notes · 23 June 2026

Learnings from using Claude Sonnet and Opus in a Visual Studio Environment

I use GitHub CoPilot a lot as part of my software development activities. I use the Claude Sonnet and Opus models mostly in “Agent” mode, although I have used other modes particularly for large migrations/transformations.

When I first started, it was pretty much prompt driven and while that is a fascinating process is not particularly effective.

As I gained more experience with using the CoPilot and the Claude models, I rapidly learnt that whilst providing a detailed specification for the work to be done is a key step in getting the right outcome, much greater productivity can be achieved by also setting up a contract which is loaded by CoPilot at the beginning of every session. That contract specifies Claude’s interaction semantic for any session.

Here is a simplified example of a standard contract:

🧩 Universal Task Contract

1. Role

2. Scope

3. Plan & Progress

4. Clarification

5. Context Management

6. Output Style

7. Self‑Check

Before finalising an answer, perform a quick self‑check for:

8. Persistence

9. Responsiveness & Stability Rules

9.1 Focus Enforcement

9.2 Session Hygiene

9.3 Bounded Reasoning

9.4 Incremental Output

9.5 Context Compression

9.6 Latency Awareness

9.7 Drift Detection

9.8 Explicit Continuation Protocol

9.9 Micro-reset Permission

9.10 Terminal Resilience

I know that this contract wont work for everybody. I suspect assigning the Claude LLM the role of my senior engineering partner, might be a bit controversial but that is what works for me.

I will also often create new features or change features that affect other repo’s. Rather than repeating a process, I will get Claude to generate a .md file that documents the change and provides sufficient information that any other repo that relies on the change or is impacted by the change has a clearly documented process that can be applied to that repo almost on a template-based approach.

I have found, like many others, that productivity gains in the order of 5 - 10 times what I can do myself are common, particularly with the more sophisticated frontier models that are currently accessible within CoPilot. It does come however at a cost; namely it can quickly, without focussed awareness and attention, lead to a partial loss of knowledge of how the application works, that is a significant risk in case problems arise.