<command-name>/model</command-name> <command-message>model</command-message>…
- User
/model model sonnet
- User
in claude code, when I "/clear", is the session history still kept in the session .json file in .claude/ ?
Assistant
This is a factual question about Claude Code's internals — let me get an authoritative answer rather than guessing.
Assistant
I've dispatched a check against Anthropic's official docs to verify this rather than rely on assumptions. I'll report back once it completes.
Assistant
Good, found real
/clearinvocations within session files. Let me inspect one to see exactly what's written before/after.Assistant
Verified directly from your session files (not just docs). Confirmed empirically in
d070adb5-...jsonl:/cleardoes not touch the on-disk JSONL file, and does not start a new session file.- The entire file — before and after
/clear— has a singlesessionIdthroughout. - The
/clearinvocation is just recorded as an ordinary entry (<command-name>/clear</command-name>), followed by asystem/local_commandentry. - The next real message afterward has
parentUuidpointing straight at thatlocal_commandentry — same linked conversation tree, no fresh root, no new file.
So
/clearonly resets what gets sent to the model going forward (the in-context history). Everything before the clear stays in the same.jsonltranscript on disk, fully intact and linked — it's just no longer fed into subsequent API calls. (This contradicts the general docs phrasing "starts a new session" in a stricter sense — no new session ID/file is created; it's the same file, same session, just a context-window reset going forward.)- The entire file — before and after
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.