Skip to content

Content preview for Write/Edit tools #7

@djdarcy

Description

@djdarcy

Summary

Show first ~20 characters of content for Write and Edit operations to help identify what was written without checking the files.

Current Behavior

[[2026-02-01 18:55:36]] {Write: "C:\code\file.txt" }
[[2026-02-01 18:55:56]] {Edit: "C:\code\file.txt" }

Only path is logged.

Desired Behavior

[[2026-02-01 18:55:36]] {Write: "C:\code\file.txt" ← "# Session Logger..." }
[[2026-02-01 18:55:56]] {Edit: "C:\code\file.txt" ← "def main():\n    ..." }

Arrow indicates content direction, preview truncated at ~20 chars with ....

Implementation Notes

  • For Write: use content field
  • For Edit: use new_string field (the replacement text)
  • Escape newlines as \n for single-line display
  • Handle binary/non-printable content gracefully
  • Truncate with ... if over limit
  • Do NOT log old_string (user can check git diff)

Considerations

Analysis

See 2026-02-01__19-10-22__session-logger-enhancements-analysis.md for detailed analysis.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions