---
name: "refresh-context"
description: "Refreshes the Core Context snapshot, agent context about the owner: re-reads its registered sources, diffs them and applies changes on the owner's yes. Use when the owner's role, reuse axes, philosophy or registered sources changed, or status or lint reports the snapshot stale. Not for editing Me or vault policy; reporting its age belongs to status."
license: MIT
title: refresh-context
canonical_url: https://skilld.dev/gh/goberomsu/secondbrain-skills/refresh-context
last_updated: 2026-11-18T15:15:25.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> If the user asked to install this Skill, run `npx skilld install goberomsu/secondbrain-skills/refresh-context`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/refresh-context`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/goberomsu/secondbrain-skills/refresh-context) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/refresh-context`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/refresh-context --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/refresh-context --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Refresh Context

[[Core Context]] is the owner's **snapshot** — who they are at a point in time: §1 identity and continuity statement, §2 reuse axes, §3 frameworks, §4 philosophy, §5 registered source references. When the owner's thinking develops, or a registered source changes, the snapshot must follow. Every `ingest` purpose question and every `query` answer is tailored to it, so a stale snapshot quietly bends all later work. The sources stay the truth; this skill brings the snapshot back in line with them and nothing more.

The note is usually `Core Context.md`, sometimes a derived file such as `90. Settings/Derived/agent-context.md`; use the one the vault's AGENTS file names.

## When to Run

- `lint` or `status` flags "Core Context > 30 days old", or a later change to a source it lists, or registered-source drift.
- A registered system file changed version, precedence, folders or roles.
- The owner published a new essay or manifesto — §4 philosophy may need updating.
- A reuse axis (§2) was added, dropped or renamed, or the owner's role changed.
- The continuity statement (§1) needs updating, or the owner asks.

A snapshot that is old but whose sources have not changed needs only its date checked, not a rewrite; say so.

## Step 1: Load Current Core Context

Read the note in full: `snapshot_date`, `version`, the `source` list, and §1–§5. This is the "before" side of the diff.

## Step 2: Re-Read Registered System Files

Read, read-only, each system file the Core Context actually registers (§5 table and `source`); there is no fixed list or file count. For each, capture:

- `version` — bumped?
- date modified — newer than the snapshot? With Git: `git log --since="$SNAPSHOT_DATE" --oneline -- <files>`.
- the first changelog entry — what changed?
- whether the change touches the §5 table: precedence, audience, focus, memory type.

No system file registered: skip and say so. A registered file missing on disk is reported and the run carries on.

## Step 3: Re-Read Personal Essays

Re-read every essay in the frontmatter `source` list in full. Then scan for **new** essays from the last 60 days in the essay location §5 names (`find "$ESSAYS" -name '*.md' -mtime -60`, or `qmd` for recent writing). New essays are candidates, not sources: summarize each in one line and let the owner decide. Do not add sources by guessing from folder names; if none can be identified, ask.

## Step 3-b: (optional) Scan Recent Permanent Notes

Scan, read-only, the Permanent Notes folder the Core Context registers for notes modified in the last 60 days (`find "$PERMANENT" -name '*.md' -mtime -60`, or `git log --since="60 days ago" --name-only -- "$PERMANENT"`). They are evidence of philosophy drift for §3/§4, not new `source` entries: quote the line behind each proposed change in Step 4. No Permanent Notes folder registered: skip and say so; never guess one from folder names.

## Step 4: Diff & Propose

Show side by side, section by section:

- **Current Core Context** (§1–§4 core sections, §5 when touched);
- **Proposed updates**, each with the source line behind it;
- **New essays** discovered, one-line summary each, asking whether to promote them into §4 philosophy and `source`;
- **Permanent Notes drift** from Step 3-b, one line per note with the claim it supports.

Owner judgment on top:

- Every proposed claim traces to a source just read; anything untraceable stays out. Never fill a section from names, paths or an older snapshot.
- Keep the owner's own wording where it still holds. Refreshing is not rephrasing.
- Reuse axes are the ones registered in §2 (normally 5–9, never a fixed list) and the owner's to define; propose a change only when a source states it, and flag that later `ingest` purposes and `query` answers will shift.

Ask: **"Apply this diff? (all / part / reject)"** — in the owner's language. Reject, or no answer, writes nothing, including no log entry.

## Step 5: Apply

If approved, edit only the approved sections and leave the rest of the file byte-for-byte. Set `snapshot_date` and `date_modified` to today, add approved essays to `source`, bump `version` (minor for §2/§4/§5 changes, major for a restructure). A later proposal needs its own OK. Read the note back.

## Step 6: Log

When writes were approved, append to the wiki log in [records](../ingest/references/records.md) (append-only; never rewrite earlier entries):

```markdown
## [YYYY-MM-DD] update | Core Context refreshed (v<old> → v<new>)

- Source drift: <files changed since the last snapshot, or none>
- New essays incorporated: <titles, or none>
- Updated sections: <§2 / §4 / §5 …>
- Why: <one line>
```

Git history does not replace this entry. Do not commit or push; commit only when the owner asks separately.

## Output

1. **Snapshot age**: was N days, now 0 (or unchanged, and why).
2. **Changes applied**: one line per section changed; sections left as they were.
3. **Source drift**: files changed since the last snapshot and recent Permanent Notes used as evidence, or not configured.
4. **New essays added to source**: count and titles.
5. **Version bump**: old → new.

Never edit Me, AGENTS, policy notes, user instructions, qmd configuration or runtime profiles from here; if a source looks wrong, tell the owner. Do not publish the snapshot.

Tools: `rg`, `qmd`, `git` (read-only).
