session-context

Gathers session context for project-analysis agent including git history, recent plans, and pending work detection.

⭐5stars🔀1forks📁View on GitHub🕐Updated Jan 11, 2026

When & Why to Use This Skill

The session-context skill is designed to enhance the situational awareness of AI agents by aggregating critical project metadata. It solves the problem of 'context fragmentation' by programmatically gathering Git history, uncommitted changes, and local development plans. This ensures that project-analysis agents have a comprehensive, up-to-date understanding of the workspace state, leading to more accurate code analysis, better continuity between sessions, and more relevant technical recommendations.

Use Cases

  • Session Resumption: Quickly bring an AI agent up to speed when restarting work by providing a summary of recent commits and pending tasks.
  • Project State Auditing: Automatically detect uncommitted changes and 'pending work' flags to prevent the agent from making redundant or conflicting suggestions.
  • Contextual Planning: Integrate local plan files (.claude/plans/) with Git history to help the agent align its next steps with the established project roadmap.
  • Automated Status Reporting: Generate human-readable or JSON-formatted summaries of the current development branch and recent activity for project tracking.
namesession-context
descriptionGathers session context for project-analysis agent including git history, recent plans, and pending work detection.
toolsRead, Glob, Grep, Bash

Skill: session-context

Gathers session context for project-analysis agent: git history, recent plans, and pending work detection.

Trigger

Agent invokes skill with: "Gather session context for [session_type]"

Where session_type is one of: startup, resume, clear, compact

Usage

uv run --directory ${CLAUDE_SKILLS_PATH}/session-context python -m src [session_type] [--json]

Arguments

  • session_type: One of startup, resume, clear, compact (default: startup)
  • --json: Output as JSON (default: human-readable)

Output

Returns structured context including:

Git Context

  • Current branch
  • Recent commits (configurable limit)
  • Uncommitted changes summary
  • Pending work flag

Recent Plans

  • Last N plans from .claude/plans/
  • Topic, date, completion status for each

Configuration

  • Session behavior settings from config.yml

Example Output (JSON)

{
  "session_type": "startup",
  "git": {
    "branch": "main",
    "last_commits": [
      {"hash": "abc123", "message": "feat: add feature", "date": "2025-01-15"}
    ],
    "uncommitted_changes": {
      "staged": 2,
      "unstaged": 1,
      "untracked": 0
    },
    "has_pending_work": true
  },
  "recent_plans": [
    {
      "filename": "20250115_120000_feature-impl.md",
      "topic": "feature-impl",
      "date": "2025-01-15",
      "has_incomplete_todos": false
    }
  ],
  "config": {
    "session_behavior": "full"
  }
}

Dependencies

  • gitpython: Git repository interaction
  • pyyaml: Config file parsing
  • structlog: Logging

Integration

This skill is invoked by the project-analysis agent to gather context before presenting session analysis.