You need to store your Claude prompts and responses NOW!
YOU NEED TO STORE YOUR LLM PROMPTS AND RESPONSES NOW
There, I said it and I will say it again.
YOU NEED TO STORE YOUR LLM PROMPTS AND RESPONSES NOW
And I will say it as many times as I need to. But we all need to start performing this. We do not know when frontier models will stop being available to the general public. Corporate greed, ROI concerns and many more factors can stop the best models from being provided to the public. And we cannot understimate the power of having stored tokens from these models.
With these tokens, we are setting ourselves up for the future and removing our dependency from the big AI giants. The benefits are incredible. We are going to have; A full traceback of all plans and code written by Claude. A very usable and reliable token database to make MCP tools out of. And the exciting, bubbling, SAUCE, that I can't stop giggling about. With these tokens we can be ready for a specialized distilled coding assistant that codes the way you like it. Now this will not be all the steps required to distil a truly personal coding asistant. But if you are a bear... You might as well do your job in the woods.
This blog example, will be specific to how I attained this with Claude Code. Opus and Sonnet 4.6 are by far, the best coder models on a raw input and output tokens perspective. But with a forward proxy, there will always be a manner to perform this. No matter your AI provider.
For the solution I am sticking with, I do not use a proxy, so I only store the prompt and response. If you wanted all in between prompts, then I would recommend going the forward proxy route, but I believe I only need these. So with Claude Code, on VSCode, I decided to add hooks on my .claude config:
// ~/.claude/settings.json
{
"hooks": {
"UserPromptSubmit": [{
"matcher": ".*",
"hooks": [{ "type": "command", "command": "python3 /mnt/nas/claude-logs/hooks/log_event.py UserPromptSubmit" }]
}],
"PostToolUse": [{
"matcher": ".*",
"hooks": [{ "type": "command", "command": "python3 /mnt/nas/claude-logs/hooks/log_event.py PostToolUse" }]
}],
"Stop": [{
"matcher": ".*",
"hooks": [{ "type": "command", "command": "python3 /mnt/nas/claude-logs/hooks/log_event.py Stop" }]
}]
}
}
Then with python script log_event.py.
## log_event.py
import json, sys, datetime, pathlib
event_type = sys.argv[1]
event = json.load(sys.stdin)
log_dir = pathlib.Path("/mnt/nas/claude-logs") # your NAS mount
log_dir.mkdir(parents=True, exist_ok=True)
with open(log_dir / "events.jsonl", "a") as f:
f.write(json.dumps({
"timestamp": datetime.datetime.utcnow().isoformat(),
"event_type": event_type,
**event
}) + "\n")
All of this is fully vibe-coded, revise before using.
Then the only thing left was to mount my nas on my desired path. Using nfs-common I added to /etc/fstab:
## /etc/fstab
...
<NAS_IP>:/volume/<shared-folder-name> /mnt/nas/claude-logs nfs defaults,_netdev,nofail,timeo=30,retry=2 0 0
If you dont have a NAS available, you can store it on the host itself, or something like s3fs is a great solution for this.
And that will be it! Now to test a claude code prompt, the events.jsonl file will fill up with something like:
{"timestamp": "2026-03-19T21:59:14.815632", "event_type": "UserPromptSubmit", "permission_mode": "default", "hook_event_name": "UserPromptSubmit", "prompt": "<ide_opened_file>The user opened the file <filename> in the IDE. This may or may not be related to the current task.</ide_opened_file>\nhello!"}
{"timestamp": "2026-03-19T21:59:16.956792", "event_type": "Stop", "permission_mode": "default", "hook_event_name": "Stop", "stop_hook_active": false, "last_assistant_message": "Hello! How can I help you today?"}
The rest of the data engineering and wrangling can come in later. I believe that this keeps us on the safer side of history, in this data hungry world.