Customer stories

1Password uses Code Search and Cody to increase productivity while working in a growing, distributed codebase

1Password logo

1Password offers identity security and access management solutions built for the way people work and live today. The company is on a mission to eliminate the conflict between security and productivity while securing every sign-in for every app on every device. Over 150,000 businesses and millions of consumers trust 1Password to keep their most important information safe.

7 hours per month

Estimated time saved by each developer using Code Search + Cody.

3,900 hours

Projected engineering time saved in the first year with Sourcegraph.

Try Sourcegraph with your team

Search, write, and understand code faster with Code Search + Cody.

Book a demo

With a growing codebase and Engineering team, 1Password developers use Code Search to find and navigate code across multiple code hosts without relying on teammates. They also use Cody to reduce the toil of creating unit tests and making programmatic changes in code.

Working in a growing codebase

1Password has seen significant growth over the past several years. The Engineering team has grown to several hundred developers, and the team’s codebase has grown from two monorepos to more than 200 repositories spread across multiple GitHub and GitLab instances. This code sprawl has added complexity to the company’s Engineering organization over a short amount of time.

As the codebase grew, 1Password developers discovered that searching for code was becoming increasingly difficult, especially when someone needed to find code they hadn’t worked on personally. The native code search tools built into their code hosts didn’t solve the issue.

The native search found in GitLab and GitHub was limited to searching for repositories within each code host, so if a developer didn’t know exactly where a piece of code lived, the search function wasn’t an effective way to find it. Engineers sometimes found it faster to ask colleagues in hopes of being pointed in the right direction.

1Password adopted Code Search to help solve this. With Code Search, any engineer could now search for code across the entire codebase and all code hosts from a single place. Developers are now self-sufficient in finding code and no longer slow others or themselves down while trying to hunt for what they need.

James Griffin-Allwood, a Staff Developer on the 1Password Engineering Foundations team, had run into this problem previously: “Before Sourcegraph, if I didn’t know where a piece of code lived, I struggled to find it. I would use Slack to ask people if they knew about that code or if they knew someone else who might know about it.”

There have been many instances when I know something exists, but I don’t know where to start. I don’t know what repo it’s defined in or if it came from Terraform or Ansible. Now I just go to Code Search, start searching, add some filters, and I’m always able to find it.

James Griffin-AllwoodStaff Developer, 1Password

Using Code Search, 1Password’s Engineering team can work more efficiently in their growing codebase without relying on institutional knowledge or needing to work through other developers to find what they’re looking for.

Reducing toil with Cody

In addition to Code Search, 1Password rolled out Cody—our AI coding assistant—to their entire Engineering team to help developers with their everyday work. Developers were initially skeptical of broad claims about AI making them more productive, but since using Cody, they’ve found that it can significantly reduce toil for specific real-world use cases.

One use case is unit testing. Cody chat has built-in prompts to automatically generate unit tests for a selected piece of code. This feature has increased the likelihood of developers taking the time to set up unit tests because it removes the friction from setting up test cases.

As James put it: “Cody removes the toil for unit tests. For any function, Cody will set up 5 to 10 test cases, including test cases that I wouldn’t have thought about myself. There’s a fatigue that sets in with unit tests that I previously had to overcome, but now Cody can simply set up the test cases for me.”

Sometimes, if the right thing to do—like writing unit tests—is too hard, people won’t do it. Cody's value is that it lets developers be their best selves while relieving the burden of repetitive tasks.

James Griffin-AllwoodStaff Developer, 1Password

Making programmatic changes with AI chat

The team also uses code AI to take the toil out of making programmatic edits across code. Benjamin Bruneau, Senior Developer, works on the design system team at 1Password. As part of the design system, Benjamin frequently works on large schemas of nested JSON objects that contain tokenized values used throughout the 1Password application.

Making changes to these large, nested JSON objects can create lots of tedious work, mainly because it’s often not as simple as changing out one word for another. For example, Benjamin may want to change a value field across several objects to reflect the primary key of a nested object. He can now prompt Cody to make this kind of edit in natural language, and Cody will apply the change across multiple objects. “It saved me a ton of time. Without Cody, it would have just been toil.”

Using Code Search + Cody to champion innersourcing

The 1Password team has also used Sourcegraph to help advance its innersourcing initiative. The Engineering Foundations team has been championing the concept of innersourcing with the goal of making any developer on any team in the company feel comfortable contributing to any codebase, sharing code, and reusing code.

Since 1Password’s codebase grew so quickly and exists over multiple code hosts, the innersourcing initiative became more of a challenge. Finding and navigating code in unfamiliar repositories was difficult for developers.

Now, with Code Search, developers can search the entire codebase for unfamiliar code in a single place. This allows them to find reusable code without knowing exactly what it looks like.

Meanwhile, Cody helps developers understand what unfamiliar code does and even helps them write code in languages they’re less practiced in. Developers can pull up code and ask Cody to explain exactly how it works, and then they can ask Cody to make a change in natural language, even if they might not be experts in that language.

As James described it: “Anyone should feel open and comfortable contributing to any of our codebases. The combo of Cody and Code Search makes it possible. How do I find the thing? Code Search gets me there. Then, using Cody alongside a compiler means I can make changes and fix errors in code even if I don’t know the language.”

Explore other customer stories

Indeed logo

Indeed keeps code up to date and accelerates development velocity.

Read the case study
FactSet logo

FactSet migrates from Perforce to GitHub.

Read the case study
HashiCorp logo

HashiCorp streamlines cross-repository code search and fixes with Sourcegraph.

Read the case study
CERN logo

Sourcegraph empowers CERN to tackle code reuse and code changes in mission-critical applications.

Read the case study