---
name: extract-codebase-rules-from-developer-session-logs
description: "Reviews recent coding session logs for recurring mistakes, architectural misunderstandings, and manual corrections, then drafts path-scoped repository rule updates. Use when developer agent instructions need refreshing from real session evidence."
license: CC-BY-4.0
compatibility: "Needs access to: Terminal, GitHub, Docs."
metadata:
  author: "BotBento Editorial"
  version: "2026-10-15"
  source: "https://botbento.com/usecases/extract-codebase-rules-from-developer-session-logs/"
  kind: workflow
  hermes:
    tags: ["coding", "rules", "developer-tools", "context"]
    category: coding
    requires_toolsets: ["terminal", "file"]
---
# Extract codebase rules from developer session logs

Turn recurring coding errors into path-scoped repository guidelines

## When to use

Keep developer agent instructions up to date by reviewing recent programming session logs. The bot detects recurring mistakes, architectural misunderstandings, and manual corrections, then generates targeted directory-level instructions to prevent future errors.

## Inputs

- `terminal_transcripts`: Recent terminal transcripts used to identify failed tool calls and code that required manual correction.
- `coding_session_history`: Coding session history used to detect recurring errors, architectural misunderstandings, and manual corrections.
- `repository_rule_files` (optional): Existing repository rule files that may be updated with path-scoped guideline additions.

## Steps

1. When something happens: Coding session completes (A coding session completes and its logs are available for review.)
2. Extract error patterns and rules
3. Approve rule file updates

## Instructions

Parse recent terminal transcripts and coding session history to identify instances where tool calls failed or code required manual correction. Formulate concise, path-scoped rule recommendations targeting specific directories or files. Present the rule additions as a preview diff and ask for user approval before writing or updating any rule files in the repository.

## Approvals

- Writing or updating repository rule files waits for user approval.

## Output

Preview diff of proposed path-scoped rule additions for user review before rule files are updated. (format: markdown)

## Harness notes

- Claude Code: Save this file as ~/.claude/skills/extract-codebase-rules-from-developer-session-logs/SKILL.md (or .claude/skills/extract-codebase-rules-from-developer-session-logs/SKILL.md in the repo). Claude Code loads it when the task matches; run /extract-codebase-rules-from-developer-session-logs to start it directly.

## Source

Summarized in our own words from [Show HN: CodeYam Memory – comprehensive memory management for Claude Code](https://news.ycombinator.com/item?id=47248134) (Hacker News, checked 2026-10-15). Any results described there are the authors’ own.

From the BotBento use-case directory: https://botbento.com/usecases/extract-codebase-rules-from-developer-session-logs/. Licence: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).
