Index a single file incrementally
Update a single file in the semantic memory index with hash-based change detection. Use after editing a file to ensure the index is current, or to debug indexing issues.
/plugin marketplace add squirrelsoft-dev/infinite-memory/plugin install infinite-memory@squirrelsoft-dev-toolsUpdate a single file in the semantic memory index. Uses hash-based change detection to skip unchanged files.
Get the file path:
realpath if needed)Validate the file path:
test -f "$FILE_PATH"Call the index_file MCP tool:
force_update: false by default (respects hash-based skip)Report result to user:
New file (inserted):
✅ File indexed: /path/to/file.py
- Operation: inserted
- Hash: a3f2d1...
- Size: 1,234 bytes
Updated file (hash changed):
✅ File re-indexed: /path/to/file.py
- Operation: updated
- Hash: b5e7c2... (changed)
- Previous: a3f2d1...
Unchanged file (skipped):
ℹ️ File unchanged: /path/to/file.py
- Operation: skipped
- Reason: Content hash matches existing index
- Last indexed: 2 hours ago
With explicit path:
User: /index-file /Users/me/projects/myapp/auth.py
✅ File re-indexed: auth.py
- Operation: updated
- Hash: b5e7c2...
Without path (current file):
User: /index-file
✅ File indexed: server.py
- Operation: inserted
- Hash: a3f2d1...
/index-file --force to re-index even if unchangedTo re-index even if content hash unchanged:
User: /index-file /path/to/file.py --force
✅ File re-indexed (forced): file.py
- Operation: updated
- Reason: Force update requested
Use cases for force update:
File not found:
❌ Error: File not found
Path: /path/to/missing.py
Suggestion: Check file path is correct and file exists
Unsupported file type:
❌ Error: Unsupported file type
File: /path/to/image.png
Extension: .png
Supported: .py, .js, .ts, .md, .txt, .json, .yaml, .yml
Permission denied:
❌ Error: Permission denied
File: /etc/sensitive.py
Reason: Cannot read file (check permissions)
index_file MCP tool