[FEATURE] User-designated pinned files with extended cache duration
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
Current 5-minute prompt cache expires too quickly for iterative development workflows, causing:
- Repeated re-tokenization of frequently accessed files
- Increased token costs for users
- Unnecessary CPU/bandwidth usage for Anthropic's infrastructure
Benefits
For Users:
Lower token costs on frequently modified files
Faster response times (no re-processing)
Better workflow for iterative development
For Anthropic:
Reduced CPU usage (less re-tokenization)
Lower bandwidth (files stay in memory)
Predictable infrastructure costs
Use Case
Working on a SwiftUI app where ContentView.swift is modified 10+ times in 30 minutes. Currently requires re-caching 6+ times. With pinning: cache once, use throughout session. after 30 minutes recach is needed
Proposed Solution
Allow users to designate 2-3 "pinned" files with extended cache (15-30 minutes):
Option 1: Via .claude/claude.md
## Pinned Files
- src/ContentView.swift
- src/Model.swift
**Option 1: claude --pin file1.swift --pin file2.swift
### Alternative Solutions
_No response_
### Priority
Critical - Blocking my work
### Feature Category
CLI commands and flags
### Use Case Example
_No response_
### Additional Context
_No response_This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