When you are starting a company, the last thing you want to think about is paperwork, particularly dense legal agreements between your other cofounder(s) and your new company. But as burdensome as it can seem now to properly document your startup, failing to do so now can cause much bigger headaches down the road.

Sam Altman, the current president of the prestigious Y Combinator (or YC) in Silicon Valley, recently penned a surprisingly candid blog post about YC startup Cruise, which was acquired by General Motors for an astronomical amount of money. During the acquisition, Cruise’s founder was being sued by someone who had collaborated with the company for less than a month very early in the company’s life. It is the business equivalent of all of your long lost relatives showing up with their hands out after you win the lottery.

As Altman noted in his post, the lawsuit against Cruise is likely frivolous, but it still represented an unwanted distraction for the company while the merger with GM was pending. For a bit of context, during the sale of a company or during funding rounds, the lawyers for the acquiring/investing company will pour over the target company’s books in order to identify any potential problems with the target company. This process is affectionately referred to as ‘due diligence’ and is about as fun for the target company as a dentist appointment, and way more costly. Pending or threatened litigation, particularly litigation alleging that the plaintiff has an equity interest in the company, scares the heck out of the attorneys and business folks. At best, it represents a diligence point that must be addressed in the financing documents, and, at worst, it can kill a deal.

And stepping back from the M&A/venture capital context, pending litigation—even baseless litigation—is expensive for any company to deal with and can often be fatal to an early stage company. As a quick aside, I was a corporate litigator for several years before seeing the light and becoming a business/startup attorney. During my time in litigation, I was often amazed at how an opportunistic plaintiff could take a routine or innocuous situation and spin it into multimillion dollar boondoggle for a company </rant>. But the point is that even if you and your company are 154% fault-free, litigation is expensive, hard on company morale, stressful, and distracts you from what you should be doing: building a profitable company.

At this point, hopefully I’ve scared you enough to say “OKAY, fine! I’ll make sure that I keep good records about my startup! What should I do in particular?” Good. Glad to hear it.

The first step to any successful startup is good communication between cofounders. Communicating early about expectations and roles can save you a lot of headaches later, with litigation and otherwise. Before writing one line of code, I would suggest sitting down with the other cofounder(s) and figuring out how equity will be split and who is responsible for what areas. The same thing goes for people coming into the company after it’s founded. Don’t put off the tough conversations.

Once everyone agrees on how to cut the pie, this should be memorialized in writing. At the very beginning, this can even be a short document that sets forth the equity split and notes that everyone involved is subject to the same vesting schedule. As Altman alluded to in his blog post, the standard arrangement for cofounders is that everyone is subject to a four year vesting schedule with a one year cliff. This means that if anyone, even the founder and CEO, leaves the company within a year, they get nothing and their equity goes back to the company’s pool. Remember, your ultimate goal should be to protect the company, not one particular person.

Of course, as your startup grows (and hopefully before it is legally founded), an attorney familiar with startups should be engaged to ensure that you are complying with the requisite corporate formalities. Many law firms, including Bryan Cave, now have incorporation bundles for startups, which cost a fixed amount of money and include basic legal documents (articles of incorporation, bylaws, shareholders agreement, etc.), NDAs, a cap table, and employment/IP agreements. Simply managing expectations among cofounders and putting written agreements in place can go a long way to preventing headaches down the road.

Moreover, keeping good written records for your startup early is invaluable generally, not just for protecting again potential future litigation. It is highly recommended to get in the habit of saving copies of all documents/agreements/forms related to the company. You can just put them in an email folder or in your file cabinet at home and forget about them. Then, later, when you have secured funding (hooray!) and the lawyers ask you to provide detailed business records of everything for the due diligence review, from financial statements to intellectual property agreements, you will be prepared and organized. Believe me, having to track down your old Amazon Web Services contract and Employer Identification Number form a few days before you close your Series A funding round is terrible and stressful. Do your future self a favor and put all your company documents in one easy-to-find place.

Protecting yourself and your company in the very early stages can often be as simple as jotting down information and throwing it in a drawer or email folder, so you know where it is when things go egg-shaped later. Keeping careful records and documenting everything now can save you a lot of time and money down the road and can even prevent costly lawsuits altogether.