This is how I solved the problem with help of Gemini CLI for fixing permissions and an idea to create .antigravityignore file and my idea how to organize all past chats into knowledge base that Antigravity cleanup procedure will not delete (100+ chats). I think that entire below instruction could be pasted into Antigravity AI chat or do it like in the old days ![]()
[FIX] Antigravity IDE Knowledge Base: Empty Folder or “Stuck at 20 items” Problem
If your Knowledge Base (KB) in Antigravity is empty or keeps deleting your items, follow this 4-step solution to fix permissions, prevent crashes, and
bypass the hardcoded 20-item limit.
Step 1: The “Unlock” (Linux ACL Fix)
Even if you own the folders, restricted ACL masks can “blind” background processes. Run these commands to grant full access and clear the cache:
1 # Fix permissions for background processes
2 setfacl -m m::rwx ~/.config/Antigravity
3 setfacl -m m::rwx ~/.gemini/antigravity/knowledge
4
5 # Clear cache to reset the indexer engine
6 rm -rf ~/.config/Antigravity/Cache/*
7 rm -rf ~/.config/Antigravity/“Code Cache”/*
Step 2: Prevent Crashes (.antigravityignore)
The indexer often crashes (Segfault) when trying to read massive dependency folders. Create a file named .antigravityignore in your project root and add
these lines:
1 node_modules/
2 venv/
3 .venv/
4 build/
5 dist/
6 *.so
7 *.dat
8 .git/
RESTART the IDE after these two steps.
Step 3: Verification (The “Test Save”)
Before syncing everything, verify the agent can now write to disk:
- Open a chat and tell the agent: “Save a summary of our current project structure to the Knowledge Base now.”
- Check the folder: ~/.gemini/antigravity/knowledge/.
- If you see a new folder with files inside, move to the final step.
Step 4: The Permanent Fix (Bypass the 20-item limit)
Antigravity deletes “temporary” history items once you exceed 20. To keep everything, you must tell the agent to use Project-Based Mapping.
Open a chat and say exactly this:
“I want to sync my history into the Knowledge Base. Please access ALL my previous conversations, review them, and consolidate them into Knowledge Items named after my actual project directories (e.g., ‘Project-A’, ‘Project-B’). Do not save standalone history items
anymore. Instead, save the consolidated info as a ‘project_history.md’ artifact inside these project-based Knowledge Items.”
Why this works:
- Step 1 & 2 ensure the engine is physically able to run without crashing or being blocked by Linux permissions.
- Step 4 tricks the pruning logic. The system treats folders named after projects as “Permanent Artifacts” and won’t delete them, whereas it would delete
them if they were named with random history_ IDs.