Skip to content

Conversation

@marcusquinn
Copy link
Owner

@marcusquinn marcusquinn commented Feb 8, 2026

Summary

  • Consolidate Worker TODO.md restriction from 7 redundant copies to 1 authoritative source (workflows/plans.md) + compact one-liner refs
  • Compress interactive-only AGENTS.md sections (Terminal, Browser, Memory Triggers, Getting Started) from inline detail to compact pointers
  • Zero knowledge lost — all detail preserved in authoritative source files

Token Savings

Scope Before After Saved
AGENTS.md (every session) 18,351 bytes 14,799 bytes 3,552 bytes (~888 tokens)
build-plus.md 14,087 bytes 13,930 bytes 157 bytes
plan-plus.md 10,761 bytes 10,659 bytes 102 bytes
full-loop.md 14,446 bytes 14,339 bytes 107 bytes
Total 135,222 bytes 131,304 bytes 3,918 bytes (~979 tokens)

Over an 8-task batch with ~1.5 retries avg: ~11,448 tokens saved.

Knowledge Preservation

Every removed paragraph has its full detail preserved in the designated authoritative source:

Instruction Authoritative Source What's preserved
Worker TODO.md restriction workflows/plans.md Ownership model, race condition timeline, flock locking, serialized flow
Worker reporting (exit code/log/mailbox) scripts/commands/runners.md Single-writer constraint, shared files note
Browser automation decision tree tools/browser/browser-automation.md Full tool selection matrix, ARIA snapshots, benchmarks
Memory trigger types memory/README.md Full trigger table, auto-capture patterns, privacy filtering
Terminal capabilities Already known to the model PTY access, CLI examples
Installation commands /onboarding wizard Full install instructions

Testing

All 78 tests pass (77 pass, 1 pre-existing skip, 0 failures).

Summary by CodeRabbit

  • Documentation
    • Clarified and simplified agent workflow guidelines for planning document integrity.
    • Condensed procedural sections for improved clarity and readability.
    • Strengthened restrictions around automated task management to prevent conflicts.

… efficiency

Consolidate repeated instructions to single authoritative sources:
- Worker TODO.md restriction: 7 files -> plans.md (authoritative) + compact refs
- Terminal/Browser/Memory/Getting Started: inline detail -> compact pointers

Savings: ~888 tokens per session from AGENTS.md (always-loaded), ~979 tokens
total across worker-loaded files. Over an 8-task batch: ~11K tokens saved.

No knowledge lost — all detail preserved in authoritative source files
(workflows/plans.md, tools/browser/browser-automation.md, memory/README.md).
Compact refs point to the full docs.
@gemini-code-assist
Copy link

Summary of Changes

Hello @marcusquinn, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refactors agent instructions to improve token efficiency by centralizing and compressing documentation. It consolidates repetitive information, such as worker restrictions and detailed operational guides, into single authoritative sources, replacing verbose inline content with concise references. This optimization significantly reduces the token count required for agent sessions while ensuring all comprehensive details remain accessible in their designated documentation files.

Highlights

  • Instruction Deduplication: Consolidated redundant agent instructions, particularly the 'Worker TODO.md restriction,' from multiple files into a single authoritative source (workflows/plans.md).
  • Content Compression: Significantly compressed verbose sections in AGENTS.md related to Terminal capabilities, Memory Triggers, Getting Started, and Browser Automation into more concise, reference-based summaries.
  • Token Efficiency: Achieved substantial token savings (approximately 888 tokens per session in AGENTS.md and a total of ~979 tokens across all affected files) by reducing verbosity.
  • Knowledge Preservation: Ensured that no information was lost by replacing detailed inline explanations with compact pointers to authoritative source files where the full context is maintained.
