Skip to content

Perf: aidc up/claude should skip --build when image is fresh (fast path + pin agents) #13

Description

@ai-anant

Problem

aidc claude / aidc up always runs docker compose up -d --build (lib/aidc.sh:240), which forces Docker to re-evaluate the build on every start. Combined with unpinned curl | bash agent installers (latest versions fetched at build time), any layer-cache miss triggers a full ~3 GB re-install — the "every aidc claude or aidc start results in a large ~4GB container" experience.

Proposal

  1. Fast path in aidc up: if the compose image already exists and the Dockerfile/compose haven't changed (check docker image inspect + mtime/hash of .devcontainer/Dockerfile and compose.yaml), run docker compose up -d without --build. Only run --build when the image is missing or the files changed. (This mirrors what aidc rebuild is for — rebuild keeps forcing the build.)
  2. Pin agent installs (versions + SHA256 where the vendor provides them) so the agent layer is deterministic and the layer cache is actually reusable across projects. Unpinned latest installers silently change layer digests and defeat Docker's cache.
  3. Optionally: AIDC_NO_BUILD=1 env escape hatch for users who want up to never build.

Expected impact

Files

  • lib/aidc.shaidc::cmd_up, aidc::cmd_rebuild
  • templates/devcontainer/Dockerfile.tmpl — agent install block (pin versions)

Acceptance criteria

  • aidc up twice in a row: second run does not invoke docker build (verify with --progress output or build log).
  • aidc rebuild still forces a rebuild.
  • aidc up on a repo whose Dockerfile changed triggers a build.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions