Articles
First Principles Plus Musk's Five-Step Algorithm: Engineers Pick the Right Work, Then Do It the Right Way
Apply Elon Musk's first principles and five-step algorithm to software development: first pin down what the user wants, the constraints you must not break and the acceptance criteria, then question, delete, simplify, accelerate and automate, in that order. Includes development examples, a pre-work checklist and the original sources.
· 9 min read
Learning diagrams
en · Wide diagrams scroll horizontally. The text outline contains the same information.
Nine-grid overview
Point at or select any cell around the topic to grow its key points. The text outline below has everything.
- Scenario
- Inputs
- Tools
- Steps
- Choose the right work, do it right
- Prompts
- Checks
- Risks
- Next steps
Read the full text outline
Choose the right work, do it right
- Scenario — Jump straight into coding a ticket
- Requirements from habit or authority go unquestioned
- A feature that should not exist is found out late
- Inputs — Facts reduced to the irreducible
- The outcome the user wants
- Hard constraints and acceptance criteria
- Tools — First principles + five-step rule
- First principles decide what to do
- The five steps decide how to finish it
- Steps — Question to automate, in five steps
- All five steps must be done in order
- No code until the facts are written down
- Prompts — Facts table as the agent's opener
- Fill in outcome, constraints, acceptance
- So the agent doesn't start from assumptions
- Checks — Each item can state why it exists
- Every requirement maps to who raised it
- Under 10% added back means too little deleted
- Risks — Working from step 5 back to step 1
- Optimizing something that should not exist
- Automating a process that is unnecessary
- Next steps — Checklist for the next ticket
- Copy it into an issue or hand it to an AI agent
- When deleting, keep necessary safety and acceptance
Pick the right work, and do that work the right way.
That is the conclusion of using first principles and the five-step algorithm together. They split the job like this:
- First principles first: find the facts that cannot be broken down any further, including what the user wants, the constraints you must not break, and what counts as passing acceptance.
- Then the five steps: work through the task in order: question, delete, simplify, accelerate, automate.
Until the facts are written down clearly, don't touch the code.
First Principles: Break the Problem Down Until It Can't Be Broken Down Further#
Break the problem down to its basic facts, then reason upward from those facts to a solution.
In his APS News interview, Musk contrasts this with "reasoning by analogy". Reasoning by analogy means "other people keep doing it this way, so we do it this way"; first principles means finding the most basic facts in a field and building up from there. His example is rockets: first ask what materials a rocket is made of and how much those materials cost, rather than looking at what existing rockets sell for.
What you need to pin down:
- Materials and cost
- Physical limits
- What the user really wants
- Which conditions, once removed, make the problem stop existing
Every conclusion should be able to point to the basic fact it depends on.
How to Use It#
- Take the existing approach apart completely and list the assumption behind each part.
- Remove the assumptions and keep only the facts that are still true and the constraints you must not break.
- Use those facts to rebuild the shortest path that reaches the same outcome.
In the same interview, Musk also notes that most of daily life can only run on reasoning by analogy, and thinking about everything from first principles would burn too much mental energy. The better moments to spend that effort are when you are building something new, or when the current approach is clearly stuck.
Applying It in Development#
When you receive a ticket, write down three things first. Take a request like "order report export" as an example:
| Basic fact |
Question to answer |
Example |
| What the user wants |
What will they do with it once they have it? |
Accountants import order data into accounting software at the end of each month |
| Constraints you must not break |
Which conditions can't be broken? |
Personal data fields must not leak, and up to 100,000 records must finish within 30 seconds |
| Acceptance criteria |
What counts as done? |
The accounting software can import it directly, and amounts and record counts match |
Once that is written, "support Excel, CSV and PDF" on the ticket may turn out to need only CSV.
This table can also serve directly as the first instruction you give an AI coding agent. Only when the facts are written clearly will the agent not start coding from assumptions.
Musk's Five-Step Algorithm (The Algorithm)#
The five steps were made public in the 2021 Everyday Astronaut Starbase tour interview, and Walter Isaacson's 2023 biography "Elon Musk" also summarized them as "The Algorithm". Everyday Astronaut's write-up states that these five steps must be done in order.
| Order |
Original wording (as summarized by Everyday Astronaut) |
In development |
| 1 |
Make the requirements less dumb |
Question the requirements |
| 2 |
Try very hard to delete the part or process |
Delete what isn't necessary |
| 3 |
Simplify and optimize the design |
Simplify the implementation |
| 4 |
Accelerate cycle time |
Accelerate delivery |
| 5 |
Automate |
Automate |
Step 1. Question the Requirements#
First ask whether this work really solves a problem, then ask who proposed it and by what standard it counts as done. Lay out every assumption that comes from habit, authority or smart people and check it. Only when the requirement itself holds up is the work after it worth doing.
- Musk puts it more bluntly: requirements are always flawed somewhere, no matter who gave them to you. Requirements from smart people are actually more dangerous, because you are less likely to question them.
- Every requirement should map to a person, not a department. A department can't answer "why does it have to be this way", but a person can.
- In development: write the proposer's name next to every spec line in the PRD. For any line where you can't find the person and can't state the reason, mark it as needs confirmation first.
Step 2. Delete What Isn't Necessary#
Remove parts, steps and procedures with no clear value, and keep only the safety and acceptance that are truly necessary. For everything you keep, you should be able to say why it exists.
After deleting, if almost nothing needs to be added back, you haven't deleted enough. Everyday Astronaut's write-up gives the original line: if you aren't adding back at least 10% of the parts you deleted, you didn't delete enough.
- In development: feature flags that are already on for all users and will never be turned off again, abstraction layers kept "in case we need them later", manual approvals clicked through as routine every time, and logs and reports nobody reads (historical technical debt).
- "Keep only the necessary safety and acceptance" is a baseline added for software development; Musk's original has no such clause.
Step 3. Simplify the Implementation#
Simplify only the parts you have confirmed must stay, and finish them in the most direct way with clear responsibilities. Settle the boundaries first, then reduce the approach to its shortest path.
The standard for simple: others can understand it, verify it, and reproduce the same result.
- As for why simplifying comes after deleting, Everyday Astronaut's write-up puts it this way: the most common mistake smart engineers make is optimizing something that should not exist at all.
- In development: before tuning performance, refactoring or adding a cache, confirm that this code survived step 2.
Step 4. Accelerate Delivery#
Split out the work that can run at the same time, and shorten the time each round takes from doing to getting feedback. What you speed up is a process that has already been questioned, deleted and simplified. While the cycle gets shorter, the acceptance criteria stay the same.
- In the interview Musk says "you're going too slow, go faster", then adds that you shouldn't accelerate until the first three steps are done.
- In development: smaller PRs, creating worktrees to run tests in parallel, multiple AI agents each handling independent tasks, and preview environments to shorten the feedback loop.
Step 5. Automate#
Hand only processes that are already stable, repetitive and worth keeping over to tools, tests or release gates. Automation comes after the first four steps, and it is there to cut manual repetition, not to replace judgment. Before going live you still need clear checks and release conditions that can be rolled back.
- Musk's original context was the factory: once a problem is diagnosed clearly, you can remove an inspection in the middle of the process. The software equivalent is not removing checks but writing them into CI so a machine runs them every time.
- In development: CI running tests and lint, automatic rollback when a deployment fails, and turning any command you've repeated three or more times into a script or an agent skill.
Get the Order Backwards and All the Earlier Effort Is Wasted#
Each of the five steps is easy on its own. The hard part is the order. Many teams have probably worked from step 5 back to step 1:
| Done in reverse |
Result |
| Write a full automation for a process first |
The process wasn't needed, so the automation is wasted too |
| Optimize an API's performance first |
That API should have been deleted in step 2 |
| Tell the AI agent to start coding first |
What it writes is assumptions, not what the user wants |
First principles decide which work to do, and the five steps decide how to finish it. Without the former, the latter, however fast, only does the wrong thing more efficiently.
Checklist Before You Start#
You can copy this straight into an issue or hand it to an AI agent:
Basic facts
[ ] What the user wants:
[ ] Constraints that must not be broken:
[ ] Acceptance criteria:
Five steps (in order)
[ ] 1 Question: every requirement has a proposer and a reason
[ ] 2 Delete: list what was deleted and note how many items were added back afterward
[ ] 3 Simplify: handle only the parts that remain
[ ] 4 Accelerate: split out work that can run in parallel; acceptance criteria stay the same
[ ] 5 Automate: automate only stable, repetitive processes and keep rollback conditions
FAQ#
Did Elon Musk come up with first principles?#
No. The idea of first principles goes back to Aristotle. Musk applied it to cost and engineering problems at SpaceX and Tesla, which made the term widely known in tech circles.
Does Musk's five-step algorithm have to be done in order?#
Yes. Everyday Astronaut's write-up states the five steps must be done in order, and Musk also says not to accelerate until the first three steps are done.
Where does "you should add back at least 10% after deleting" come from?#
It comes from the 2021 Everyday Astronaut Starbase interview write-up: if you aren't adding back at least 10% of the parts you deleted, you didn't delete enough. Treat it as a signal for checking whether you have deleted enough.
Can software development copy this as is?#
Mostly, with two adjustments: when deleting, keep the necessary safety and acceptance; when automating, write the checks into CI instead of removing them.
Sources#
Read Next#
In the pre-work checklist, the "constraints that must not be broken" and the "acceptance criteria" need to be written as rules an AI agent cannot misread when you hand them over. A good next step is Stop Dumping SOPs Directly into AI Agents: Precisely Control Agent Behavior with RFC 2119 (MUST/SHOULD/MAY), which uses MUST, SHOULD and MAY to separate hard constraints, strong recommendations and discretionary choices.