ClevAgent is in Early Access. Please contact us if you have any questions!
ClevAgent
Logic framework

Our Logics

The rules ClevAgent uses to understand agent behavior, intervene at the right moment, and explain the result.

Note
Today, these Logics focus on agent efficiency: duplicate work, stale context, file organization, long files, and memory hygiene. The same framework can extend to security, privacy, and audit rules as ClevAgent grows. This page explains the customer-facing principles behind each Logic while keeping the public story readable and the measurement claims conservative.
duplicate-read

Re-reading files already in context

Rule 1 detects when an agent reads file content that is already available in the current working context. ClevAgent compares new file pulls with previously observed content and only intervenes when the repeated work is clear enough to explain.

A different part of the same file is allowed. If the file changes, ClevAgent stops treating older content as reusable, so the Logic does not tell the agent to rely on stale context.

The visible warning happens after the repeated read has already appeared in the tool result. That is why Rule 1 uses a behavior-correction model instead of pretending the first duplicate was prevented.

Shell-based reads are included only when ClevAgent can map the file content safely. Ambiguous output is ignored rather than counted, because a false intervention is worse than missing a marginal optimization.

Guidance style
This file range is already available in the current context. Reuse the earlier output, then continue the original task.
How we count it
Customer-facing savings are counted only for repeated read behavior ClevAgent can observe with high confidence. We do not claim that every triggering read was prevented; the public estimate is based on later repeated work the reminder is expected to reduce.
Measurement guardrails
ClevAgent separates observed waste from estimated downstream impact and avoids claiming savings from ambiguous shell output. The public estimate is intentionally narrower than the raw behavior we can detect.
stale-reread

Forgetting its own writes

Rule 2 detects when the agent reads content it just wrote or edited itself. The agent already produced that content, so a readback is often a sign that it lost track of its own work.

ClevAgent uses structured write and edit evidence when available. If another process may have changed the file, the Logic backs off instead of assuming the agent still knows the current state.

This is intentionally conservative. The Logic only helps when the written content is known well enough to be reused safely.

Guidance style
This Read on `{file}` follows your own Write. Use the content you just wrote instead of pulling it back again, then continue the original task.
How we count it
Savings are attributed to repeated stale readback behavior after the first visible reminder. ClevAgent avoids double-counting repeated reads of the same written content and keeps this separate from duplicate-read savings.
Measurement guardrails
When the agent forgets content it created, ClevAgent nudges it back to its own known output and accounts only for defensible avoided repetition. The model avoids double-counting the same written content across nearby reads.
file-path-advisor

Writing files in the wrong place

Rule 3 is a workspace-hygiene Logic, not a direct cost-savings Logic. It watches files the agent creates or modifies and asks whether the file will be easy to find in a later session.

ClevAgent infers the active project from the session cwd, repo markers, and nearby workspace folders. It also infers the active agent workspace root, such as ~/.claude, ~/.codex, ~/.gemini, or another detected agent root, then maps reusable artifacts into a two-level structure: {agentRoot}/{Project}/{Topic}/{filename}.

Standard routing is deterministic and based on visible workspace context. ClevAgent avoids calling an LLM for routine placement decisions; judgment can be added later only for genuinely ambiguous cases.

It stays quiet for normal source files, configs, generated folders, internal agent stores, and files already inside the right project workspace. Failed writes do not produce stale advice.

Guidance style
`{filename}` may get buried in `{currentDir}`. Move it exactly to `{agentRoot}/{Project}/{Topic}/{filename}` and keep that filename. After that, continue the original task.
How we count it
Rule 3 is logged outside the dollar-savings total because its value compounds over future sessions. Cleaner paths reduce rediscovery work, improve handoffs, and make later agent context easier to load.
Measurement guardrails
ClevAgent keeps reusable artifacts findable without turning every file write into a warning. It only treats placement as hygiene value, not immediate dollar savings.
file-length-advisor

Piling everything into one file

Rule 4 is a long-term agent-efficiency Logic, not a large-read blocking rule. It fires when ClevAgent can verify that a working file has become large enough to slow future search, editing, or context loading.

File size can be observed from structured file actions or safe shell evidence. Failed commands do not create long-file warnings.

ClevAgent suppresses Rule 4 when the user explicitly asked for one long file. It also excludes formats where raw line count is not a useful signal, such as generated assets, lock files, logs, tabular data, and notebooks.

Guidance style
This file is getting large enough to slow future work. If it has real structure, split or index it; if it is a throwaway artifact, stub, archive, or delete it.
How we count it
Rule 4 does not book savings when the suggestion appears. It only counts after the user sends the cleanup guidance and the event meets the accepted-action criteria.
Measurement guardrails
ClevAgent treats long files as future context risk and separates user-approved cleanup from automatic dollar claims. A warning alone is not counted as savings.
memory-md-optimizer

Letting memory files balloon

Rule 5 is a periodic memory-hygiene Logic. It is not a size alarm and it does not auto-edit memory. It creates a lightweight checkpoint for reviewing whether agent memory has obvious cleanup candidates.

At a configured session interval, ClevAgent checks whether monitored memory stores exist. Quick checks stay narrow: they look for obvious candidates by file metadata first and do not rewrite memory without a second explicit user approval.

The delivery mode is always user-suggestion. ClevAgent shows a lightbulb to the user; nothing is injected into the agent unless the user clicks Send. Deep memory compression is a separate explicit audit, not a periodic popup.

Guidance style
Run a quick memory hygiene check. Identify only obvious cleanup candidates, do not rewrite memory yet, and ask for approval before any change.
How we count it
Quick checks do not claim savings by themselves. Rule 5 savings require user-approved memory changes and verified shrinkage after cleanup cost is accounted for.
Measurement guardrails
ClevAgent distinguishes a harmless hygiene reminder from a verified memory-compression result. Quick checks are tracked separately from real cleanup work.