codify

Harvests session insights and codifies them as atomic entries in CLAUDE.md.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/cjennings/rulesets --skill codify-cjennings
Or copy as Structured Prompt for Agentβ–Ό
Please help me install this Agent Skill.
Skill: codify
Source: https://github.com/cjennings/rulesets/tree/main/codify
Command: npx skills add https://github.com/cjennings/rulesets --skill codify-cjennings

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Codify concrete, actionable insights from recent session work into CLAUDE.md so they survive across sessions and compound over time. Harvests patterns that worked, anti-patterns that bit, API gotchas, specific thresholds, and verification checks. Writes into a dedicated ## Codified Insights section rather than scattering entries. Use after a productive session, a bug fix that revealed a non-obvious pattern, or an explicit review where you want learnings preserved as rules. Supports --dry-run to preview, --max=N to cap output, --target=<path> to write elsewhere, --section=<name> to override the destination section. Flags insights that look cross-project and suggests promotion to ~/code/rulesets/claude-rules/ instead. Do NOT use for session wrap-up / progress summaries (not insights), for private personal context (auto-memory handles that, not a tracked file), or for formal rules that belong in .claude/rules/. Informed by Agentic Context Engineering (ACE, arXiv:2510.04618) β€” grow-and-refine without context collapse.

When to Use

  • End of a productive session where you want concrete patterns preserved
  • After a bug fix that revealed a non-obvious constraint or gotcha
  • After a review where a pattern was identified as worth repeating (or avoiding)
  • When you notice yourself re-deriving the same insight β€” it belongs written down

