Go to file
Molecule AI Plugin-Dev af1adee4cf
All checks were successful
CI / validate (push) Successful in 56s
CI / validate (pull_request) Successful in 59s
Add test coverage for session-start-context hook
21 tests covering:
- _lib.py helpers: read_input, emit, deny_pretooluse, add_context, warn_to_stderr
- tail() helper: last-N-lines, missing file, malformed lines, fewer lines
- gh_count() helper: JSON parse, failure, exception, empty array
- Full hook integration: learnings context, repo state, error handling

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 10:27:11 +00:00
.github/workflows fix(ci): lowercase 'molecule-ai/' in cross-repo workflow refs 2026-05-07 00:59:23 -07:00
.molecule-ci/scripts import from local vendored copy (2026-05-06) 2026-05-06 13:53:31 -07:00
adapters import from local vendored copy (2026-05-06) 2026-05-06 13:53:31 -07:00
hooks import from local vendored copy (2026-05-06) 2026-05-06 13:53:31 -07:00
runbooks docs(install): migrate git clone URL to git.moleculesai.app (#37)\n\nAnonymous git-clone refs in CLAUDE.md, runbooks/local-dev-setup.md migrated github.com/Molecule-AI \u2192 git.moleculesai.app/molecule-ai. Public repo, no auth-shape change. Same pattern as the other plugin-* sweeps in the #37 series.\n\nRefs: molecule-ai/internal#37, molecule-ai/internal#38, molecule-ai/internal#42 2026-05-07 00:01:13 -07:00
tests Add test coverage for session-start-context hook 2026-05-10 10:27:11 +00:00
.gitattributes import from local vendored copy (2026-05-06) 2026-05-06 13:53:31 -07:00
.gitignore import from local vendored copy (2026-05-06) 2026-05-06 13:53:31 -07:00
CLAUDE.md docs(install): migrate git clone URL to git.moleculesai.app (#37)\n\nAnonymous git-clone refs in CLAUDE.md, runbooks/local-dev-setup.md migrated github.com/Molecule-AI \u2192 git.moleculesai.app/molecule-ai. Public repo, no auth-shape change. Same pattern as the other plugin-* sweeps in the #37 series.\n\nRefs: molecule-ai/internal#37, molecule-ai/internal#38, molecule-ai/internal#42 2026-05-07 00:01:13 -07:00
known-issues.md import from local vendored copy (2026-05-06) 2026-05-06 13:53:31 -07:00
plugin.yaml import from local vendored copy (2026-05-06) 2026-05-06 13:53:31 -07:00
pytest.ini Add test coverage for session-start-context hook 2026-05-10 10:27:11 +00:00
README.md docs: write substantive README.md 2026-05-10 08:33:00 +00:00
settings-fragment.json import from local vendored copy (2026-05-06) 2026-05-06 13:53:31 -07:00

molecule-session-context

Auto-loads recent learnings and workspace activity at session start. Pairs with molecule-skill-cron-learnings — together they give the agent a running summary of past decisions and current state before beginning work.

What it loads

  1. Recent learnings — reads the last 10 entries from ~/.molecule/cron-learnings.jsonl (written by molecule-skill-cron-learnings)
  2. Repo activity — runs git log --oneline -10 to surface recent commits
  3. Issue counts — runs gh issue list --state open to show open items

All output is emitted as additionalContext on SessionStart.

Install

In org template (org.yaml)

plugins:
  - molecule-session-context

Recommended: Also install molecule-skill-cron-learnings to populate the learnings file.

From URL (community install)

github://Molecule-AI/molecule-ai-plugin-molecule-session-context

Usage

No configuration needed. Install to activate — the hook fires on every session start.

Hooks

  • SessionStart — reads learnings + git log + issue counts, emits as context

Architecture

hooks/
  session-start-context.py   # Reads learnings, git, gh; emits additionalContext
  session-start-context.sh   # Shell wrapper
  _lib.py                     # Shared helpers
adapters/
  claude_code.py              # Registers hook
settings-fragment.json        # Declares SessionStart hook binding

Runtime

  • claude_code — primary

Known issues

See known-issues.md.

License

Business Source License 1.1 — © Molecule AI.