newlisted
Install: claude install-skill crisandrews/ClawCode
# /new — Start a new session
Save the current session to memory, then mark it as "reset pending" so the next message triggers a fresh greeting (like OpenClaw).
## How this works (architecture)
OpenClaw's `/new` generates a new session ID and runs a greeting prompt on the next turn. In Claude Code, skills CANNOT invoke native `/clear`. Instead, we:
1. **Save** the current session to `memory/YYYY-MM-DD.md`
2. **Write a marker** `.session-reset-pending` with the greeting prompt
3. **Respond** with a brief "new session" acknowledgement
4. **On the next message**, the agent detects the marker, delivers the greeting, deletes the marker
This is the honest simulation of a session reset when native `/clear` is not invokable.
## Steps
1. **Detect surface** (CLI vs messaging).
2. **Summarize the current session** to memory:
```bash
DATE=$(date +%Y-%m-%d)
TIME=$(date +%H:%M)
```
Append to `memory/$DATE.md`:
```markdown
## Session summary (<TIME>) — before /new
- <key point>
- <key point>
### Open items
- <pending>
```
If the session was trivial, skip this step but still do the next one.
3. **Write the reset marker**:
```bash
cat > .session-reset-pending << 'EOF'
A new session was started via /new or /reset. Greet the user in your configured persona, if one is provided. Be yourself - use your defined voice, mannerisms, and mood. Keep it to 1-3 sentences and ask what they want to do. If the runtime model differs f