Skip to content

specs: add code simplification opportunities - #3060

Closed
mikeland73 wants to merge 2 commits into
mainfrom
claude/confident-hypatia-nxwi4z
Closed

mikeland73 wants to merge 2 commits into
mainfrom
claude/confident-hypatia-nxwi4z

Conversation

@mikeland73

Copy link
Copy Markdown
Collaborator

Summary

Adds specs/code-improvements.md, a list of places where Devbox code can be simplified or deleted. Each finding was checked by grepping its callers across the whole repo.

The findings are grouped into tiers:

  • A. Dead code: about 750 lines with no callers, or used only by their own tests. Examples:
    • nix/config.go, nix/writer.go and DaemonVersion
    • the nixprofile lookup API and configfile/field.go
    • most of usererr, the goutil package, and the "set by devbox" env marker
  • B. Unreachable or always-on paths:
    • code for Nix versions older than the 2.18 minimum
    • the v1 path behind the ResolveV2 flag, which is on by default
    • the no-op --daemon flag
  • C. Duplication:
    • about 20 copies of the devbox.Open block in boxcli
    • the services handlers, client and manager
    • configfile.PackagesMutator
    • atomic writes and copy loops repeated across packages
  • D. Stdlib and readability cleanups, now that the module is on Go 1.27.
  • E. Latent bugs found along the way. Examples:
    • a swallowed write error in StopProcessManager
    • --environment silently ignored by some commands
    • non-deterministic .envrc flag order
    • temp dirs that are never cleaned up

The spec ends with a suggested PR breakdown and lists the items that need a maintainer decision first.

How was it tested?

It is a documentation-only change. A sample of the dead-code claims was spot-checked with grep.

Community Contribution License

All community contributions in this pull request are licensed to the project
maintainers under the terms of the
Apache 2 License.

By creating this pull request, I represent that I have the right to license the
contributions to the project maintainers under the Apache 2 License as stated in
the
Community Contribution License.


Generated by Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Bqy92qQQJmPhkbrQXXySz7
@claude

claude Bot commented Nov 16, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@greptile-apps

greptile-apps Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The documentation changes appear safe to merge.

Summary

Adds a plan for simplifying Devbox code, grouped by dead code, duplication, readability, and existing bugs.

The latest changes address all three previous findings:

  • The new spec maps Devbox cleanup ideas into a reviewable plan.

No new actionable issues found in these changes.

Reviews (2) · Last reviewed commit: "specs: address review on code-improvemen..." · Reviewed by Greptile

Comment thread specs/code-improvements.md Resolved
Comment thread specs/code-improvements.md Resolved
Comment thread specs/code-improvements.md Resolved
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Bqy92qQQJmPhkbrQXXySz7

Copy link
Copy Markdown
Collaborator Author

I've turned this spec into issues and am closing the PR without merging it. The issues link back to the spec at commit c0e245a.

Refactors (all labelled code-quality):

Bugs:


Generated by Claude Code

@mikeland73 mikeland73 closed this Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants