Docs Projects
Safety

Everything that protects a project while an AI works on it, in one tab.
Versions. A version is a snapshot of every file in the project.
- Press Save a version before you ask an AI for a big change.
- If something breaks, press Go back next to the version. Lokstack saves your current state first, so going back can itself be undone.
- What changed shows exactly which files differ from a version.
- Automatic saves a version every 5 minutes while files change (Pro). Clean up deletes old versions; your files are not touched.
Versions live inside the project's own hidden .git folder. Nothing is uploaded, and your branches and commits are not affected. Files Git ignores (such as node_modules and .env) are not included. When the project is one folder of a bigger repository (a monorepo), Go back and What changed only cover that folder; the rest of the repository is left alone.
Health check. Runs the project's own install, type, lint, build and test commands one after another and shows a result for each. If the install step fails, the steps after it are skipped. A failed step has a Copy for AI button.
Secrets guard. Checks everything Git would share for passwords, API keys and private keys. A serious finding, like a .env file already saved in Git, has a Stop tracking button. A warning, like a .env that is not in .gitignore, has Add to .gitignore.
Push guard. Stops a commit or push that contains an API key, wherever it is in the code and whoever runs Git: the Git tab, the terminal, your editor or an AI agent. It is off until you turn it on with the switch. To have it in every Git project, also the ones you add later, turn on Settings › Push guard › On for every Git project; a project you turn off on its Safety tab stays off, and turning the setting off removes it only where the setting added it.
- Lokstack adds two small hooks to the project's hidden
.git/hooksfolder. Nothing in your project's files or history changes. A hook the project already had is kept and runs first; turning the guard off puts it back. - Before each commit it checks the lines being added. Before each push it checks every commit that is not on GitHub yet, so a key that was added and then deleted in a later commit is still caught while it can be taken out cleanly.
- When it stops something, the message names the commit, file and line (the key itself is hidden). The card under Recently blocked shows the same with the steps to fix it, and Save a version first before you change a commit.
- Not a real key? Add
lokstack-allowin a comment on that line, or press Not a secret. The allow list is kept in~/.lokstack, never in the project, and stores a fingerprint, not the value.
If the project keeps its hooks in its own folder (husky, or a .githooks folder), the switch adds one line to its pre-commit and pre-push files instead, and turning it off takes the line out again. You can commit that line: on a Mac without Lokstack it does nothing. If Lokstack is removed from the Mac, the hooks let commits through with a warning. A key that was already pushed must be changed: removing it from history does not make it safe.
Notes for AI tools. Writes your start command, port, versions and databases into the files AI tools read (AGENTS.md, CLAUDE.md and others), so they stop guessing. Your own text in those files is kept. Use Preview first.
Worktrees and lanes. Separate working copies for AI agents. Each has its own Git branch. Lanes (see section 10) add a port, a database copy and an address to each one.
Something unclear or missing? Tell us or write to support@lokstack.app.