February 8, 2026

Session Memory (/remember) is coming to Claude Code - try it now with tweakcc

Claude Code's getting memory.

There's a new feature called "Session Memory" in recent versions of Claude Code. It's disabled by default, but with tweakcc you can unlock it and try it out now.

Session Memory automatically generates and maintains a summary.md file in ~/.claude/project for each medium to large conversation. It works by Claude Code first copying template contents to summary.md and then updating it in the background. This summary.md file is so handy that there's an option to make it the starting point for compacted conversations versus the traditional method (more on that below), and there's a new /remember builtin skill that uses it to update CLAUDE.md (more on that too).

Prompts

You can view the full template for summary.md files here (https://github.com/Piebald-AI/claude-code-system-prompts/blob/main/system-prompts/data-session-memory-template.md), but here's some of it:

# Session Title

_A short and distinctive 5-10 word descriptive title for the session. Super info dense, no filler_

# Current State

_What is actively being worked on right now? Pending tasks not yet completed. Immediate next steps._

... so on, through

# Task Specification

# Files and Functions

# Workflows

# Errors & Corrections

# Codebase and System Documentation

# Learnings

# Key results

# Worklog

Claude periodically updates summary.md using these instructions:

IMPORTANT: This message and these instructions are NOT part of the actual user conversation. Do NOT include any references to "note-taking", "session notes extraction", or these update instructions in the notes content.

Based on the user conversation above (EXCLUDING this note-taking instruction message as well as system prompt, claude.md entries, or any past session summaries), update the session notes file.

The file {{notesPath}} has already been read for you. Here are its current contents:
<current_notes_content>
{{currentNotes}}
</current_notes_content>
... 30 more lines ...

When summary.md is created/updated

summary.md is located at ~/.claude/projects/{sanitized-project-path}/{session-id}/session-memory/summary.md, and it's automatically created and updated when the following conditions are met:

  • we're in an interactive session (so, not -p/--prompt)
  • the session has reached certain size thresholds
  • the feature flag is enabled—by default it isn't, but tweakcc patches it to enable it

The size criteria are as follows: creation happens when the session reaches 10k tokens AND 3 tool calls, and periodic updating happens when there have been at least 5k additional tokens AND 3 additional tool calls since creation/last update. These 3 magic constants are hard-coded, but tweakcc lets you set environment variables to configure them—see below. (Aside from tweakcc, the Statsig feature flag tengu_sm_config lets Anthropic change the default values for these constants in response to usage patterns collected via analytics, like many other features.)

Customizing summary.md update thresholds

tweakcc enables to you customize the token and tool call usage requirements for session memory generation by patching CC to support 4 environment variables:

export CC_SM_MINIMUM_MESSAGE_TOKENS_TO_INIT=200  # Tokens before first extraction; defaults to 10000
export CC_SM_MINIMUM_TOKENS_BETWEEN_UPDATE=200   # Tokens between updates;         defaults to 5000
export CC_SM_TOOL_CALLS_BETWEEN_UPDATES=0        # Tool calls between updates;     defaults to 3

# For session memory compaction (see "Session memory compaction" below):
export CC_SM_PER_SECTION_TOKENS=3000             # Max tokens in a single section before warning Claude;           defaults to 2000
export CM_SM_TOTAL_FILE_LIMIT=12000              # Max tokens for the whole summary.md file before warning Claude; defaults to 12000

Just run npx tweakcc@latest --apply, set the variables, and run claude.

Customizing the summary.md template and updating instructions

Claude Code also provides some customization options. While vanilla CC doesn't make those usage requirements configurable, it does provide the ability to specify a custom summary.md template and custom summary.md updating instructions:

  • You can create ~/.claude/session-memory/config/template.md for a custom summary.md template—the file must be comprised of sections starting with # Section Name headers, then an italicized description of the template, under which Claude will write content. CC will parse the file into a list of sections and meter the token count of each (see "Session memory compaction" below).

  • You can also create ~/.claude/session-memory/config/prompt.md for custom session memory updating instructions. It's freeform; write whatever you want there. There are two placeholders you can use:

    • {{notesPath}}, the path to summary.md
    • {{currentNotes}}, the contents of summary.md.

A warning about individual sections being oversized—in addition to the entire file being oversized—may be dynamically appended to whatever you write; see "Session memory compaction" below. One note: if you customize the prompt, tell Claude to use the Edit tool with {{notesPath}} only, because that's the only tool CC allows when it uses the prompt to perform the update.

Compaction of session memory itself

There are hardcoded limits for the size of individual # Header-delimited sections in summary.md as well as the file as a whole. If the total file exceeds 12k tokens, the following is attached to the session memory updating instructions (even if you have custom ones in prompt.md). The "Oversized sections to condense" note is also added if individual sections are larger than 2k token:

CRITICAL: The session memory file is currently ~{totalTokens} tokens, which
exceeds the maximum of 12000 tokens. You MUST condense the file to fit within
this budget. Aggressively shorten oversized sections by removing less important
details, merging related items, and summarizing older entries. Prioritize
keeping "Current State" and "Errors & Corrections" accurate and detailed.

This also gets added to the same prompt if any individual sections are larger than 2k tokens:

Oversized sections to condense:
- "# Section name" is ~3500 tokens (limit: 2000)
- "# Another section" is ~2800 tokens (limit: 2000)

If an individual section is greater than 2k tokens but the file in its entirety is less than 12k, this slightly different note is appended by itself:

IMPORTANT: The following sections exceed the per-section limit and MUST be condensed:
- "# Section name" is ~3500 tokens (limit: 2000)
- "# Another section" is ~2800 tokens (limit: 2000)

Session memory as an alternative strategy to traditional compaction

Session memory is basically a dense list of notes about the current session, so when combined with other aspects of the conversation context like the current TODO list, a few recent messages, and files that the AI read in the session, it can make a good compaction starting point. CC has an ENABLE_CLAUDE_CODE_SM_COMPACT environment variable that you can set to force it enabled. (The tengu_session_memory and tengu_sm_compact feature flags still need to be enabled, though, and for that you currently need tweakcc.) Set DISABLE_CLAUDE_CODE_SM_COMPACT to force-disable it in the same vein.

It's sort of confusing that session memory can be used both as the basis for session compaction and can be compacted itself, but in fact these are two distinct and unrelated concepts.

/remember

There's a new builtin skill triggerable via the /remember slash command. The full skill can be viewed here. It instructs Claude to identify patterns and explicit memory requests in past session files and to update CLAUDE.md (and CLAUDE.local.md) with them.

The skill is not enabled in current CC versions, but you can use tweakcc to enable it: npx tweakcc@latest --apply, claude, /remember.

Piebald

The ultimate agentic AI control experience for developers.



© 2026 Piebald LLC. All rights reserved.

GitHubDiscordX