bfiles
2025-06-01
Added token counting and file chunking for LLM context window awareness
15 files · 951+ · 532-
Token counting support
2 files changed
core.py694 lines of changes adding token counting and reorganizing the bundling pipelinemetadata.pyAdded per-file and content-level token count estimates using tiktoken
- Added per-file and content-level token count estimates to bundle output using tiktoken
instantiate
behavioral
2 files
metadata.pycore.py
- Stable implementation tracking token counts for each file and aggregate totals
instantiate
internal
1 file
core.py
- Token counts appear in bundle metadata headers for LLM context window planning
instantiate
internal
1 file
metadata.py
File chunking
1 file changed
config.pyAdded chunk_size and chunk_overlap configuration fields
- Implemented
--chunk-sizeand--chunk-overlapCLI options for splitting large files instantiate behavioral2 files
cli.pyconfig.py
- Core chunking logic splits files by token count with configurable overlap between chunks
instantiate
internal
1 file
core.py
- Prepared infrastructure for multi-file chunked output
instantiate
behavioral
1 file
core.py
CLI and output updates
6 files changed
cli.pyUpdated CLI arguments, default output location, and added chunking-related optionsoutput.pyUpdated output display logicmetadata_writer.pyUpdated metadata writer for token count and chunk dataexclusions.pyMinor exclusion handling updatesREADME.mdUpdated documentationpyproject.tomlAdded tiktoken dependency
- Updated CLI arguments and default output location
interface
behavioral
1 file
cli.py
- Added chunking-related options to the command interface
instantiate
behavioral
1 file
cli.py
Test expansion
6 files changed
test_cli.py163 lines of new tests for chunking CLI options and token count displaytest_core.py253 lines of new tests for chunking logic and token countingtest_exclusions.pyUpdated exclusion teststest_metadata.pyUpdated metadata teststest_output.pyUpdated output testsoutput.pyUpdated output fixtures
- Added 163 lines of new CLI tests for chunking options and token count display
qualify
behavioral
1 file
test_cli.py
- Added 253 lines of new tests for chunking logic and token counting
qualify
internal
1 file
test_core.py
- Updated output and exclusion tests
qualify
behavioral
2 files
test_exclusions.pytest_output.py
Branch merges
1 file changed
cli.pyMerged fix/bfiles-import-errors branch changes