[Feature Request] Add configurable prompt cache TTL extension for multi-session persistence
Status Closed — duplicate
Reported on v2.1.77
Maintainer reply None cached
Activity 3 comments · opened Mar 17, 2026 · closed Mar 21, 2026
Bug Description
It would be really cool if there was an option to extend the claude code CLI time to live of the cache... At least 1 or 2 sessions worth. So a user can automate daily sessions that start pre loaded and ready to go
Environment Info
- Platform: win32
- Terminal: windows-terminal
- Version: 2.1.77
- Feedback ID: acb082dc-2f4f-4390-a262-6c55aa3c79a7
Errors
[{"error":"ENOENT: no such file or directory, unlink 'C:\\Users\\lboucher\\AppData\\Local\\Temp\\claude\\C--GitHub-JLS-Timesheet-Helper\\a3a3c3d3-710a-47e1-be14-cf418aad0286\\tasks\\a1e12bcbd5d645962.output'","timestamp":"2026-03-17T22:38:41.178Z"},{"error":"Error: Failed to create shell snapshot: Command failed: C:\\Program Files\\Git\\bin\\bash.exe -c -l SNAPSHOT_FILE='C:\\Users\\lboucher\\.claude\\shell-snapshots\\snapshot-bash-1773787139368-2ol7tu.sh'\n source \"C:\\Users\\lboucher\\.bashrc\" < /dev/null\n\n # First, create/clear the snapshot file\n echo \"# Snapshot file\" >| \"$SNAPSHOT_FILE\"\n\n # When this file is sourced, we first unalias to avoid conflicts\n # This is necessary because aliases get \"frozen\" inside function definitions at definition time,\n # which can cause unexpected behavior when functions use commands that conflict with aliases\n echo \"# Unset all aliases to avoid conflicts with functions\" >> \"$SNAPSHOT_FILE\"\n echo \"unalias -a 2>/dev/null || true\" >> \"$SNAPSHOT_FILE\"\n\n \n echo \"# Functions\" >> \"$SNAPSHOT_FILE\"\n\n # Force autoload all functions first\n declare -f > /dev/null 2>&1\n\n # Now get user function names - filter completion functions (single underscore prefix)\n # but keep double-underscore helpers (e.g. __zsh_like_cd from mise, __pyenv_init)\n declare -F | cut -d' ' -f3 | grep -vE '^_[^_]' | while read func; do\n # Encode the function to base64, preserving all special characters\n encoded_func=$(declare -f \"$func\" | base64 )\n # Write the function definition to the snapshot\n echo \"eval \\\"\\$(echo '$encoded_func' | base64 -d)\\\" > /dev/null 2>&1\" >> \"$SNAPSHOT_FILE\"\n done\n \n echo \"# Shell Options\" >> \"$SNAPSHOT_FILE\"\n shopt -p | head -n 1000 >> \"$SNAPSHOT_FILE\"\n set -o | grep \"on\" | awk '{print \"set -o \" $1}' | head -n 1000 >> \"$SNAPSHOT_FILE\"\n echo \"shopt -s expand_aliases\" >> \"$SNAPSHOT_FILE\"\n \n echo \"# Aliases\" >> \"$SNAPSHOT_FILE\"\n # Filter out winpty aliases on Windows to avoid \"stdin is not a tty\" errors\n # Git Bash automatically creates aliases like \"alias node='winpty node.exe'\" for\n # programs that need Win32 Console in mintty, but winpty fails when there's no TTY\n if [[ \"$OSTYPE\" == \"msys\" ]] || [[ \"$OSTYPE\" == \"cygwin\" ]]; then\n alias | grep -v \"='winpty \" | sed 's/^alias //g' | sed 's/^/alias -- /' | head -n 1000 >> \"$SNAPSHOT_FILE\"\n else\n alias | sed 's/^alias //g' | sed 's/^/alias -- /' | head -n 1000 >> \"$SNAPSHOT_FILE\"\n fi\n \n\n \n # Check for rg availability\n echo \"# Check for rg availability\" >> \"$SNAPSHOT_FILE\"\n echo \"if ! (unalias rg 2>/dev/null; command -v rg) >/dev/null 2>&1; then\" >> \"$SNAPSHOT_FILE\"\n \n cat >> \"$SNAPSHOT_FILE\" << 'RIPGREP_FUNC_END'\n function rg {\n if [[ -n $ZSH_VERSION ]]; then\n ARGV0=rg 'C:\\Users\\lboucher\\.local\\bin\\claude.exe' \"$@\"\n elif [[ \"$OSTYPE\" == \"msys\" ]] || [[ \"$OSTYPE\" == \"cygwin\" ]] || [[ \"$OSTYPE\" == \"win32\" ]]; then\n ARGV0=rg 'C:\\Users\\lboucher\\.local\\bin\\claude.exe' \"$@\"\n elif [[ $BASHPID != $$ ]]; then\n exec -a rg 'C:\\Users\\lboucher\\.local\\bin\\claude.exe' \"$@\"\n else\n (exec -a rg 'C:\\Users\\lboucher\\.local\\bin\\claude.exe' \"$@\")\n fi\n}\nRIPGREP_FUNC_END\n \n echo \"fi\" >> \"$SNAPSHOT_FILE\"\n \n\n # Add PATH to the file\n echo \"export PATH=\\$PATH\" >> \"$SNAPSHOT_FILE\"\n \n\n # Exit silently on success, only report errors\n if [ ! -f \"$SNAPSHOT_…
Note: Content was truncated.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