# Don't /drop read-only files added at launch

> Follow along as aider is modified to preserve read-only files specified at launch when using the /drop command. Aider does this implementation and adds test coverage.

- 网址：https://funcoding.ai/agents/aider/recordings/dont-drop-original-read-files/
- 来源：Aider 官方文档原文（英文），Apache-2.0 许可，同步于 2026-10-11
- 官方原文：https://aider.chat/docs/recordings/dont-drop-original-read-files.html

---
<link rel="stylesheet" type="text/css" href="/assets/asciinema/asciinema-player.css" />

<div class="page-container">
  <div class="toast-container" id="toast-container"></div>

  <div class="macos-backdrop">
    <div class="terminal-container">
      <div class="terminal-header">
        <div class="terminal-buttons">
          <div class="terminal-button terminal-close"></div>
          <div class="terminal-button terminal-minimize"></div>
          <div class="terminal-button terminal-expand"></div>
        </div>
        <div class="terminal-title">aider</div>
      </div>
      <div id="demo"></div>
    </div>
  </div>
</div>

<div class="keyboard-shortcuts">
  <kbd>Space</kbd> Play/pause —
  <kbd>f</kbd> Fullscreen —
  <kbd>←</kbd><kbd>→</kbd> ±5s
</div>

## Commentary

- 0:01 We're going to update the /drop command to keep any read only files that were originally specified at launch.
- 0:10 We've added files that handle the main CLI and in-chat slash commands like /drop.
- 0:20 Let's explain the needed change to aider.
- 1:20 Ok, let's look at the code.
- 1:30 I'd prefer not to use "hasattr()", let's ask for improvements.
- 1:45 Let's try some manual testing.
- 2:10 Looks good. Let's check the existing test suite to ensure we didn't break anything.
- 2:19 Let's ask aider to add tests for this.
- 2:50 Tests look reasonable, we're done!
