Skip to content

Instantly share code, notes, and snippets.

@alejandrolechuga
Created May 8, 2026 15:44
Show Gist options
  • Select an option

  • Save alejandrolechuga/caab1a5ae446c73c10d05a206ebe50a8 to your computer and use it in GitHub Desktop.

Select an option

Save alejandrolechuga/caab1a5ae446c73c10d05a206ebe50a8 to your computer and use it in GitHub Desktop.
capture-context Skill — Design & Implementation

capture-context Skill — Design & Implementation

A new Claude Code skill that captures a session's research or investigation into a structured markdown document and publishes it as a private GitHub Gist. Designed to be triggered naturally mid-session with minimal friction.

Background

Needed a way to preserve Claude session findings — investigations, research results, design decisions — into a shareable artifact without manually writing it up. The output should be self-contained enough for a teammate to read cold.

Findings

Skill: /capture-context

Workflow:

  1. Identify scope — if one clear thread, proceeds silently; if multiple threads, lists them and asks which to include; if ambiguous, asks one clarifying question
  2. Check git state — includes a Code Changes section if files were modified during the session, omits it if not
  3. Generate doc — structured markdown: TL;DR → Background → Investigation → Findings → Code Changes → Key Decisions → Open Questions → Next Steps → Relevant Files
  4. Confirm — shows the doc and asks for corrections before publishing
  5. Visibility — asks private or public, defaults to private
  6. Publish — creates gist via gh gist create, returns the URL
  7. Cleanup — removes the temp file after publishing

Key Decisions

  • Default private — gist is only accessible via link unless user explicitly opts into public
  • Self-contained output — doc avoids "as discussed" references; written so anyone can read it cold
  • Minimal questioning — only asks when genuinely ambiguous; one clear thread = no questions

Relevant Files & Links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment