⚡ Your docs should never lie again.
DocDrift finds stale documentation in your codebase before you commit — and fixes it automatically using AI.
No more outdated READMEs. No more confused developers. No more wasting hours debugging wrong documentation.
You change a function. You forget to update the docs. Now your README is lying.
A new developer follows it → wastes 3 hours → blames the project.
This happens everywhere. And nobody really fixes it.
DocDrift hooks into your workflow and fixes documentation drift instantly.
- Detects changed functions/classes
- Finds related documentation
- Checks if it's still correct
- Fixes it using AI
- Updates everything before commit
All in one command.
$ git add .
$ docdrift commitDocDrift scanning before commit...
Found 1 errors · 0 warnings · 2 undocumented
ERROR validate_token
README.md line 7
Function now raises NotImplementedError but docs say it returns True/False
Fix this? (y/n): y
Generating fix...
Suggested:
The validate_token function validates a token and scope.
Raises NotImplementedError if validation has been removed.
Use AuthService.login() instead.
Apply? (y/n/e): y
✔ Fixed
2 undocumented symbols found
Auto-document all in README? (y/n): y
✔ Generated docs for refresh_token
✔ Generated docs for AuthService
Added 2 new sections to README
Commit now? (y/n): y
Commit message: refactor auth flow
✔ Committed
pip install docdriftThat is it. No cloning. No setup.
export GROQ_API_KEY="your_key_here"👉 Get a free key at https://groq.com — takes 2 minutes.
OR run fully locally — no API key needed:
- LM Studio
- Ollama
🔒 Your code never leaves your machine.
git add .
docdrift commitDocDrift will:
- Scan all changed functions and classes
- Find documentation that is now stale or wrong
- Show each finding with exact file and line number
- Ask if you want to fix it — AI generates the fix
- Auto-document any new undocumented functions
- Commit everything when you approve
docdrift checkdocdrift indexAdd .github/workflows/docdrift.yml to any repo:
name: DocDrift
on:
pull_request:
branches: [main, master]
workflow_dispatch:
jobs:
check-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- name: DocDrift
uses: ayush698800/docwatcher@v2.0.0
with:
groq_api_key: ${{ secrets.GROQ_API_KEY }}Add GROQ_API_KEY to your repo secrets once.
Now every PR gets automatically checked and findings posted as comments. 🔥
pip install docdrift
docdrift-install-hookOr manually:
bash install-hook.sh- ❌ Blocks commits with critical doc errors
⚠️ Allows warnings — no workflow disruption
Skip when needed:
git commit --no-verify -m "message"git diff
↓
Detect changed functions via Tree-sitter
↓
Find related docs via semantic search
↓
AI checks if docs are still accurate
↓
Generate fix → ask permission → apply
↓
Auto-document undocumented symbols
↓
Commit everything
- Changed function signatures with outdated docs
- Incorrect return values or exceptions described wrong
- Missing parameters not mentioned in documentation
- Completely undocumented new functions and classes
- Removed features still described as available
- Python and JavaScript codebases
- Markdown and RST documentation
- README files, /docs folders, inline comments
- GitHub Actions for automatic team-wide PR checks
- LM Studio and Ollama — fully local and private
- Groq — free cloud AI, instant responses
- Tree-sitter — code parsing across languages
- sentence-transformers — semantic documentation search
- ChromaDB — local vector index
- Groq / LM Studio / Ollama — LLM verdicts and fixes
MIT
Bad documentation kills good projects.
DocDrift makes sure your documentation stays as reliable as your code.
PRs, ideas, and feedback are welcome. Let's make documentation actually trustworthy.
If this saved you even one hour — give it a star ⭐

