mirror of
https://github.com/lWolvesl/claw-code.git
synced 2026-04-02 21:41:52 +08:00
Persist CLI conversation history across sessions
The Rust CLI now stores managed sessions under ~/.claude/sessions, records additive session metadata in the canonical JSON transcript, and exposes a /sessions listing alias alongside ID-or-path resume. Inactive oversized sessions are compacted automatically so old transcripts remain resumable without growing unchecked. Constraint: Session JSON must stay backward-compatible with legacy files that lack metadata Constraint: Managed sessions must use a single canonical JSON file per session without new dependencies Rejected: Sidecar metadata/index files | duplicated state and diverged from the requested single-file persistence model Confidence: high Scope-risk: moderate Reversibility: clean Directive: Keep CLI policy in the CLI; only add transcript-adjacent metadata to runtime::Session unless another consumer truly needs more Tested: cargo fmt; cargo clippy --workspace --all-targets -- -D warnings; cargo test --workspace Not-tested: Manual interactive REPL smoke test against the live Anthropic API
This commit is contained in:
@@ -73,7 +73,9 @@ pub use remote::{
|
||||
RemoteSessionContext, UpstreamProxyBootstrap, UpstreamProxyState, DEFAULT_REMOTE_BASE_URL,
|
||||
DEFAULT_SESSION_TOKEN_PATH, DEFAULT_SYSTEM_CA_BUNDLE, NO_PROXY_HOSTS, UPSTREAM_PROXY_ENV_KEYS,
|
||||
};
|
||||
pub use session::{ContentBlock, ConversationMessage, MessageRole, Session, SessionError};
|
||||
pub use session::{
|
||||
ContentBlock, ConversationMessage, MessageRole, Session, SessionError, SessionMetadata,
|
||||
};
|
||||
pub use usage::{
|
||||
format_usd, pricing_for_model, ModelPricing, TokenUsage, UsageCostEstimate, UsageTracker,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user