Changelog
  • .agents/AGENTS.md
    • The 'Worker TODO.md restriction' was condensed, directing readers to workflows/plans.md for full details.
    • The 'Terminal Capabilities' section was streamlined into a single line, summarizing functionality and providing examples.
    • Detailed sections on 'Proactive Memory Triggers' and 'Auto-Capture with --auto Flag' were replaced with a brief summary and a reference to memory/README.md.
    • The 'Getting Started' section's installation and initialization instructions were removed, replaced by a pointer to the /onboarding wizard.
    • The 'Browser Automation' section was made more concise, referring to tools/browser/browser-automation.md for the full decision tree.
    • The 'Localhost Standards' section was simplified, directing to services/hosting/localhost.md.
  • .agents/build-plus.md
    • The 'Worker restriction' regarding TODO.md editing was shortened, with a reference to workflows/plans.md.
  • .agents/plan-plus.md
    • The 'Worker restriction' regarding TODO.md editing was shortened, with a reference to workflows/plans.md.
  • .agents/scripts/commands/full-loop.md
    • The instruction 'Do NOT edit TODO.md' was made more concise, including a reference to workflows/plans.md.
Activity
  • All 78 tests passed, with 77 successful and 1 pre-existing skip, indicating no new failures were introduced by these changes.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 8, 2026

Walkthrough

Agent documentation is consolidated and tightened across multiple files, with verbose guidance condensed into concise statements and worker editing restrictions on TODO.md explicitly standardized to a blanket prohibition across all agent planning and execution workflows.

Changes

Cohort / File(s) Summary
Worker Restriction Enforcement
build-plus.md, plan-plus.md, scripts/commands/full-loop.md
Worker restriction on TODO.md editing strengthened from conditional/context-dependent language to an explicit blanket prohibition: "Workers must NEVER edit TODO.md," with references to workflows/plans.md.
Core Agent Guidance Consolidation
AGENTS.md
Multiple sections condensed: Terminal Capabilities, Proactive Memory, Onboarding/CLI references, Browser Automation, and Localhost Standards rewritten to concise single-sentence or brief formats; verbose bullet lists collapsed; deprecated decision trees removed; worker edit restrictions simplified.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Possibly related PRs

Poem

🚫 Workers, hear this truth so clear:
TODO.md stays pristine here!
No edits, scripts, or branching schemes—
Keep the docs clean, the rules supreme! 📋✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: refactoring agent instructions to reduce token consumption through deduplication.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/agent-token-efficiency

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
.agents/plan-plus.md (1)

121-133: Clarify interactive vs worker scope to avoid mixed signals.

The system-reminder allows TODO.md writes, but the new worker restriction forbids them. Consider adding a short qualifier in the system-reminder or next to the restriction (e.g., “interactive sessions only”) so headless/worker usage is unambiguous.

Suggested tweak
-**Allowed writes:**
+**Allowed writes (interactive sessions only):**

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Feb 8, 2026

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 37 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Sun Feb 8 19:09:42 UTC 2026: Code review monitoring started
Sun Feb 8 19:09:42 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 37

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 37
  • VULNERABILITIES: 0

Generated on: Sun Feb 8 19:09:45 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 8, 2026

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request effectively refactors several agent instruction files to improve token efficiency. The changes are well-aligned with the goal of deduplicating content and relying on single sources of truth, which should result in the token savings outlined in the description. The approach is consistent across all modified files. I have one suggestion for .agents/AGENTS.md to consider retaining a key instruction that was removed during the compression, as its absence might affect the agent's operational correctness.

- Use `.local` domains (enables password manager autofill)
- Always SSL via Traefik + mkcert
- See `services/hosting/localhost.md`
`.local` domains + SSL via Traefik + mkcert. See `services/hosting/localhost.md`.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The summary for Localhost Standards has removed the instruction to check for an open port first using localhost-helper.sh check-port <port>. This seems like a crucial operational step that might be worth retaining in the summary for the agent's immediate awareness, even with the goal of token reduction. Losing this quick reference could lead to errors if the agent tries to start a service on an occupied port.

Suggested change
`.local` domains + SSL via Traefik + mkcert. See `services/hosting/localhost.md`.
Check port first with `localhost-helper.sh check-port <port>`. Use `.local` domains + SSL via Traefik + mkcert. See `services/hosting/localhost.md`.

@marcusquinn marcusquinn merged commit 486969a into main Feb 8, 2026
14 of 15 checks passed
@marcusquinn marcusquinn deleted the refactor/agent-token-efficiency branch February 8, 2026 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant