Skip to content

feat: sessions files and sessions by-file subcommands #611

@AlexMikhalev

Description

@AlexMikhalev

Feature Request

Add file-level tracking to the sessions subcommand group:

sessions files <session-id>

List files touched by a specific session, extracted from tool invocations in the JSONL data.

Extraction targets:

  • Read tool -> tool_input.file_path
  • Edit tool -> tool_input.file_path
  • Write tool -> tool_input.file_path
  • MultiEdit tool -> tool_input.file_path
  • NotebookEdit tool -> tool_input.notebook_path
  • Glob tool -> tool_input.path
  • Grep tool -> tool_input.path

Output:

  • Categorize as "read" vs "written" (Edit/Write/MultiEdit/NotebookEdit = written)
  • Support --json for programmatic use
  • Default: human-readable table

sessions by-file <file-path>

List sessions that touched a given file path (substring match).

Output:

  • Session ID, topic, read/write mode
  • Support --json

Context

terraphim-agent already parses JSONL session files for sessions search, sessions list, and sessions stats. This extends extraction to the tool_input fields for file path tracking.

A temporary bridge script exists at scripts/session-files.py in the cto-executive-system project. This upstream implementation would supersede it.

Proposed CLI

terraphim-agent sessions files <session-id> [--json]
terraphim-agent sessions by-file <file-path> [--json]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions