Skip to content
Skills Library
AI & agents · Automation

save-context

/save-context

Save what this task taught the agent into ~/.knowledge/<repo>/ - implementation, decisions, rejected alternatives, test results and any architecture it had to figure out - so the next session does not re-explore the project. Use at the end of a task before the final report, when a brief says so, or when the user asks to save context. Argument - task ID.

Licence
MIT
Last repository change
05.11.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 05.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Save what this task taught the agent into ~/.knowledge/<repo>/ - implementation, decisions, rejected alternatives, test results and any architecture it had to figure out - so the next session does not re-explore the project. Use at the end of a task before the final report, when a brief says so, or when the user asks to save context. Argument - task ID.

Original author description

Save what this task taught the agent into ~/.knowledge/<repo>/ - implementation, decisions, rejected alternatives, test results and any architecture it had to figure out - so the next session does not re-explore the project. Use at the end of a task before the final report, when a brief says so, or when the user asks to save context. Argument - task ID.

How it works

  1. Steps
Original SKILL.md headings · 53 lines, 408 words
SKILL.md preview
---
name: save-context
description: Save what this task taught the agent into ~/.knowledge/<repo>/ - implementation, decisions, rejected alternatives, test results and any architecture it had to figure out - so the next session does not re-explore the project. Use at the end of a task before the final report, when a brief says so, or when the user asks to save context. Argument - task ID.
---

# Save context

Write only what saves the next session work. No conversation retelling, no raw logs, no secrets, tokens or passwords. Do not duplicate CLAUDE.md, AGENTS.md or the repo's own docs; link to them.

## Steps

1. **Knowledge base.**
   ```bash
   repo=$(basename "$(git rev-parse --show-toplevel)"); K=~/.knowledge/$repo
   ```
   If `~/.knowledge/.git` does not exist: `git -C ~/.knowledge init -q` (create the folder first), and write `~/.knowledge/.gitignore` with `.index.sqlite`.
   If `$K/index.md` does not exist, create it:
   ```markdown
   base: <ref>
   # <repo>
   ```
   `<ref>` = the branch work is merged into: `git symbolic-ref --short refs/remotes/origin/HEAD` (for example `origin/main`); no remote → the local main branch. If the user's team integrates into another branch (`origin/develop`, ...), use that.

2. **Task: `$K/tasks/<ID>.md`.** ID = the argument, otherwise the current branch if it looks like a ticket (`[A-Z]+-\d+`), otherwise `YYYY-MM-DD-<slug>`. If the file is missing, create it with `# <ID>: <title>` and, if no brief was saved before, a `## Brief` section with the requirements and decisions you were given. Append:
   - `## Implementation` (first time) or `## Revision <YYYY-MM-DD>` (when `## Implementation` already exists):
     - **Done**: 2-5 bullets;
     - **Files**: changed paths, one line each, "path: what changed";
     - **Decisions**: what was chosen and why; **rejected**: alternative and reason;
     - **Verification**: tests/commands run and their result;
     - **Open**: anything unresolved, what to look at in later revisions.
   Do not rewrite an existing `## Brief`.

3. **Architecture: `$K/architecture/<area>.md`.** One per area you had to explore in this task and where you learned something non-obvious (not what a file name tells in five seconds). Update an existing note rather than adding a duplicate. Format, at most ~80 lines:
   ```markdown
   ---
   paths: [src/auth/, src/middleware/token.rs]
   verified_at: <sha>
   ---
   # <Area>
   ## Purpose
   ## Where things are
   ## Connections
   ## Gotchas
   ```
   `verified_at` = `git merge-base HEAD <base>`. `paths` = only what the note actually describes.

4. **Decisions: `$K/decisions/NNNN-<slug>.md`**, only for a rule future tasks must follow ("all validators are built this way"). One-off decisions stay in the task file. Format: context, decision, why, rejected.

5. **Index.** `$K/index.md` holds one line per file: `- [path] - what it covers, one phrase`. Update lines of changed files, add new ones. For tasks, end the line with a status (`implemented`, `revised YYYY-MM-DD`).

6. **Commit** (to the knowledge repo only; the work repo's commit rules are unaffected):
   ```bash
   git -C ~/.knowledge add -A && git -C ~/.knowledge commit -qm "<repo> <ID>: <summary>"
   ```

The search index rebuilds itself on the next `restore-context`.

Versions

RepositoryScoreLicence
This page · Deliveos/fresh-context100MIT
mutlumehmet/claude-plugins100MIT

Database snapshot: 13.11.2026 · package version 5120b9967a0d (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 96context-management-context-save
    Use when working with context management context save
  • 100context-management-context-save
    Capture and serialize project state, architectural decisions, and working context. Use when preserving knowledge for later sessions, handoffs, or searchable context retrieval.
  • 100save
    Write a handoff document that lets a fresh Claude session (cold context, any model) continue the current work. Captures the mission, the user's latest request verbatim, state, decisions, dead ends, constraints, open questions and exact next steps, plus git state read from the…
  • 96context-management-context-save
    Use when working with context management context save
  • 96context-management-context-save
    Use when working with context management context save
  • 100save-clear
    End-of-session ritual. Saves persistent memory and a verified SESSION-SUMMARY snapshot, arms the auto-resume, and (in "save and clear" mode) clears the context by itself so the next session starts from the summary. Use whenever the user says "save and clear", "save-clear",…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.