When NOT to Use

  • For a session wrap-up summary (that's narrative, not an insight)
  • For personal/private context (auto-memory at ~/.claude/projects/<cwd>/memory/ captures that β€” see below)
  • For formal project rules β€” those belong in .claude/rules/*.md
  • When you have no specific, evidence-backed insight yet β€” skip

Relationship to Other Memory Systems

Three distinct systems, zero overlap:

| System | Location | Scope | Purpose | |---|---|---|---| | auto-memory | ~/.claude/projects/<cwd>/memory/ | Private, per-working-directory | Session-bridging context about the user and project (feedback, user traits, project state). Written continuously by the agent. | | /codify (this skill) | Project CLAUDE.md | Public, tracked, per-project | Explicit, curated rules and patterns. Written deliberately by the user invocation. | | Formal rules | .claude/rules/*.md, ~/code/rulesets/claude-rules/ | Public, tracked, per-project or global | Stable policy (style, conventions, verification). Authored once, rarely updated. |

Workflow

Four phases. Each can be skipped if it has no content; none should be silently merged.

Phase 1 β€” Harvest

Identify candidate insights from recent work. Look at:

  • The session transcript (or files referenced by --source)
  • Recent commits and their messages
  • Any .architecture/evaluation-*.md from arch-evaluate
  • Reflection or critique outputs if they exist
  • Anti-patterns you caught yourself falling into

Extract only:

  • Patterns that worked β€” preferably with a minimum precondition and a worked example or reference
  • Anti-patterns that bit β€” with the observable symptom and the reason
  • API / tool gotchas β€” auth quirks, rate limits, idempotency, error codes
  • Verification items β€” concrete checks that would catch regressions next time
  • Specific thresholds β€” "pagination above 50 items" not "pagination when needed"

Exclude:

  • Progress narrative ("today we shipped X")
  • Personal preferences ("I like functional style")
  • Vague aphorisms ("write good code")
  • Unverified claims (if you can't cite code, docs, or repeated observation, skip)

Phase 2 β€” Filter (Grow-and-Refine)

For each candidate insight, apply these gates. Fail any β†’ drop the entry.

  • Actionable. A reader could apply this immediately. "Write good code" fails; "For dataset lookups under ~100 items, Object outperforms Map in V8" passes.
  • Specific. Names a threshold, a file, a flow, a version, or a named tool. Generic insights are noise.
  • Evidence-backed. Derived from code you just read, docs you just verified, or a pattern observed more than once. Speculation doesn't count.
  • Atomic. One idea per bullet. If the insight has two distinct parts, it's two bullets.
  • Non-redundant. Check existing CLAUDE.md content. If something similar exists, prefer merging or skipping over duplicating. If the new one is genuinely more specific and evidence-backed than the existing one, append it and mark the older one with (candidate for consolidation) β€” don't auto-delete prior user content.
  • Safe. No secrets, tokens, private URLs, or PII. Nothing that would leak in a public commit.
  • Stable. Prefer patterns that'll remain valid. If version-specific, say so.

Phase 3 β€” Write

Write approved insights to a dedicated section of CLAUDE.md. Default section name: ## Codified Insights. Override with --section=<name>.

Discipline:

  • One section only. Don't scatter entries across CLAUDE.md. All codified content in one place means future /codify runs and human readers find it fast.
  • Create the section if absent. Place it near the end of CLAUDE.md, before any footer links.
  • Preserve chronology within the section. Newer entries appended; don't shuffle.
  • Include provenance. Each entry gets a date and, where useful, a one-word source hint (pattern:, gotcha:, threshold:, anti-pattern:, verify:).

Entry format:

  • <short title or rule>. <One or two sentences. Concrete. Actionable.> (<source-hint> β€” YYYY-MM-DD)

Phase 4 β€” Validate

After writing, check:

  • [ ] Every entry passed all Phase 2 gates
  • [ ] Each entry is atomic (one idea)
  • [ ] No near-duplicates were created
  • [ ] The ## Codified Insights section is coherent β€” entries flow, categories aren't interleaved randomly

Cross-Project Promotion

Some insights apply to all your projects, not just this one. Examples:

  • "Always emit JSON with a stable key order for git diffs"
  • "For TypeScript libraries, expose types via package.json#exports"

Arguments

  • --dry-run β€” show the proposed entries and where they'd be written; do not modify any files.
  • --max=N β€” cap output to the top N insights by specificity + evidence.
  • --target=<path> β€” write to a different file. Defaults to ./CLAUDE.md. Use e.g. docs/learnings.md if the project prefers a separate file.
  • --section=<name> β€” override the default ## Codified Insights section name.
  • --source=<spec> β€” scope what gets harvested. Values: last (most recent message), selection (a user-highlighted region if supported), chat:<id> (a specific past conversation), commits:<range> (e.g., commits:HEAD~10..). Defaults to a reasonable window of recent session context.

Output

  • On a real run (not --dry-run):
  • Short summary β€” "added N entries to <target>: X patterns, Y gotchas, Z thresholds."
  • Promotion candidates flagged for global-rules consideration.
  • Confirmation of the file path modified.

Anti-Patterns

  • List of anti-patterns etc.

Review Checklist

  • [ ] etc.

Maintenance

  • info

Theoretical Background

  • info

The description should reflect actual content; We'll keep as above.

And so on.

The final.

Run.

Frequently Asked Questions about codify

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I save session insights and patterns into CLAUDE.md?β–Ό

Codify harvested session insights by converting them into durable, atomic entries within a dedicated Codified Insights section of CLAUDE.md. It extracts patterns, anti-patterns, and API gotchas, writing evidence-backed rules that persist across sessions.

What's the best way to document API gotchas and verification checks from a coding session?β–Ό

Document API gotchas and verification checks by running a codify process that filters recent session work for actionable, specific, and evidence-backed insights. It writes these rules to a tracked file, ensuring cross-session reliability without cluttering formal rules directories.

Does codify work with existing formal rules in .claude/rules/?β–Ό

Codify deliberately avoids formal rules stored in .claude/rules/*.md. It targets curated patterns and learnings for CLAUDE.md, keeping stable policy separate from session-derived insights. It also flags cross-project insights for promotion to global rulesets.

How to preview codified insights before writing to a project file?β–Ό

Preview codified insights by running the process with the --dry-run flag. This shows the proposed entries and their target destination section without modifying any files, allowing you to validate the atomic rules before committing them to the repository.

When should I not use CLAUDE.md for saving session context?β–Ό

Do not use codify for session wrap-up summaries, private personal context, or formal project rules. Narrative progress belongs in chat history, private context uses auto-memory, and stable conventions belong in .claude/rules/.

Can I cap the number of insights written to CLAUDE.md?β–Ό

Cap the output insights by using the --max=N argument, which limits the entries to the top N insights ranked by specificity and evidence. You can also use --target=<path> to write to a different file or --section=<name> to override the destination heading.