> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mka1.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Project memory

> Save and approve project preferences for future local coding sessions.

export const ScreenshotCrop = ({src, alt, width, height, x = 0, y = 0, cropWidth = width, cropHeight = height, maxWidth = "100%"}) => <div className="not-prose" style={{
  position: "relative",
  overflow: "hidden",
  width: "100%",
  maxWidth,
  margin: "0 auto",
  aspectRatio: `${cropWidth} / ${cropHeight}`
}}>
    <img src={src} alt={alt} width={width} height={height} style={{
  position: "absolute",
  display: "block",
  margin: 0,
  maxWidth: "none",
  width: `${width / cropWidth * 100}%`,
  height: "auto",
  left: `${-x / cropWidth * 100}%`,
  top: `${-y / cropHeight * 100}%`
}} />
  </div>;

Project memory saves instructions for future sessions in a local project. It is off by default, and you write and approve each preference yourself. For example, you can save a preference to include a regression test whenever the agent fixes a bug.

## Choose what to remember

Use memory for instructions that should hold across tasks in the same project: the test command, a compatibility constraint, or a review convention. Keep a one-off bug report or temporary investigation in its session instead. Enabling memory does not extract preferences from previous conversations; you write and approve the text yourself.

| Preference | Why it is useful |
| - | - |
| “Use the existing test framework. Do not introduce another one for a bug fix.” | Keeps testing conventions consistent. |
| “Explain changes to public function signatures before editing them.” | Makes interface changes explicit. |
| “When a check cannot run, report the command and reason instead of marking it passed.” | Establishes what verification reports should contain. |

Only save instructions that apply to this project. Do not put API keys or passwords in a preference; enabled preferences are sent with model requests.

## Save a project preference

With a verified account signed in, open **Settings → Projects**, select the folder, and turn on **Memory in this project**. Enter a preference, review it, and choose **Approve and save**. Each account and folder has its own preferences; separate worktrees also have separate memory.

For a project with tests, a useful preference names the verification you expect:

> When fixing a bug, add a regression test that reproduces it. Run the relevant tests after the fix and report the command and result.

Keep preferences specific to the project. A saved testing convention can guide future sessions, but you should still inspect the actual test output before accepting a change. To reuse the preference in a separate worktree, configure memory for that folder too.

<Frame caption="An approved project preference asks for a regression test and the actual test result after each bug fix.">
  <ScreenshotCrop src="/images/mka1-code/guides/memory.jpg" alt="Project memory enabled with an approved testing preference" width={2720} height={1800} x={975} y={210} cropWidth={1300} cropHeight={960} maxWidth="100%" />
</Frame>

## Set the default and project override

In **Settings → Projects**, select a listed folder or choose **Add folder…**. This settings selection can differ from the project currently open in Code, so check the folder before saving anything.

Under **All projects**, **Memory by default** controls the initial setting for this account's local projects. Each project's **Memory in this project** has three choices:

| Choice | Effect |
| - | - |
| **Default (On)** or **Default (Off)** | Follows the account default and displays its current value. |
| **On** | Keeps memory enabled for this folder even if the default changes. |
| **Off** | Keeps memory disabled for this folder even if the default changes. |

The default shares an enablement setting, not preference text. A new project has its own empty list. Separate worktree directories also have separate lists.

## Edit or remove preferences

Open the project's memory settings to review its saved preferences and approval dates. Edit a preference and approve it again when a convention changes. Use **Search preferences** when the search field appears for a longer list.

Delete removes one preference. **Clear project memory** removes all preferences for this account and folder after confirmation, without changing whether memory is enabled. Turning memory off preserves the list and lets you review or delete entries; adding or editing requires turning it back on.

A project accepts up to 50 preferences, 2,000 characters per preference, and 12,000 characters of preference text in total. If saving reaches a limit, shorten or remove an entry instead of splitting the same instruction into duplicates.

## How preferences are used

Saved preferences live in the local store and are included in model requests while memory is enabled. Turning memory off keeps the saved preferences but stops adding them to future requests. Earlier conversations retain preference text already sent to them. The feature requires account sign-in and a local project; API-key-only access and remote workspaces do not support it.

### Check which preferences a session uses

If an expected preference is missing, check the signed-in account, gateway, and folder, then inspect the project's effective setting. The same repository opened in a different worktree does not inherit the first folder's preferences.

Changes to memory can interrupt a running local turn; resend the request if needed. Removing a saved preference does not rewrite an old conversation that already contains it. Start a new session when you need to stop carrying that earlier text forward.

Continue with [Sessions and project context](/docs/mka1-code/sessions).
