Repository navigation
loq 0.2.0
Features
- Approximate token budgets:
max_tokensrules limit prompts and other agent-facing files by an estimated token count (bytes / 4, rounded up) instead of by line count. default_max_tokens: sets a default token budget for files that no rule matches. Set eitherdefault_max_linesordefault_max_tokens, not both.
Fixes
baseline,relaxandtightennow find the config file the same waycheckdoes. When run from a subdirectory, they update the nearestloq.tomlabove it with paths relative to that file, and only scan the current directory. Rules for files outside that directory stay as they are.baselinekeeps token rules, and the edit commands no longer touch token-governed files.- Directory walks always skip
.git, so you no longer need.git/**inexclude. checknow warns about paths that don't exist, and CLI warnings are clearer.
Upgrading
Configs that worked on 0.1.0 work unchanged on 0.2.0. A few changes are visible:
- JSON output includes
metric("lines"or"tokens") andapproximateon every violation. Token violations reporttokensandmax_tokensin place oflinesandmax_lines. - Subdirectory runs of
baseline/relax/tightenused to create a newloq.tomlin the current directory. They now update the project's existing config instead. If you have a strayloq.tomlfrom that old behavior, it's still used, because it's the nearest config file. .gitcontents are no longer checked, even if yourexcludedoesn't list them.
Other
- Internal refactors and expanded test coverage.
What's Changed
- Centralize path identity by @jakekaplan in #55
- Centralize exact-path limit editing by @jakekaplan in #56
- Centralize cached file inspection by @jakekaplan in #57
- [codex] Support approximate token budgets by @jakekaplan in #58
- [codex] improve CLI warning output by @jakekaplan in #59
- Cleanup: dedup change commands, fix config discovery, add default_max_tokens by @jakekaplan in #65
- Remove dead check result state by @jakekaplan in #66
- Encode valid limit changes by @jakekaplan in #67
- Skip .git when walking directories by @jakekaplan in #68
- prep-0.2.0 by @jakekaplan in #69
Full Changelog: v0.1.0...v0.2.0