AIFlare
VisionDocs
Sign inStart free
Getting Started
  • Introduction
  • Quickstart
Features
  • Project Dashboard
  • Project Settings
  • Timeline
  • Team Collaboration
Skills
  • Skills Overview
  • Context Capture
  • Code Intent Lookup
  • Context Inject
  • Daily Digest
  • Weekly Digest
  • Session Compare
  • Session Summary
  • Prompt Evaluation
Administration
  • Members & Invitations
  • Account Settings
Skills ▸ Context

Work Context Capture (context-capture)

Foundational Skill

This is where every AIFlare insight begins. Every time an AI agent runs git commit, the work's intent, rejected alternatives, key change summary, and related conversation snippet are auto-captured into the aiflare/timeline/v1 branch in the user's git repo — the sole permanent store for the body — while the backend fetches it via the user-registered git remote credential and indexes metadata only. Every other skill — /why, /summarize, /daily-digest, and so on — consumes the data this capture produces.

Overview

context-capture is the only skill the user never invokes directly. The Claude Code post-commit hook combined with the SKILL.md enforcement message activates it automatically right after every commit — the agent summarizes its own conversation context, and capture.js writes the body directly into the aiflare/timeline/v1 orphan branch (entries/<commitHash>.json) in the user's git repo. Backend delivery is consolidated into a single sync trigger at git push time.

TriggerRight after git commit (PostToolUse hook → Skill enforcement message)
InvocationAutomatic — the user never invokes it explicitly
Write targetaiflare/timeline/v1 branch in the user's git repo (entries/<commitHash>.json) — POST /api/v1/captures/sync after git push triggers a backend fetch
StorageThe user's git repo (aiflare/timeline/v1) is the sole permanent store for the body. Backend DB holds only metadata and derived indices (no vendor lock-in, host-agnostic)

What gets captured

A single commit produces one Timeline Entry that bundles the seven fields below.

FieldTypeDescription
titlestringWork title under 50 chars. Defaults to the commit message's subject line.
intentmarkdownWhy this change was needed, written as Problem → Solution → Effect. The rule is to make decision context survive six months from now.
alternativesmarkdownOnly alternatives explicitly raised in the conversation and the reason they were rejected. Empty string if no signal — speculation is forbidden.
diffSummarymarkdownPer-file summary of key changes. Excludes incidental noise like import cleanup or formatting.
tagenumOne of FEATURE · BUGFIX · REFACTORING · TEST · DOCS. Used to filter the dashboard by change type.
changedFilesstring[]Changed-file list pulled verbatim from git diff --name-only HEAD~1 HEAD.
conversationSnippetjsonlJSONL of user + AI conversation since the previous capture. Extracted by line-count (message-index) delta and stored alongside the Entry.

How it works

A seven-stage pipeline: Hook → Skill → server → grouping → push. There is nothing the user has to invoke.

Phase 0
SessionStart Hook

On session start, exports CLAUDE_SESSION_ID into $CLAUDE_ENV_FILE so capture.js can deterministically resolve the current session — required for correct routing under parallel Claude Code sessions.

Phase 1
UserPromptSubmit + Stop Hook

Appends user prompts and AI responses as JSONL lines into .claude-prompts-{SESSION_ID}.

Phase 2
PostToolUse(AskUserQuestion) Hook

Right after AskUserQuestion, drops a .pending-question flag file. Used as the next commit's continuation signal so grouping isn't broken.

Phase 3
PostToolUse(git commit) Hook

Right after git commit: ① PUT the full conversation JSONL to /work-sessions/prompt, ② extract only new lines since the previous capture into a delta file, ③ emit the Skill enforcement message.

Phase 4
context-capture Skill activates

The agent analyzes its own context to generate title/intent/alternatives/diffSummary/tag, then runs capture.js. The delta file is auto-read and attached as conversationSnippet. No backend transmission — the body is written to the git tree in the next phase.

Phase 5
git tree write (aiflare/timeline/v1)

capture.js writes the body to entries/<commitHash>.json on the aiflare/timeline/v1 orphan branch. No backend call at this point (works offline); grouping (group_root_id) is decided on the next push during backend sync.

Phase 6
pre-push Hook + backend sync

The pre-push hook pushes the aiflare/timeline/v1 branch to the user's git remote (force-with-lease), then sync-captures.js calls POST /api/v1/captures/sync (no body). The backend fetches the timeline branch via the registered git remote credential using standard git protocol, then reconciles DB metadata and resolves group_root_id (based on the previous entry and the continuation flag). POST /captures and POST /captures/batch were permanently removed (410 Gone) in Phase 6.

How other skills use it

The Timeline Entries and EntryConversations produced by context-capture are consumed directly by the skills below. If this skill stops working, every other skill loses its input.

/why

Joins captured intent and alternatives with git log -L by line, producing a chronological timeline of why this single line was written that way.

/summarize

Aggregates one session's captures into a one-page report of goal, considered alternatives, and final changes, then saves it on the server.

/context-inject

Re-injects the report saved by summarize into a new session's LLM context, carrying the decision context over verbatim.

/daily-digest

Auto-compiles a day's worth of captures into a Markdown report covering commits, sessions, tag distribution, and key decisions.

/weekly-digest

Aggregates a week's captures by member and area to produce a team-perspective weekly report.

/session-compare

Compares two sessions' captures side by side on intent, approach, and outcomes.

/prompt-evaluate

Grades captured user prompts against Claude Code best practices and proposes improvements.

Troubleshooting

Five most common reasons capture doesn't fire.

Symptom
Resolution
context-capture is missing from the /skills list
Confirm the .claude/skills/context-capture/ directory exists at the project root; re-run the installer if not.
Commits don't produce a Timeline entry
Check that api_key and endpoint in aiflare.yml are correct. capture.js silently exits when the config is missing. Also confirm a git remote credential is registered in the console — without it the body lands in the git tree but the backend never indexes the metadata, so the entry never appears on the team timeline.
Entry is created but conversation snippet is empty
Check whether .claude-conversation-delta-{SESSION_ID} exists. If SessionEnd ran too early or hooks are missing, the delta can be empty.
Captures route to the wrong session under parallel sessions
Verify the SessionStart hook exports CLAUDE_SESSION_ID into $CLAUDE_ENV_FILE. With the env var empty, capture.js falls back to mtime-based heuristics.
After push, the entry never reaches the team timeline
Confirm .git/hooks/pre-push is installed and executable. If the hook is missing or the timeline-branch push / sync call failed, the body stays on the local aiflare/timeline/v1 branch only; backend metadata is updated only on the next successful push + sync. If the token expired or was revoked, re-register the credential in the console.
← Skills

On this page

AIFlare
Made with ♥ in Seoul
© 2026 AIFlare. All rights reserved.
Product
SkillDocs
Company
Vision
Resources
PrivacyTerms
Connect
GitHub