A code freeze is a defined period in the software lifecycle during which developers stop merging changes into a release branch or main line, except for explicitly approved fixes. Its purpose is to give testers, release managers and operations staff a stable, unchanging build to verify before it ships to users.
The freeze is a risk-control measure: every change carries a chance of introducing a defect, so limiting change near a release reduces the number of unknowns. It is closely related to, but stricter than, a feature freeze, and it usually precedes the publication of a release candidate or the final general availability build.
How a code freeze works in a release process
A code freeze works by changing the rules for accepting commits at a planned date. Before the freeze, any change that passes review and automated tests may merge. After the freeze begins, a change may merge only if it fixes a release-blocking defect and has been approved by a designated owner, often called a release manager or a change advisory group.
Teams typically enforce the freeze with branch protection rules, required approvals or a dedicated release branch cut from the main line. Cutting a branch lets ordinary development continue on the main line while the frozen branch receives only cherry-picked fixes. Without a separate branch, the whole team must pause merging, which is simpler but more disruptive.
The following table shows the typical phases around a freeze and what each phase allows.
| Phase | What may change | Main activity |
|---|---|---|
| Open development | Features, refactoring, fixes | Building new functionality |
| Feature freeze | Fixes and polishing of existing features | Completing and stabilizing scope |
| Code freeze | Only approved critical fixes | Regression testing and verification |
| Release candidate | Only fixes for blocking defects | Final acceptance testing |
| Release and thaw | Normal rules resume | Deployment and next cycle |
Types and strictness levels of code freezes
Code freezes vary in scope and strictness, and the right level depends on the cost of a failed release. A soft freeze discourages risky changes but still allows low-risk fixes with ordinary review, whereas a hard freeze blocks everything except documented emergency fixes.
| Variant | Rule | Typical use |
|---|---|---|
| Soft freeze | Low-risk fixes merge with normal review | Frequent web releases |
| Hard freeze | Only approved release blockers merge | Packaged software and firmware |
| String freeze | No changes to user-visible text | Projects that need translation time |
| API freeze | No changes to public interfaces | Libraries and platform releases |
| Change freeze | No production deployments at all | Peak retail seasons and holidays |
The change freeze deserves a separate note. It applies to production infrastructure and deployments rather than to source code, and organizations often impose one during high-traffic periods such as the end of the financial year or major shopping events, when an outage would be especially costly.
Code freeze compared with related lifecycle practices
A code freeze is one of several controls that shape the release cycle, and it is often confused with its neighbors. The key distinction is what is restricted: scope, code, deployment or exposure to users.
| Practice | What it restricts | Typical timing |
|---|---|---|
| Code freeze | All code changes except approved fixes | Days to weeks before release |
| Feature freeze | New features, not fixes | Weeks before release |
| Release candidate | Marks a build considered shippable | After freeze, before final release |
| Feature flag | Exposure of finished code to users | Continuous, independent of releases |
| Hotfix | Not a restriction but an urgent change | After release, often during a freeze |
Feature flags and trunk-based development reduce the need for long freezes, because unfinished work can be merged in a disabled state. Teams practicing continuous delivery often replace a formal freeze with a short stabilization window or rely entirely on automated tests and progressive rollout.
Planning and running an effective freeze
An effective code freeze starts with a published date and clear exception criteria. Developers need to know in advance when merging stops, what counts as a release blocker and who approves exceptions. Ambiguity leads to a last-minute rush of large changes, which is exactly the risk the freeze is meant to avoid.
- Announce the freeze date at the start of the release cycle and repeat it as the date approaches.
- Define a release-blocker severity in writing, for example data loss, security flaws or crashes in core workflows.
- Require every exception to reference a tracked defect and pass the full regression suite.
- Keep the freeze as short as verification allows, typically a few days for web services and one to several weeks for packaged software.
- Record exceptions so the team can review them in the retrospective.
Duration depends on release frequency and testing effort. A product shipped weekly with strong automation may freeze for hours, while an operating system or embedded firmware release with manual certification may freeze for a month or longer.
Risks and common mistakes with code freezes
Freezes reduce release risk but create their own costs. The most common is the pre-freeze rush, in which developers merge large, insufficiently tested changes just before the deadline, so the freeze period begins with more instability rather than less.
Long freezes also produce merge debt: work continues on other branches, and when the freeze lifts, many changes merge at once and conflict. Excessive exceptions quietly turn a hard freeze into no freeze at all, which gives a false sense of safety.
| Problem | Likely cause | Remedy |
|---|---|---|
| Instability at freeze start | Last-minute merging of large changes | Set an earlier feature freeze |
| Painful merges after release | Long freeze with parallel work | Cut a release branch and keep main open |
| Too many exceptions | Vague blocker criteria | Define severity levels in writing |
| Idle developers | Whole team blocked from merging | Shift effort to tests and next-cycle work |
Understanding it simply
Think of a theater company a few days before opening night. The script is final, and the actors stop rewriting scenes so they can rehearse what they already have. Only a serious problem, such as a broken prop, gets fixed.
A code freeze is the same idea for software. The team stops making changes so it can check the finished product carefully. Fewer changes mean fewer new surprises right before people start using it.
Applied in practice
An online retailer plans a major checkout update to launch three weeks before its busiest shopping weekend. The engineering lead announces a code freeze ten days before launch on a dedicated release branch, while ordinary development continues on the main line.
During the freeze, testers run the full regression suite and a load test at three times normal traffic. They find two defects: a rounding error in tax calculation and a slow database query. Both are classified as release blockers, fixed, approved and cherry-picked into the branch. A request to add a new promotional banner is rejected and scheduled for the next cycle.
The update launches on time, and the company then imposes a production change freeze across the peak weekend. The result is zero checkout incidents during the period with the highest revenue of the year.