Copilot Session Review Agent with Chronicle
Ticket #357: Added Copilot Session Review Agent with Chronicle
Type: Automation / Workflow / Cost Optimization
Date: September 2, 2026
Affected Component: .github/copilot-instructions.md, .github/agents/speckit.session-review.agent.md, French activity report
1. Context and Objective
This session aimed to improve the use of GitHub Copilot in the project, with a particular focus on reducing token consumption.
The analysis of recent sessions showed that the work was already structured with Spec Kit, but some sessions remained very long and required several follow-ups to continue, verify results, update documentation, and close the work.
The decision was therefore made to introduce a closing-review agent capable of analyzing a completed session with Chronicle and producing concrete recommendations, without adding permanent event collection that would increase the cost of every session.
2. Work Completed
Activation of Project Instructions
The .github/copilot-instructions.md file was created at the location automatically recognized by VS Code. It captures the project's essential rules concerning:
- sequential use of Spec Kit;
- priority consultation of the LLM Wiki;
- targeted tests after changes;
- documentation, activity reports, and coverage;
- reading only the files required for the current task;
- French communication and English names for published files.
The existing detailed file .github/agents/copilot-instructions.md was retained as a complementary reference.
Creation of the Session Review Agent
The new agent .github/agents/speckit.session-review.agent.md is available under the name speckit.session-review and can be called with:
Its operation is constrained to limit context and cost:
- two-pass Chronicle analysis, with compact aggregates before detailed reading;
- mandatory use of read-only queries;
- comparison with no more than 3 to 5 relevant activity reports;
- detection of follow-ups, corrections, failed tests, large pastes, and repetitions;
- distinction between cloud token data and indirect indicators from local storage;
- production of no more than 3 to 5 prioritized recommendations;
- direct update of the French report and its English mirror when the matching report is identified.
3. Design Decisions
- Voluntary trigger: the command is run once when a session is closed. VS Code does not provide a reliable trigger to execute an agent automatically when chat closes.
- Direct writing: the agent adds or replaces only a dedicated recommendations section; existing business sections, tags, and test results remain unchanged.
- Limited historical scope: only the most recent reports closest to the feature are used, avoiding a costly exhaustive reread.
- Cautious measurement: local storage does not provide detailed per-model and per-token measurements. The agent therefore uses turn count, duration, request size, lack of compaction, and repetitions as indirect indicators.
- Spec Kit compatibility: Spec Kit retains responsibility for specification, clarification, planning, task breakdown, analysis, and implementation. The new agent runs after those steps as a process-improvement control.
4. Result and Expected Benefit
The project's rules are now loaded automatically by VS Code, and a specialized agent can turn session closure into a structured retrospective.
The expected token saving is indirect but measurable in future sessions: fewer repeated reminders, fewer repeated documentation reads, fewer broad follow-ups, and better separation between planning, implementation, and closure.
The agent is not intended to run after every message. Running it once at the end of a session avoids adding a permanent load to the working context.
5. Validation
- No errors were detected by VS Code validation for
.github/copilot-instructions.md. - No errors were detected by VS Code validation for
.github/agents/speckit.session-review.agent.md. git diff --checkcompleted successfully for the created files.- The new agent was confirmed in the list of VS Code agents.
- No application tests were required: this session changed only Copilot configuration and project documentation.
6. Limitations and Next Observations
- Automatic analysis when a session closes is not available;
/speckit.session-reviewmust be launched explicitly. - The matching report must already exist so the agent can add its section without creating an ambiguous business report.
- Local measurements will remain proxy-based estimates until detailed consumption data becomes available.
- Actual effectiveness should be evaluated after several uses by comparing turn count, follow-ups, and session duration before and after activation.
7. Token Usage Summary
This session, lasting less than two hours, performed a targeted analysis of Chronicle history and then created a closing-review agent. The reported consumption was 15.72 Copilot AI credits, with the supplied amounts $0.16.
The choice of a manual trigger and comparison limited to 3 to 5 reports is specifically intended to prevent the improvement tool from consuming more context than it saves.