# How Long Does Caveman Level Selection Persist?

> Discover how long Caveman level selection persists. It remains active for your current session until you change intensity or end it.

- Repository: [Julius Brussee/caveman](https://github.com/JuliusBrussee/caveman)
- Tags: faq
- Published: 2026-07-09

---

**Caveman level selection persists for the entire duration of the current session, remaining active until you explicitly change the intensity level or terminate the session.**

When using the JuliusBrussee/caveman open-source tool, understanding how long your selected intensity level remains active is crucial for workflow management. The persistence behavior of Caveman level selection is explicitly defined in the source code, ensuring predictable behavior across terminal sessions and script executions.

## Session-Based Persistence Behavior

The selected intensity level (e.g., **lite**, **full**, or **ultra**) remains bound to the current runtime session. According to the source code in [`src/hooks/caveman-mode-tracker.js`](https://github.com/JuliusBrussee/caveman/blob/main/src/hooks/caveman-mode-tracker.js), the level persists until changed or the session ends. This means once activated, the mode continues processing at your specified intensity without requiring re-selection.

### Technical Implementation Details

In [`src/hooks/caveman-mode-tracker.js`](https://github.com/JuliusBrussee/caveman/blob/main/src/hooks/caveman-mode-tracker.js) at line 102, the code explicitly documents this behavior with the comment: "Level persist until changed or session end". Similarly, [`src/hooks/caveman-activate.js`](https://github.com/JuliusBrussee/caveman/blob/main/src/hooks/caveman-activate.js) at line 139 reinforces this rule, ensuring consistency across the activation pipeline.

## Where Persistence Is Defined in the Source Code

Understanding where this persistence is enforced helps when debugging or extending the functionality.

### Mode Tracker Hook

The primary tracking logic resides in [`src/hooks/caveman-mode-tracker.js`](https://github.com/JuliusBrussee/caveman/blob/main/src/hooks/caveman-mode-tracker.js). This file monitors the active Caveman mode and enforces the persistence rules throughout the session lifecycle.

### Activation Hook

The [`src/hooks/caveman-activate.js`](https://github.com/JuliusBrussee/caveman/blob/main/src/hooks/caveman-activate.js) file handles the initial activation messages and validates that the level remains constant once selected, displaying the persistent state to the user.

### Initialization Interface

User selection occurs through [`src/tools/caveman-init.js`](https://github.com/JuliusBrussee/caveman/blob/main/src/tools/caveman-init.js), which provides the command-line interface for choosing between available intensity levels before the persistence mechanism takes effect.

## Practical Usage Examples

When integrating Caveman into your workflow, the session-based persistence behaves as follows:

```javascript
// Activate "ultra" level at session start
process.stdout.write('CAVEMAN MODE ACTIVE — level: ultra. ...');

// Level remains "ultra" for all subsequent operations
// ...

// Switch to "lite" level mid-session
process.stdout.write('CAVEMAN MODE ACTIVE — level: lite. ...');

// New level persists until session termination or next change

```

## Summary

- Caveman level selection persists for the entire duration of the current session
- The active level remains unchanged until explicitly modified or the session terminates
- Persistence logic is documented in [`src/hooks/caveman-mode-tracker.js`](https://github.com/JuliusBrussee/caveman/blob/main/src/hooks/caveman-mode-tracker.js) and [`src/hooks/caveman-activate.js`](https://github.com/JuliusBrussee/caveman/blob/main/src/hooks/caveman-activate.js)
- Level selection occurs via [`src/tools/caveman-init.js`](https://github.com/JuliusBrussee/caveman/blob/main/src/tools/caveman-init.js) but survives for the session lifetime

## Frequently Asked Questions

### How long does Caveman level selection persist?

Caveman level selection persists for the entire duration of the current session. The selected intensity level remains active until you explicitly change it to a different level or terminate the session entirely.

### Where is the persistence logic implemented in the source code?

The persistence logic is implemented in [`src/hooks/caveman-mode-tracker.js`](https://github.com/JuliusBrussee/caveman/blob/main/src/hooks/caveman-mode-tracker.js) at line 102, with additional confirmation in [`src/hooks/caveman-activate.js`](https://github.com/JuliusBrussee/caveman/blob/main/src/hooks/caveman-activate.js) at line 139. Both files contain explicit comments stating "Level persist until changed or session end".

### Can I change the Caveman level without restarting my session?

Yes, you can change the Caveman level mid-session by activating a different intensity level. The new selection immediately replaces the previous level and persists for the remainder of the current session or until changed again.

### Does Caveman remember my level preference between different sessions?

No, Caveman does not persist level selection between sessions. Each new session starts without an active level, requiring you to select your desired intensity via [`src/tools/caveman-init.js`](https://github.com/JuliusBrussee/caveman/blob/main/src/tools/caveman-init.js) or equivalent activation methods.