Skip to content

Chapter 2 - Basics

Master the essential workflows and key bindings that accelerate everyday AI-assisted development.

  • Reading time: 15 minutes
  • Practical time: 20-30 minutes

Reading

Briefs

Best Practices

Models per use case

Consider the model per use case

ModelStrengthSwitch with
SonnetMost coding tasks, good balance/model or --model sonnet
OpusComplex architectural decisions/model or --model opus
HaikuFast, low-latency tasks/model or --model haiku

Memory

AI agents maintain conversation context across your session. This context accumulates as you work, eventually affecting performance and accuracy. Clearing context regularly ensures faster responses and prevents the agent from using stale information from earlier in your session.

Permissions

Agents request permission before executing certain actions like file edits, bash commands, or network requests. While this provides safety, it can interrupt workflow. In Claude Code, use a settings.json file to preconfigure trusted permissions. In Copilot CLI, permissions are passed as CLI attributes (e.g. --allow-tool='shell(git:*)') - there is no persistent permissions file. Both approaches reduce approval overhead while maintaining control over sensitive operations.

Git Commit Management

⚠️ Important: Managing your own commits is important. For any changes you consider valuable, commit them before asking the agent tool to proceed with other changes.

Assets

Configuration files for permission management exercises:

⚠️ Important: Extract and overwrite the configuration files for your chosen tool (Claude Code or Copilot CLI). These assets contain tool-specific settings that should replace any existing configuration in your project.

Practical

Exercise 1: Context Management and Model Selection

Test how memory and model switching affect agent responses.

Prompt:

@cart.service.ts Explain what this service does

After getting the response:

  1. Switch models with /model (or --model opus for Copilot CLI)
  2. Ask: "What did you just explain to me?"
  3. Close the session with /clear
  4. Ask again: "What did you just explain to me?"

What to observe:

  • The agent remembers context within the same session
  • After clearing, the agent has no memory of previous responses
  • Different models provide varying levels of detail (Sonnet balances speed/quality, Opus provides deeper analysis)

Exercise 2: Permission-Based File Editing

Experience how agents request permission before modifying files.

Prompt:

Add a comment to the first line of cart.service.ts explaining its purpose

After the agent makes the edit:

Show me the git diff for this change

What to observe:

  • The agent requests permission before writing to files (unless permissions are pre-configured)
  • Git integration allows you to review changes immediately
  • You can approve/deny specific actions to maintain control over your codebase

Try again with different settings:

  1. Close your session
  2. Copy the configuration files from the Assets section to your working directory (based on whether you're using Claude Code or Copilot CLI)
  3. Repeat the exercise and observe how permission behavior changes with the new settings

Exercise 3: Mode Switching

Practice navigating between plan and agent modes.

  1. Press Shift+Tab to enter Plan mode
  2. Type a multi-step task (e.g., "Add logging to cart service")
  3. Press Shift+Tab to return to Agent mode (or Default or Autopilot Mode)
  4. Execute the plan

What to observe:

  • Plan mode lets you outline work before execution
  • Agent mode executes tasks directly
  • You can switch modes mid-session based on task complexity

⚠️ Important: After completing all exercises, discard all changes.

Copyright © MSG Systems Romania AI Labs