Skip to content

Instantly share code, notes, and snippets.

@TheGU
Created June 4, 2026 10:59
Show Gist options
  • Select an option

  • Save TheGU/c4bf0b8ed2f646706c76303c718315d1 to your computer and use it in GitHub Desktop.

Select an option

Save TheGU/c4bf0b8ed2f646706c76303c718315d1 to your computer and use it in GitHub Desktop.
Session base to keep project knowledge inside project itself and allow agent to resume without read all codebase

Session Protocol

START of session

  1. Read docs/session/.current_session for active plan.
  2. If a plan exists → read it, understand current sprint and next tasks.
  3. If no plan exists → process user request. For non-trivial work, create a plan first.
  4. Check TASK.md for overall project status.

DURING session

  1. Work on tasks from the active plan.
  2. Update TASK.md: [/] in progress, [x] completed. Keep entries concise.
  3. Update the plan file: check off completed items, add findings/detail there (not in TASK.md).

When receiving feedback or corrections on the current plan

Revise the current plan in-place — do NOT create a new one.

  1. If the user gives feedback, points out a wrong approach, or requests changes:
    • Edit the existing plan file — update the affected tasks to reflect the corrected approach.
    • Add a dated note in the Findings/Progress section explaining what changed and why.
    • Keep all unaffected remaining tasks intact.
  2. Only create a new plan if the scope has fundamentally changed (e.g., user requests an entirely different feature). Even then:
    • Properly close the old plan: mark remaining items as [-] deferred or → moved to <new plan>.
    • List all carried-forward items in the new plan with a reference to the old plan.
    • Never silently abandon unchecked items — every remaining task must be explicitly accounted for.
  3. Changing the approach to one task does not affect unrelated tasks — only modify the tasks that the feedback applies to. All other remaining work in the plan stays as-is.

END of session (every assistant turn)

  1. Summarize: brief requirement, findings, work done (with suggested git commit message), recommendations, next steps.
  2. Update plan file: check off items, add findings/recommendations to current sprint section.
  3. Update TASK.md to reflect current state (concise status only).

When ALL tasks in a plan are complete

  1. Mark everything [x] in both plan file and TASK.md.
  2. Clear docs/session/.current_session (empty the file, don't delete it).

Starting a NEW plan

  1. Check the current plan first — if .current_session points to an active plan with remaining tasks, you must handle those tasks before starting a new plan (revise in-place, carry forward, or explicitly defer). Never silently replace an active plan.
  2. Create plan file: docs/session/YYYY-MM-DD-HHMM_short-description.md
  3. Include: problem statement, scope, sprint breakdown with task checklists.
  4. If replacing an old plan, include a "Carried from" section listing deferred items and a reference to the old plan file.
  5. Add corresponding tasks to TASK.md (concise entries only).
  6. Write the plan filename into docs/session/.current_session.

Other

  1. Do not use /tmp, always use local project or relative path.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment