feat: add tool-level file cache with LRU eviction and mtime invalidation
Introduces FileCache (OrderedDict LRU, st_mtime_ns validation) to avoid redundant disk reads and duplicate content in conversation context. Read tools return a short "[Cached]" message on cache hit instead of resending unchanged file content, saving tokens. Write/edit/delete tools invalidate affected paths; str_replace pre-warms the cache after edits. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -68,6 +68,9 @@ tools:
|
||||
filesystem:
|
||||
max_file_size_bytes: 1048576 # 1 MB
|
||||
binary_detection: true
|
||||
cache:
|
||||
enabled: true
|
||||
max_entries: 128
|
||||
|
||||
session:
|
||||
session_dir: ".sneakycode/sessions"
|
||||
|
||||
Reference in New Issue
Block a user